Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import yt
def NewField(field, data):
q = data[('STAR', 'age')]
print("BBB",data)
return q
ds = yt.load("sizmbhloz-clref04SNth-rs9_a0.9011/sizmbhloz-clref04SNth-rs9_a0.9011.art")
ad = ds.all_data()
print("AAA", ad["STAR", "age"])
ds.add_field(("STAR", "new-field"), function=NewField,
units='auto', dimensions="time", sampling_type="particle")
print("CCC", ad["STAR", "new-field"].to('yr'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.