RAMSES simulation: Pick only DM at t=0 not stars.
Hi, I am using RAMSES for single galaxy simulations. I have generated initial condition using DICE. The problem is whatever particle filter I am using to identify the dark matter particles, it picks up stellar particles present at the t=0 as well. For example, following filter won't work: def dm_filter(pfilter, data): 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") Please let me know if there is something that I am missing or if there is another way to do it. Thank you, Ankit Singh
Hi Ankit,
Is there some kind of particle type field you can select on or some other
way to distinguish between the particles you want and the particles you
don't want? That's what I'd use for Enzo data. Or are you saying that yt is
buggy somehow and the particle filter you've written should work given what
you understand about the data? There were some fixes related to the
particle age and birth time fieds in yt 3.5 so be sure you're using the
latest stable release of yt.
A worked example I can run locally would help me to understand what's going
wrong as I don't know much about RAMSES data. You can share the dataset
you're working by doing:
$ yt upload my_dataset.tar.gz
That will upload the data to a publicly accessible location and return a
URL you can share. If you can make a script I can run using the dataset you
upload that demonstrates the issue I can try to play with it and give you
more concrete advice sometime during the week. Someone else with more
RAMSES knowledge than me might also respond in the meantime.
-Nathan
On Sun, Dec 2, 2018 at 1:14 PM Ankit Singh
Hi,
I am using RAMSES for single galaxy simulations. I have generated initial condition using DICE. The problem is whatever particle filter I am using to identify the dark matter particles, it picks up stellar particles present at the t=0 as well. For example, following filter won't work:
def dm_filter(pfilter, data): 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")
Please let me know if there is something that I am missing or if there is another way to do it.
Thank you,
Ankit Singh
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hi, I think RAMSES assigns birth_time 0 for both stars and dark matter. And for my RAMSES data gives out positive IDs for both dark matter and stars. So, I don't think both these fields could be a good filter. I use mass resolution of stars and dark matter to create a filter and that is probably something you could try:
def stars(pfilter, data):
stars_only = data[pfilter.filtered_type, "particle_mass" ].in_units('Msun')
filter = (stars_only< mass_resolution_cut_off)
return filter
On Sun, Dec 2, 2018 at 9:59 PM Nathan Goldbaum
Hi Ankit,
Is there some kind of particle type field you can select on or some other way to distinguish between the particles you want and the particles you don't want? That's what I'd use for Enzo data. Or are you saying that yt is buggy somehow and the particle filter you've written should work given what you understand about the data? There were some fixes related to the particle age and birth time fieds in yt 3.5 so be sure you're using the latest stable release of yt.
A worked example I can run locally would help me to understand what's going wrong as I don't know much about RAMSES data. You can share the dataset you're working by doing:
$ yt upload my_dataset.tar.gz
That will upload the data to a publicly accessible location and return a URL you can share. If you can make a script I can run using the dataset you upload that demonstrates the issue I can try to play with it and give you more concrete advice sometime during the week. Someone else with more RAMSES knowledge than me might also respond in the meantime.
-Nathan
On Sun, Dec 2, 2018 at 1:14 PM Ankit Singh
wrote: Hi,
I am using RAMSES for single galaxy simulations. I have generated initial condition using DICE. The problem is whatever particle filter I am using to identify the dark matter particles, it picks up stellar particles present at the t=0 as well. For example, following filter won't work:
def dm_filter(pfilter, data): 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")
Please let me know if there is something that I am missing or if there is another way to do it.
Thank you,
Ankit Singh
_______________________________________________ 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
Hi, Thanks, Nathan and Vadlamani. You are right Vadlamani, that is the case with my dataset as well. RAMSES writes t=0 as the brith_time of both stars and dark matter. Particle ids are always positive as well. The only possibility there seems to be using the mass resolution to distinguish between particles. I would give that a try. Thanks again! Ankit
Dear all, The answer to the initial question depends on which version of Ramses you are using. If it is based on the main version after 10/2017, the different particle types are stored in an array in the particle outputs (1 for DM and 2 for stars). If this is the case, yt automatically detects these fields starting from yt3.5 and creates particle filters for you. Note that in addition to supporting particle types, yt 3.5 also significantly improves the performance of the Ramses frontend. If you're using an older version of Ramses, then DM and stars should be distinguished internally using a combination of negative ids + null birth time. I am not aware of any part of the code that uses the mass (apart for cosmological simulations). As it seems that all particles have positive ids, you may very well be on a recent version of Ramses (hence updating yt should do the trick). In any case, if all your DM particles have the same mass, the code you suggested should work (regardless of yt and Ramses' versions). On a side note, I'd suggest updating to a recent version of Ramses as the particle types really make your life easier ;) Corentin Cadiou
On 3 déc. 2018, at 05:55, "Ankit Singh"
wrote: Hi,
Thanks, Nathan and Vadlamani.
You are right Vadlamani, that is the case with my dataset as well. RAMSES writes t=0 as the brith_time of both stars and dark matter. Particle ids are always positive as well. The only possibility there seems to be using the mass resolution to distinguish between particles. I would give that a try.
Thanks again! Ankit _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hi Corentin, Thanks for clearing this. I think this will help many. I will definitely switch to latest RAMSES... :) Regards, Ankit
participants (4)
-
Ankit Singh
-
Corentin Cadiou
-
Nathan Goldbaum
-
Vadlamani Samhitha