Ramses star- dark matter particle filter
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.
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 particlesbased 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
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
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
I've been trying to use a filter with "particle_mass" < mass resolution cut in between stars and dark matter: def old(pfilter, data):
old_only = data[data, "particle_mass"].in_units('Msun')
filter = old_only < 4e6
return filter
However, I am uncertain if this is going to consider individual mass particles or combined mass particles in a cell.
The code bellow will consider each individual star so that's a good way of doing it. Corentin On 29/11/2018 13.37, Vadlamani Samhitha wrote:
I've been trying to use a filter with "particle_mass" < mass resolution cut in between stars and dark matter:
defold(pfilter, data):
old_only = data[data, "particle_mass"].in_units('Msun')
filter= old_only < 4e6
returnfilter
However, I am uncertain if this is going to consider individual mass particles or combined mass particles in a cell.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Thank you!
On Thu, Nov 29, 2018 at 2:26 PM Corentin CADIOU
The code bellow will consider each individual star so that's a good way of doing it.
Corentin On 29/11/2018 13.37, Vadlamani Samhitha wrote:
I've been trying to use a filter with "particle_mass" < mass resolution cut in between stars and dark matter:
def old(pfilter, data):
old_only = data[data, "particle_mass"].in_units('Msun')
filter = old_only < 4e6
return filter
However, I am uncertain if this is going to consider individual mass particles or combined mass particles in a cell.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
participants (2)
-
Corentin CADIOU
-
Vadlamani Samhitha