sambit-giri / tools21cm

MIT License
22 stars 18 forks source link

set H0 #40

Closed micbia closed 9 months ago

micbia commented 1 year ago

I just noticed that when you set little h with t2c.set_hubble_h(1) and then print the H0 value t2c.H0 the result is still the standard setup 70 km/s/Mpc. Need further investigation in the conv.py script.

sambit-giri commented 1 year ago

After t2c.set_hubble_h(1), print t2c.conv.h and t2c.conv.H0.

The __init__.py is run when Tools21cm is imported (import tools21cm as t2c). This is when the default cosmological parameters/variables are loaded to the t2c object. t2c.set_hubble_h(1) changes the value of t2c.conv.H0, not t2c.H0. This is fine for all the calculations in t2c as they import conv.py where the value is updated. This can be tested by printing the ratio d100/d70, where d100 and d70 are t2c.z_to_cdist(1.0) with t2c.set_hubble_h(1) and t2c.set_hubble_h(0.7) respectively.