maho3 / ltu-cmass

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

Integrate CHARM into ltu-cmass #9

Open maho3 opened 3 months ago

maho3 commented 3 months ago

This task is to implement CHARM into the ltu-cmass pipeline.

CHARM is a normalizing flow model to connect the dark matter density field with voxelized halo counts and masses. In recent tests, it has shown the ability to reproduce the unbiased halo 2-pt functions with <10% error.

Image

The primary goal of this task would be to create a step in the pipeline which implements a trained CHARM model, following the convention of rho_to_halo.py.

It will also probably require a comparable training script, similar to fit_halo_bias.py

maho3 commented 3 months ago

@shivampcosmo

maho3 commented 3 months ago

Updates here: https://docs.google.com/presentation/d/1hBMhlSDsBqP2lJ1GtU1KxeXi9vd6VE11bveA5EssQnI/edit#slide=id.p

maho3 commented 1 month ago

CHARM reproducing the the halo positions in a BORGPM run

Image

Ongoing issues:

maho3 commented 1 month ago

CHARM is now integrated into the ltu-cmass in the charm_matt branch. It uses borg_pm snapshots and initial conditions (at z=50), and corrects the linear density with a colossus growth factor to be equivalent to z=99 (the trained input of CHARM).

It works for some cases... Here's an example of the quijote lhid=3 simulation: image image image

However, there is still an underestimation of clusters: image

Also, the clustering results fail more notably for other cosmologies. For example, lhid=2: image image

It's not clear whether this is a result of misinputs, or cosmology dependence, or a broader problem with CHARM.

One thing of note, is this behavior is also apparent when using Shivam's premade fastPM inputs. For example, again for lhid=3: image

maho3 commented 1 month ago

It turns out the previous comparisons were comparing CHARM outputs to the Quijote FoF catalogs, whereas CHARM was trained to reproduce Quijote Rockstar. When comparing them to the right Quijote things, the HMF looks consistent but the Power is still off... image (16) image (17)

maho3 commented 1 month ago

After fixing meshing: image

maho3 commented 2 weeks ago

Modified Shivam's code to patch CHARM to 2 Gpc/h

image

maho3 commented 1 week ago

Todo: