maho3 / ltu-cmass

A modular simulator of CMASS-NGC galaxy clustering
6 stars 1 forks source link

Implement pinnochio as a halo catalogue maker #34

Closed DeaglanBartlett closed 5 days ago

DeaglanBartlett commented 1 month ago

As an alternative to the forward models created in LtU, we wish to use pre-existing methods to compare against. In this issue we wish to create halo catalogues using pinnochio https://github.com/pigimonaco/Pinocchio. This will require us to make a parameter file which matches the format for pinnochio, run the executable and output the halo catalog to the correct format. There is also an inbuilt lightcone maker which may be useful. The initial first steps are:

DeaglanBartlett commented 1 month ago

This is part of https://github.com/maho3/ltu-gobig/issues/18

DeaglanBartlett commented 1 month ago

Pinocchio can now be run as a member of the nbody models, e.g.:

python -m cmass.nbody.pinocchio nbody=quijote_z0

This is set up so that it can take the quijote white noise field or create its own field. The following power spectrum and cross-spectrum comparison demonstrates that these are being read correctly:

pinocchio_field pinocchio_pk

These are computed by reading the particles outputted in a snapshot and creating a density field from them. Note that a transpose is required to align the density field with what quijote has, which is the usual x-z ambiguity that arises when reading gadget files. We should finalise how we want this to be dealt with (particularly for the halo catalogues) before merging these commits.

We can see an oscillation in the ratio of the power spectra. This is likely due to us using the Eisenstein and Hu transfer function initially rather than something more accurate (see https://github.com/maho3/ltu-gobig/issues/15). This is not problematic as one of the remaining "To Do"s is to allow any transfer function to be used.

DeaglanBartlett commented 1 month ago

Indeed, the wiggles were due to using Eisenstein & Hu rather than a Boltzmann solver. Now any of E&H, camb or class can be used to compute this initial power spectrum. For class, we have:

pinocchio_pk (1)

and the same is seen for camb.

DeaglanBartlett commented 1 month ago

All halo catalog outputs at the redshift of interest are now produced in the pipeline.

Testing at redshift 0 and comparing to quijote, we obtain reasonable agreement for the halo mass function: pinocchio_hmf although there are more Quijote halos (2305) in this mass range than Pinocchio (2105). The distribution of halos matches reasonably too: pinocchio_halo_pk with a slight normalisation problem perhaps due to the different number of halos.

The velocity distribution is also reasonable: pinocchio_vel_hist and the cross correlation of the field produced by gridding components of the velocity demonstrates that the orientation of the axes is correct (see earlier comment): pinocchio_vel_rk

This should be checked at a non-zero redshift before merging. Note that Pinocchio can also generate lightcone data, so maybe we want to use this functionality too.

Note: The minimum halo mass is quite large for these settings, so any realistic run needs higher resolution.

DeaglanBartlett commented 1 month ago

The histogram of velocities also looks good at redshift=0.5, so no 1+z factors appear to be missing: pinocchio_vel_hist (1)