Hi, but I don't have the fields particle_birth_ time or particle_age in the first place. the particle IDs are also all positive. The only distinction I have between my dark matter and stars are their mass resolutions. Is there something I could do with that? On Thu, Nov 29, 2018 at 10:08 AM Corentin CADIOU <contact@cphyc.me> wrote:
Hi,
It is possible to create a custom particle filter. For example, until I switched to using the particle_type, I was using the following snippet
def dm_filter(pfilter, data): ''' Select DM particles based on their ''' filter = (data['io','particle_birth_time'] == 0) & (data['io','particle_identity'] > 0) return filter
yt.add_particle_filter("dm", function=dm_filter, filtered_type="io") ds.add_particle_filter("dm")
Hope this helps! You can similarly distinguish star particles using (or any weird RAMSES combination of ids, mass, etc...).
def star_filter(pfilter, data): filter = (data['io','particle_birth_time'] != 0) return filter
You will then be able to access your filtered particles using, e.g. ds.r['dm', 'particle_position'].
I hope this helps!
Cheers, Corentin On 29/11/2018 09.59, Vadlamani Samhitha wrote:
Hi, I would like to know if it’s possible to have a particle filter based on the mass resolutions of the particles. I am using RAMSES data where I can distinguish stars and dark matter only from their mass resolutions (no particle_type). Any help is highly appreciated.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org