<jupyter_start><jupyter_text>Getting weird results with my ds_hsab emu, trying to sanity test what I have.<jupyter_code>%matplotlib inline
from matplotlib import pyplot as plt
import h5py
from os import path
import numpy as np
aemulator_dir = '/home/users/swmclau2/scratch/Aemulators/'
ds_hsab = h5py.File(path.join(aemulator_dir, 'ds_hsab/PearceDsHSABCosmo.hdf5'), 'r')
ds_hsab_test = h5py.File(path.join(aemulator_dir, 'ds_hsab_test/PearceDsHSABCosmoTest.hdf5'), 'r')
ds_hsab_test2 = h5py.File(path.join(aemulator_dir, 'ds_hsab_test2/PearceDsHSABCosmoTest.hdf5'), 'r')
ds_hsab.attrs['cosmo_param_names']
ds_hsab_test2.attrs['cosmo_param_names']
ds_hsab_data = np.zeros((40, 1000, 18))
for i in xrange(40):
    ds_hsab_data[i] = ds_hsab['cosmo_no_%02d'%i]['a_1.000']['obs'][()]
ds_hsab_test_data = np.zeros((35, 100, 18))
for i in xrange(35):
    ds_hsab_test_data[i] = ds_hsab_test['cosmo_no_%02d'%i]['a_1.000']['obs'][()]
ds_hsab_test2_data = np.zeros((35, 100, 18))
for i in xrange(35):
    ds_hsab_test2_data[i] = ds_hsab_test2['cosmo_no_%02d'%i]['a_1.000']['obs'][()]
r_bins = np.logspace(-1, 1.6, 19)
rbc = (r_bins[1:] +r_bins[:-1])/2.0
N = 5
for i in xrange(0,35,N):
    plt.plot(rbc, ds_hsab_test2_data[i:i+N].mean(axis = (0,1)), label = i)

denom = ds_hsab_data.mean(axis = (0,1))
plt.legend(loc='best')
plt.plot(rbc, denom, ls = '--', lw=10)
plt.xscale('log')
np.any(np.all(ds_hsab_data==0.0, axis = 2))
np.any(np.all(ds_hsab_test2_data==0.0, axis = 2))<jupyter_output><empty_output><jupyter_text>ds_hsab.close()ds_hsab_test2.close()<jupyter_code>from pearce.mocks.kittens import TrainingBox
cat = TrainingBox(0)
cat.load(1.0, HOD='hsabZheng07', particles=True, hod_kwargs={'sec_haloprop_key':'halo_local_density_10'})
ds_hsab.attrs['hod_param_vals'][1]
hod_pnames = ds_hsab.attrs['hod_param_names']
hod_dict = dict(zip(hod_pnames, ds_hsab.attrs['hod_param_vals'][1]))
hod_dict
ds_hsab_data.shape
cat.populate(hod_dict, min_ptcl=100)
ds = cat.calc_ds(r_bins, n_cores = 1)
ds
denom = ds_hsab_data.mean(axis = (0,1))
plt.plot(rbc, ds_hsab_data[0,1])
plt.plot(rbc, np.log10(ds) )

plt.xscale('log')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1760299625468165, 'fraction_numerical': 0.050093632958801496, 'mean_word_length': 7.446640316205533, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '226920', 'license': 'MIT', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1008, 'n_words': 142, 'path': 'notebooks/Debug DS HSAB Emu.ipynb', 'repo_name': 'mclaughlin6464/pearce', 'size': '2136'}