j: Next unread message
k: Previous unread message
j a: Jump to all threads
j l: Jump to MailingList overview
I've been asked by someone who is using yt to analyze ARTIO data (yes! they exist!). They're interested in the distribution of star particle creation times (BIRTH_TIME in the internal code nomenclature). There is code to do a conversion to age that seems to have been borrowed from the ART frontend, but it's incomplete and incorrect for z > 0, so I'm porting over the c code that we use internally in ART(IO). That's all fine and good, but there's still a residual issue with code_units that I don't quite understand and hoping someone can quickly point me in the right direction.
ARTIO defines an attribute time_unit, which is stored in the ARTIO fileset and is the correct code_time -> seconds unit conversion at the redshift of the snapshot. The mapping from code time to physical time is non-linear, however, so a code unit defined at a different redshift cannot be simply converted to physical time in cgs using this number (which looks like what happens now).
Is there an easy way to override code_unit -> cgs (and other) unit mappings when it's a non-linear function? I can obviously create pre-converted versions of these fields (creation_time and particle_age both defined in seconds), but that doesn't prevent someone from loading ("STAR","BIRTH_TIME") and asking yt to convert it from code units to cgs, and getting the wrong answer:
i.e. yt.load("artio dataset").all_data()[("STAR","BIRTH_TIME")].in_cgs() gives nonsensical values.
Douglas Rudd Scientific Computing Consultant Research Computing Center firstname.lastname@example.org