Hi Jacob,

Oh, dang, this is a great idea!  I really like this.  So what I'm thinking is that there may be a way to do this without touching too many places.  Since it's TNG data I think it should be subclassing the gadget HDF5 dataset class.  Can you try, before loading any of your datasets, doing this?

import yt
yt.frontends.gadget.data_structures.GadgetHDF5Dataset._sph_ptypes += ('PartType0_78',)

and see if that helps?

On Thu, Mar 14, 2024 at 6:11 PM Jacob Morgan <jmorgan15@crimson.ua.edu> wrote:
yt generates many fields from the few that are saved on the disk. I am doing something weird with TNG data where I basically have 'PartType0' and 'PartType0_78', where 'PartType0_78' holds data on the gas particles at a different snapshot (namely, 78). I basically want yt to act like I have two different names for gas particles and generate the temperature, cylindrical coordinates, entropy, magnetic field, etc for 'PartType0_78' just as it does for 'PartType0'. The fields on disk are named the same. I tracked the fields down to yt/frontends/gadget/fields and/or yt/frontends/gadget/fields, and the setup_gas_particle_fields function.

I tried doing it all from the plugins file, but the more I look, the more I feel like there's just a few lines where I'd need to change

>>>if ptype=='PartType0':

 to

>>>if ptype in ('PartType0', 'PartType0_78'):

in the fields-related scripts and most of my work would be done automatically. Does anyone know where those few places might be?
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: matthewturk@gmail.com