Compare commits

...

2 commits

Author SHA1 Message Date
64d4ad0ce0 better slice ticks 2025-03-26 14:15:37 +01:00
4698184ca2 default cosmo 2025-03-26 14:15:27 +01:00
2 changed files with 36 additions and 7 deletions

View file

@ -34,7 +34,7 @@ def plot_imshow_with_reference( data_list,
elif isinstance(L, int) or isinstance(L, float):
L = [L for data in data_list]
sep = 10 if L[0] < 100 else 20 if L[0] < 200 else 100
sep = 10 if L[0] < 50 else 20 if L[0] < 200 else 100
ticks = [np.arange(0, l+1, sep)*len(dat)/l for l, dat in zip(L,data_list)]
tick_labels = [np.arange(0, l+1, sep) for l in L]
@ -86,10 +86,11 @@ def plot_imshow_with_reference( data_list,
for i, data in enumerate(data_list):
im = axes[i].imshow(data, cmap=cmap, origin='lower', vmin=vmin, vmax=vmax)
axes[i].set_title(titles[i], fontsize=fs_titles)
axes[0, i].set_xticks(ticks[i])
axes[0, i].set_yticks(ticks[i])
axes[0, i].set_xticklabels(tick_labels[i])
axes[0, i].set_yticklabels(tick_labels[i])
axes[i].set_xticks(ticks[i])
axes[i].set_yticks(ticks[i])
axes[i].set_xticklabels(tick_labels[i])
axes[i].set_yticklabels(tick_labels[i])
axes[i].set_xlabel('Mpc/h')
fig.colorbar(im, ax=axes[:], orientation='vertical')
return fig, axes
@ -123,7 +124,7 @@ if __name__ == "__main__":
fields = [read_field(args.directory+f) for f in args.filenames]
if args.index is None:
index = ref_field.N0//2
index = fields[0].N0//2
else:
index=args.index

View file

@ -63,4 +63,32 @@ def parse_arguments_cosmo(parsed_args):
return cosmo_dict
def z2a(z):
return 1.0/(1.0+z)
return 1.0/(1.0+z)
cosmo_defaults = {
"h": 0.6732,
"Omega_m": 0.302,
"Omega_b": 0.049,
"Omega_q": 0.6842,
"Omega_k":0.0,
"Omega_r": 0.0,
"n_s": 0.968,
"sigma8": 0.815,
"A_s": 2.148752e-09,
"Tcmb": 2.7255,
"k_p": 0.05,
"N_ur": 2.046,
"m_nu1": 0.06,
"m_nu2": 0.0,
"m_nu3": 0.0,
"w_0": -1.0,
"w_a": 0.0,
"fnl": 100.0,
"gnl": 0.0,
"k_max":10.0,
"tau_reio":0.06,
"WhichSpectrum":"EH",
"w0_fld":-1.0,
"wa_fld":0.0,
}