-
Notifications
You must be signed in to change notification settings - Fork 38
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
Stochasticity #349
Stochasticity #349
Conversation
…into stochasticity
Conflicts: src/py21cmfast/src/FindHaloes.c
When the halo sampler is switched off, results very closely resemble the master branch, I have noticed only < 10^-3 level differences when examining global quantities and individual cells. However there seem to be bigger differences in various power spectra. Attached are paired lightcone and global plots for three cases, default parameters (titled _KS_OLD[_MASTER]), setting Most of the tests fail since the interpolation tables and integral structure has changed, causing floating point errors (some float -> double conversion has been done, and many interpolation tables have different binning). The failures without the spin temperature fluctuations have very small differences at the smallest scales in the power spectra. tests.test_integration_features.py--test_power_spectra_lightcone[mdzeta].pdf With the spin temperature fluctuations, global values appear identical but power spectra show significant differences at moderate and small scales. This difference is not something I've been able to track down looking at individual cells, but it seems to not affect the history very much. tests.test_integration_features.py--test_power_spectra_lightcone[tsfluct].pdf tests.test_integration_features.py--test_power_spectra_lightcone[mini_halos].pdf Obviously, with tests.test_integration_features.py--test_power_spectra_lightcone[halo_field].pdf |
@daviesje this is looking great, thanks for the plots! I think we need to bring in @andreimesinger here to weigh in on what kind of tolerance we should have for changes. The good thing is that the simplest cases (no spin temp, no halos) is working great. Happy to give that my stamp of approval. Even with the spin temperature fluctuations, I think we're doing pretty well. The differences, as expected, are only evident in the fields dependent on Ts. The mini-halos example is a little concerning (~100% differences in some spectra), so I'd like @andreimesinger to weigh in there. When using the halo field, we expect differences, and we see them. However, we should be careful to understand what kind of differences we might expect, and whether their magnitude is reasonable here. I'm seeing ~20% differences in the globally-averaged quantities which I don't think I expected, but perhaps I'm too naive. |
To give a little more context, the halo field differences will always be a bit of an apples-to-oranges comparison. In the master branch, the halo field is converted to collapsed fraction by dividing the halo mass in a cell by the cell mass, then either the constant zeta is applied (if |
Conflicts: src/py21cmfast/inputs.py src/py21cmfast/outputs.py src/py21cmfast/src/GenerateICs.c src/py21cmfast/src/IonisationBox.c src/py21cmfast/src/SpinTemperatureBox.c src/py21cmfast/src/ps.c src/py21cmfast/wrapper.py
DRAFT PR FOR v4
This update focuses around two things:
The state of the halo model currently:
We can produce halo populations which conform to a given conditional mass function, and which remain self-consistent across cosmic time. There is a drift from the given CMF at very high redshifts (~10% z=20) which is worse for small timesteps. work to improve the accuracy and speed of this method is ongoing.
There is an increased memory requirement. While halo catalogues down to 10^8 are of order ~2GB, feedback requires that halo mass catalogues are generated backward in time, while the stellar component is generated forward in time. This can be fixed with a proper purging routine implemented for the HaloField structs (in progress).
Halos larger than the cell size are generated with DexM, and there are some issues there. I find that trying to generate these catalogues on the low-density grid produces a factor of ~10 too few halos, and generating with Press-Schechter mass function results in a factor of ~3 too many. Only Sheth-Tormen on the highres grid is consistent, I am working to improve both the threading of this calculation and flexibility with resolution and HMF (while we expect the model to perform worse on low resolution I believe there are also some bugs here).
The only available CMF currently is EPS with rescaling to fit the collapsed fraction of another MF. I plan to include fits for a Sheth-Torment CMF, as well as rescaling options which have been used in the literature to create a CMF (both rescalings of the EPS CMF i.e tree augmentation methods, and rescalings of UMF to a CMF i.e analytic models).
I have placed test outputs in a single function at the end of Stochasticity.c which obviously needs to be converted to proper tests before the merge
State of the C modularisation
Biggest Issues
MISC