Question about star particle
![](https://secure.gravatar.com/avatar/1a1f3ddad7e6faf95a1c58ae5a6912ff.jpg?s=120&d=mm&r=g)
Dear yt users, Hi, I want to ask about star particles in enzo simulation. I want to know whether "star particle filter" only give me "alive" star particles or also counts "dead" particles (which have exploded in the past). I defined the "star particle" with particle filter like this: import yt from yt.data_objects.particle_filters import add_particle_filter def stars(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 2 return filter def DMparticles(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 1 return filter yt.add_particle_filter("Stars", function=stars, filtered_type='io', requires=["particle_type"]) yt.add_particle_filter("DMparticles", function=DMparticles, filtered_type='io', requires=["particle_type"]) ds = yt.load("~/IsolatedGalaxy/galaxy0030/galaxy0030") ds.add_particle_filter('Stars') ds.add_particle_filter('DMparticles') ad = ds.all_data() stellar_mass = ad[("Stars", "particle_mass")].in_units('Msun') print(stellar_mass) Does this "stellar_mass" contain both alive and dead stars ? Best, Y.T.
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
That depends on the star particle formation and feedback algorithm you used and how Enzo is writing the star particle data to disk. If both the alive and dead particles have particle type set to 2 in the Enzo outputs then yes your filter will select both. You would need to add more criterions to your filter definition to separate different kinds of star particles. On Wed, Jun 27, 2018 at 10:06 AM, tyuta <y0u1t1a5.t@gmail.com> wrote:
Dear yt users,
Hi, I want to ask about star particles in enzo simulation. I want to know whether "star particle filter" only give me "alive" star particles or also counts "dead" particles (which have exploded in the past).
I defined the "star particle" with particle filter like this:
import yt from yt.data_objects.particle_filters import add_particle_filter def stars(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 2 return filter def DMparticles(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 1 return filter yt.add_particle_filter("Stars", function=stars, filtered_type='io', requires=["particle_type"]) yt.add_particle_filter("DMparticles", function=DMparticles, filtered_type='io', requires=["particle_type"]) ds = yt.load("~/IsolatedGalaxy/galaxy0030/galaxy0030") ds.add_particle_filter('Stars') ds.add_particle_filter('DMparticles') ad = ds.all_data() stellar_mass = ad[("Stars", "particle_mass")].in_units('Msun') print(stellar_mass)
Does this "stellar_mass" contain both alive and dead stars ?
Best, Y.T.
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
![](https://secure.gravatar.com/avatar/1a1f3ddad7e6faf95a1c58ae5a6912ff.jpg?s=120&d=mm&r=g)
Thank you for your quick response! 2018-06-28 0:12 GMT+09:00 Nathan Goldbaum <nathan12343@gmail.com>:
That depends on the star particle formation and feedback algorithm you used and how Enzo is writing the star particle data to disk. If both the alive and dead particles have particle type set to 2 in the Enzo outputs then yes your filter will select both. You would need to add more criterions to your filter definition to separate different kinds of star particles.
On Wed, Jun 27, 2018 at 10:06 AM, tyuta <y0u1t1a5.t@gmail.com> wrote:
Dear yt users,
Hi, I want to ask about star particles in enzo simulation. I want to know whether "star particle filter" only give me "alive" star particles or also counts "dead" particles (which have exploded in the past).
I defined the "star particle" with particle filter like this:
import yt from yt.data_objects.particle_filters import add_particle_filter def stars(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 2 return filter def DMparticles(pfilter, data): filter = data[(pfilter.filtered_type, "particle_type")] == 1 return filter yt.add_particle_filter("Stars", function=stars, filtered_type='io', requires=["particle_type"]) yt.add_particle_filter("DMparticles", function=DMparticles, filtered_type='io', requires=["particle_type"]) ds = yt.load("~/IsolatedGalaxy/galaxy0030/galaxy0030") ds.add_particle_filter('Stars') ds.add_particle_filter('DMparticles') ad = ds.all_data() stellar_mass = ad[("Stars", "particle_mass")].in_units('Msun') print(stellar_mass)
Does this "stellar_mass" contain both alive and dead stars ?
Best, Y.T.
_______________________________________________ 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
participants (2)
-
Nathan Goldbaum
-
tyuta