Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import yt
def NewField(field, data):
q = data[('STAR', 'age')]
return q
ds = yt.load("sizmbhloz-clref04SNth-rs9_a0.9011/")
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.