Created
May 27, 2018 17:02
-
-
Save ngoldbaum/4d27987bda8ecbce5c9bd9b98bbbbf49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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