Begin testing TFR likelihood

This commit is contained in:
Deaglan Bartlett 2025-02-05 15:53:57 +01:00
parent 7ce772730a
commit 674ccc3a90
21 changed files with 1708 additions and 45 deletions

View file

@ -327,17 +327,18 @@ def crop_velmass_to_borg(ini_file, field_type):
return true_field
def get_spectra(ini_name, dirname, nframe, iter_max, iter_min, which_field='delta', cut_field=True, mock_type='borg'):
def get_spectra(ini_name, dirname, nframe, iter_max, iter_min, which_field='delta', cut_field=True, mock_type='borg', MAS=''):
# Which steps to use
all_mcmc = get_mcmc_steps(dirname, nframe, iter_max, iter_min=iter_min)
if which_field == 'delta':
MAS = "CIC"
elif which_field == 'ics':
MAS = None
else:
raise NotImplementedError
if MAS == '':
if which_field == 'delta':
MAS = "CIC"
elif which_field == 'ics':
MAS = None
else:
raise NotImplementedError
# Compute original power spectrum
if mock_type == 'borg':
@ -350,6 +351,11 @@ def get_spectra(ini_name, dirname, nframe, iter_max, iter_min, which_field='delt
boxsize = get_borg_Lbox(ini_name)
else:
raise NotImplementedError
# Turn to overdensity
if which_field == 'delta':
delta1 = (1. + delta1) / (1. + delta1).mean() - 1.
print("BOXSIZE", boxsize)
Pk = PKL.Pk(delta1.astype(np.float32), boxsize, axis=0, MAS=MAS, threads=1, verbose=True)
k = Pk.k3D