<jupyter_start><jupyter_text>Test the downsampling. There seems to be something weird happening with it<jupyter_code>import numpy as np
# --- centralms --- 
from centralms import util as UT
from centralms import catalog as Cat
from centralms import observables as Obvs
import corner as DFM
import matplotlib as mpl 
import matplotlib.pyplot as pl 
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['axes.xmargin'] = 1
mpl.rcParams['xtick.labelsize'] = 'x-large'
mpl.rcParams['xtick.major.size'] = 5
mpl.rcParams['xtick.major.width'] = 1.5
mpl.rcParams['ytick.labelsize'] = 'x-large'
mpl.rcParams['ytick.major.size'] = 5
mpl.rcParams['ytick.major.width'] = 1.5
mpl.rcParams['legend.frameon'] = False
%matplotlib inline
subhalo = Cat.CentralSubhalos(nsnap0=15)
shcat = subhalo.Read()
shcat_down = subhalo.Read(downsampled='20')
fig = plt.figure(figsize=(8,4))
sub = fig.add_subplot(111)
DFM.hist2d(shcat['halo.m'], shcat['m.sham'], levels=[0.68, 0.95], 
           range=[[10., 15.],[6., 12.2]], color='k', 
           plot_datapoints=False, fill_contours=False, plot_density=False, ax=sub)
DFM.hist2d(shcat_down['halo.m'], shcat_down['m.sham'], 
           weights=shcat_down['weights'], levels=[0.68, 0.95], 
           range=[[10., 15.],[6., 12.2]], color='C1', 
           plot_datapoints=False, fill_contours=False, plot_density=False, ax=sub)
fig = plt.figure(figsize=(8,4))
sub = fig.add_subplot(111)
msmf = Obvs.getMF(shcat['m.sham'], weights=shcat['weights'])
sub.plot(msmf[0], msmf[1], c='k', ls='--')
msmf = Obvs.getMF(shcat_down['m.sham'], weights=shcat_down['weights'])
sub.plot(msmf[0], msmf[1], c='C1')
sub.set_xlim([9., 12.])
sub.set_yscale("log")
sub.set_ylim([1e-6, 10**-1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1879531511433352, 'fraction_numerical': 0.03792526491912995, 'mean_word_length': 5.1438356164383565, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '50822', 'license': 'MIT', 'n_tokens_mistral': 761, 'n_tokens_neox': 705, 'n_words': 127, 'path': 'notebook/local_downsample.ipynb', 'repo_name': 'changhoonhahn/centralMS', 'size': '1793'}