<jupyter_start><jupyter_text>Joe has requested before we delete particles of the new sims we double check that the mass functions look sensible. I'll do that, and whatever tests are proposed, here.<jupyter_code>from matplotlib import pyplot as plt
%matplotlib inline
from pearce.mocks.kittens import TrainingBox
import numpy as np
from os import path
from glob import glob
cat = TrainingBox(0)
cat.load(1.0, HOD='zheng07')
mass_bins = np.logspace(9, 16, (16-9)/0.1+1)
mf = cat.calc_mf(mass_bin_size = 0.1, min_ptcl=20)
mbc = (mass_bins[1:] + mass_bins[:-1])/2
plt.plot(mbc, mf)
plt.loglog();
#highres_emu_dir = '/oak/stanford/orgs/kipac/users/jderose/highres_emu/'
#highres_emu_dir = '/oak/stanford/orgs/kipac/aemulus/highres_emu/Box000/output/rockstar'
highres_emu_dir = '/oak/stanford/orgs/kipac/aemulus/highres_emu/Box000_sherlock/output/rockstar'
from halotools.sim_manager import RockstarHlistReader 
columns_to_keep = {'halo_id': (0, 'i8'), 'halo_upid': (1, 'i8'), # actually the DescID? 
                'halo_x': (8, 'f4'), 'halo_y': (9, 'f4'), 'halo_z': (10, 'f4'),
                'halo_vx': (11, 'f4'), 'halo_vy': (12, 'f4'), 'halo_vz': (13, 'f4'),
                'halo_mvir': (2, 'f4'), 'halo_rvir': (5, 'f4'), 'halo_rs': (6, 'f4')}<jupyter_output><empty_output><jupyter_text>ID DescID Mvir Vmax Vrms Rvir Rs Np X Y Z VX VY VZ JX JY JZ Spin rs_klypin Mvir_all M200b M200c M500c M2500c Xoff Voff spin_bullock b_to_a c_to_a A[x] A[y] A[z] b_to_a(500c) c_to_a(500c) A[x](500c) A[y](500c) A[z](500c) T/|U| M_pe_Behroozi M_pe_Diemer Halfmass_Radius<jupyter_code>N = 202
fname = path.join(highres_emu_dir, 'out_%d.list'%(N-1))
simname = 'AemulusBeta'
#Particle mass: 6.39984e+08 Msun/h
#Box size: 200.000000 Mpc/h
pmass = 6.39984e8
Lbox = 400.0
cache_fname = '/home/users/swmclau2/scratch/hlists/AemulusBeta000.hdf5'
reader = RockstarHlistReader(fname, columns_to_keep, cache_fname, simname,
                                         'rockstar', 0.0, 'most_recent', Lbox, pmass,
                                         overwrite=False)
reader.read_halocat(["halo_rvir", "halo_rs"])

halo_table = reader.halo_table
beta_mf = np.histogram(halo_table['halo_mvir'], bins = mass_bins)[0]
plt.plot(mbc, beta_mf/Lbox**3, label = 'Aemulus Beta ')
plt.plot(mbc, mf/(cat.Lbox**3), label = 'Aemulus Alpha')
plt.loglog();
plt.legend(loc='best', frameon=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1518456375838926, 'fraction_numerical': 0.051593959731543626, 'mean_word_length': 4.4576659038901605, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '375450', 'license': 'MIT', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1005, 'n_words': 209, 'path': 'notebooks/Aemulus Beta Sanity Tests.ipynb', 'repo_name': 'mclaughlin6464/pearce', 'size': '2384'}