Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding Halos with Two Separate Particle Species Contributing to the Structure #210

Open
Ecskrabacz10 opened this issue Jul 20, 2023 · 5 comments

Comments

@Ecskrabacz10
Copy link

Ecskrabacz10 commented Jul 20, 2023

This is not a bug, but it is a question of Rockstar's capabilities.

I am currently running some simulations with two forms of Dark Matter, decaying and stable. With these simulations, I am using yt_astro_analysis' capabilities with Rockstar to find halos. I was looking through the code for how Rockstar runs, and I found this section in the _setup_parameters function of RockstarHaloFinder in the rockstar.py file.

particle_mass = self.particle_mass
if particle_mass is None:
    pmass_min, pmass_max = dd.quantities.extrema(
        (ptype, self.mass_field), non_zero=True
    )
    particle_mass = pmass_min
elif isinstance(particle_mass, (tuple, list)) and len(particle_mass) == 2:
    particle_mass = tds.quan(*particle_mass)
elif not isinstance(particle_mass, unyt_quantity):
    particle_mass = tds.quan(particle_mass, "Msun / h")
particle_mass.convert_to_units("Msun / h")

Before this section of code, self.particle_mass = None and I have passed in the particle type all, which includes both the stable dark matter and decaying dark matter species. I want both species to contribute to the halos, but this code seems like all of the particles' masses will be set to the species that has the lower mass.

Is there a way for me to allow both species to have their pre-defined masses instead of being assigned by Rockstar? Is this possible to do already or should I make some code to allow for multiple species?

@matthewturk
Copy link
Member

Is it possible to get nearer to what you want with a ParticleUnion? https://yt-project.org/doc/analyzing/filtering.html

@brittonsmith
Copy link
Member

As I read the code, specifically rockstar_interface.pyx, we are still getting individual particle masses from the mass array. According to the docstring on the RockstarHaloFinder class, the particle_mass keyword is now only used to compute the mean interparticle spacing. This probably needs to be clarified somewhere in the documentation.

@Ecskrabacz10
Copy link
Author

That is wonderful to hear. For some more context, the two particle species have vastly different masses (one can end up being practically zero, while the other is constant at around 10^10 Msun). Would these different masses have a greater impact on the mean interparticle spacing? Would this possible impact on mean interparticle spacing directly affect how Rockstar finds halos?

@Ecskrabacz10
Copy link
Author

As for a separate issue, is there a place where I can edit the code in my yt-astro-analysis to account for only the first N particles in the simulation?

I am trying to run Rockstar with a time series, so I cannot perform ad = ds.all_data() for all the timesteps before sending the time series into Rockstar as that would overload the memory on the computer.

@brittonsmith
Copy link
Member

That is wonderful to hear. For some more context, the two particle species have vastly different masses (one can end up being practically zero, while the other is constant at around 10^10 Msun). Would these different masses have a greater impact on the mean interparticle spacing? Would this possible impact on mean interparticle spacing directly affect how Rockstar finds halos?

I honestly cannot say. This question is specific to the Rockstar algorithm, which I don't understand all that well. The mean interparticle spacing informs the linking length used in the friend-of-friends step. That's about all I can contribute to the understanding here. I'm not sure if there is Rockstar mailing list. You might just have to experiment with doing it with and without the low-mass particles.

I am trying to run Rockstar with a time series, so I cannot perform ad = ds.all_data() for all the timesteps before sending the time series into Rockstar as that would overload the memory on the computer.

I'm not sure I understand why you would need to do this. It should not be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants