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

Contamination fraction is inconsistent between load-modes #85

Closed
Martin-Rey opened this issue Nov 26, 2018 · 4 comments
Closed

Contamination fraction is inconsistent between load-modes #85

Martin-Rey opened this issue Nov 26, 2018 · 4 comments
Labels

Comments

@Martin-Rey
Copy link

Hi all,

I noticed today that the result of the calculation "contamination_fraction" is inconsistent between being done with different load-modes.

Currently, "contamination_fraction" looks into the loaded particles, find the minimum mass of those and calculate the fraction of particles more massive than this minimum mass.

  1. In a load-mode in which the entire snapshot is loaded, the minimum mass is always the overall minimum mass in the simulation (zoom resolution) so the calculation returns 1.0 for unzoomed halo, 0.X for contaminated halos and 0.0 for uncontaminated zoomed halos.

  2. In a load-mode in which only halo data is loaded (e.g. server), the minimum mass is calculated locally, not necessarily knowing that there exists a zoom region elsewhere in the simulation. For example, a pure unzoomed halo will have minimum_mass 64 and zero particles above this value, while a pure zoomed halo will have minimum_mass 8.0 and zero particles above. The calculation then returns 0.0 for unzoomed halos, 0.X for contaminated halos and 0.0 for uncontaminated zoomed halos.

I am not sure which one should be the correct behaviour (number 1 for me) but the fact that it is inconsistent between load-mode is highly confusing.

Hope this is clear
Martin

@apontzen apontzen added the bug label Nov 26, 2018
@apontzen
Copy link
Member

apontzen commented Nov 26, 2018

Yes the problem is clear but I am not immediately sure how to solve it actually. I agree the result should be 1.0 for fully contaminated halos, regardless of load mode. Any bright ideas?

@Martin-Rey
Copy link
Author

Not really tbh, I couldn't see an obvious solution either. Maybe by storing the mass resolution of the simulation higher up in the handler, similarly as it is done for "approx_resolution_kpc"?

@apontzen
Copy link
Member

Yes, I guess that would work. If you implement it, would be good to have it transparent in the sense that the code will "do its best" if the appropriate value is not stored at the simulation level.

@Martin-Rey
Copy link
Author

Fixed by #91

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

No branches or pull requests

2 participants