diff --git a/examples/example.config b/examples/example.config index 60fc441..1ff1426 100644 --- a/examples/example.config +++ b/examples/example.config @@ -47,4 +47,9 @@ F_ESC10 : 3.0 ALPHA_ESC : 3.0 L_X : 0.1 M_TURN : 3.0 -NU_X_THRESH : 3.0 \ No newline at end of file +NU_X_THRESH : 3.0 + + +[cosmo_params] + +[cosmo_params_vary] \ No newline at end of file diff --git a/examples/fisher.ipynb b/examples/fisher.ipynb index 4100561..dde0cfe 100644 --- a/examples/fisher.ipynb +++ b/examples/fisher.ipynb @@ -32,7 +32,7 @@ "outputs": [], "source": [ "configuration_file = \"/scratch/ulb/physth_fi/gfacchin/runs_21cmCAST/config/constraint_nobkr.config\"\n", - "p21c.init_runs_from_fiducial(configuration_file, clean_existing_dir=False)" + "p21c.init_runs(configuration_file, clean_existing_dir=False)" ] }, { diff --git a/src/py21cmcast/__init__.py b/src/py21cmcast/__init__.py index 0bd9c79..c83bfee 100644 --- a/src/py21cmcast/__init__.py +++ b/src/py21cmcast/__init__.py @@ -24,6 +24,8 @@ prepare_plot, prepare_2subplots, prepare_triangle_plot, + confidence_ellipse, + ellipse_from_covariance, ) from .power import ( diff --git a/src/py21cmcast/runs.py b/src/py21cmcast/runs.py index bded03d..2f963bc 100644 --- a/src/py21cmcast/runs.py +++ b/src/py21cmcast/runs.py @@ -449,6 +449,7 @@ def run_lightcone_from_config(config_file: str, n_omp: int = None, random_seed: astro_params = p21c_tools.read_config_params(config.items('astro_params'), int_type=False) cosmo_params = p21c_tools.read_config_params(config.items('cosmo_params'), int_type=False) + # manually set the number of threads if n_omp is not None: user_params['N_THREADS'] = int(n_omp) diff --git a/src/py21cmcast/tools.py b/src/py21cmcast/tools.py index 22ac815..c5d7c64 100644 --- a/src/py21cmcast/tools.py +++ b/src/py21cmcast/tools.py @@ -117,6 +117,7 @@ def read_config_params(config_items, int_type = True, allow_lists = False): else: cast_val = float(value) except: + if value == 'True': cast_val = True elif value == 'False': @@ -332,11 +333,14 @@ def ellipse_from_covariance(cov_matrix, fiducial): 'LOG10_TK_at_Z_HEAT_MAX' : {'tex_name' : r'\log_{10}[\frac{\bar T_K^{\rm init}}{\rm K}]', 'min': -2, 'max': 1, 'ticks' : []}, 'OMm' : {'tex_name' : r'\Omega_{\rm m}', 'min': -2, 'max': 1, 'ticks' : []}, 'OMb' : {'tex_name' : r'\Omega_{\rm b}', 'min': -2, 'max': 1, 'ticks' : []}, + 'Omch2' : {'tex_name' : r'\Omega_{\rm c}h^2', 'min': -2, 'max': 1, 'ticks' : []}, + 'Ombh2' : {'tex_name' : r'\Omega_{\rm b}h^2', 'min': -2, 'max': 1, 'ticks' : []}, 'hlittle' : {'tex_name' : r'h', 'min': -2, 'max': 1, 'ticks' : []}, + 'Ln_1010_As' : {'tex_name' : r'\ln(10^{10} A_{\rm s})', 'min': -2, 'max': 1, 'ticks' : []}, 'SIGMA_8' : {'tex_name' : r'\sigma_8', 'min': -2, 'max': 1, 'ticks' : []}, 'POWER_INDEX' : {'tex_name' : r'n_{\rm s}', 'min': -2, 'max': 1, 'ticks' : []}, 'INVERSE_M_WDM' : {'tex_name' : r'1/m_{\rm WDM}', 'min': -2, 'max': 1, 'ticks' : []}, - 'NEUTRINO_MASS_1' : {'tex_name' : r'\sum m_\nu / 3', 'min': -2, 'max': 1, 'ticks' : []}, + 'NEUTRINO_MASS_1' : {'tex_name' : r'm_{\nu, 1} ~ [{\rm eV}]', 'min': -2, 'max': 1, 'ticks' : []}, } @@ -433,7 +437,9 @@ def prepare_triangle_plot(params_to_plot, val_min, val_max): axs[j_name][i_name].set_xlim([x_min, x_max]) - if i != j : + if i != j : + if y_min == np.NaN or y_min == np.Inf or y_max == np.NaN or y_max == np.Inf: + print("Problem here: ", j_name, " ", i_name) axs[j_name][i_name].set_ylim([y_min, y_max]) if i == j :