maho3 / ltu-cmass

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

Add YHe to CLASS transfer to deal with large values of Omega_b #20

Closed DeaglanBartlett closed 5 months ago

DeaglanBartlett commented 5 months ago

This PR implements Ludvig's suggestion for how to solve the problematic large-Omega_b cases when running BORG with CLASS. Running with lhid=15 (which was said to be problematic here) no longer returns an error.

ludvigdoeser commented 5 months ago

@DeaglanBartlett @maho3 for BORG-PM, I think you want to do

transfer_class=borg.forward.model_lib.M_TRANSFER_CLASS(box,opts={"a_transfer":a0,"use_class_sign":False}) # Add CLASS transfer function  

that is with a0 from:

a0 = 1/(1+z_start)

Depending on your z_start you might also want to add "z_max_pk", e.g.:

transfer_class.setModelParams({"extra_class_arguments":{"YHe":"0.24","z_max_pk":"100"}})
ludvigdoeser commented 5 months ago

Also, shouldn't

a_initial=1.0, a_final=nbody.af

be

a_initial=nbody.ai, a_final=nbody.af

? Or maybe I'm missing something

DeaglanBartlett commented 5 months ago

Everything I am doing works based on:

  1. It matches a notebook Guilhem showed me
  2. If I run using the same ICs as Quijote, then the cross-correlation is 1 on large scales (not -1) so the signs work
  3. Given then settings I made, there is no way P(k) should be evaluated at that redshift so I don't think the argument is necessary

If you are concerned, you should try running the code with my settings vs what you think and see if there is a difference (I have not identified any problems and have tried running at various redshifts).

ludvigdoeser commented 5 months ago

Okay great, thanks. I missed the pm_start_z=nbody.zi and for the sign I found "if false use the legacy BORG convention" in the docs. So the +1 should indeed be the correct convention for you to use.