Closed steven-murray closed 5 years ago
@BradGreig the issue in this case seems to be from the following lines in SpinTemperatureBox.c:
if(!flag_options->M_MIN_in_Mass) {
M_MIN = TtoM(redshift, astro_params->X_RAY_Tvir_MIN, mu_for_Ts);
initialiseSigmaMInterpTable(M_MIN,1e20);
}
When printing out M_MIN, it sometimes comes out as a VERY big number, and sometimes as nan.
@steven-murray actually, the issue is in the MWE not the code itself. For flag_options, you are passing a dictionary rather than actually using the FlagOptions class. As a result, M_MIN_in_Mass is being set to False, rather than True which it should automatically switch to when USE_MASS_DEPENDENT_ZETA = True is passed.
Alternatively, if you are going to stick to using a dict(), you must set M_MIN_in_Mass = True when passing the dict() directly to the function.
Ah, this is almost right. Actually, the code takes that dict and makes a FlagOptions class out of it, which should automatically set the M_MIN_in_Mass. However, there was a bug preventing this from happening. This is fixed with 1513fbbf9f66550bf008e5d66f62ada8219055be.
This is mostly from @catherinewatkinson and Tom Binnie. This is an MWE script:
Using the
develop-steven
branch (commit 6954656379661c17eb672bfb007e1160fe8d20f9) and compiling withthen running with
python cat_test.py &> output.txt &
, seemingly gives different errors on different runs (even for the same seed!). This is the contents ofoutput.txt
for one of the runs I did: