<jupyter_start><jupyter_text>Trying to figure out the displacement field of Paco's simulations<jupyter_code>import numpy as np 
# --- mnucosmomap ---
from mnucosmomap import catalogs as Cats<jupyter_output><empty_output><jupyter_text>Import initial conditions of realization 1<jupyter_code>IC = Cats.mNuICs(1)
x = IC['Position'][:,0]
y = IC['Position'][:,1]
z = IC['Position'][:,2]
Npart = len(IC['ID'])
print('Nparticle = %i' % Npart)
print('%f < x < %f' % (x.min(), x.max()))
print('%f < y < %f' % (y.min(), y.max()))
print('%f < z < %f' % (z.min(), z.max()))
print Npart**(1./3.)<jupyter_output>512.0<jupyter_text>Find all the particles in $(10\,\mathrm{Mpc})^3$ subbox<jupyter_code>i_x, i_y, i_z = 7, 6, 0
L_subbox = 1000./8.
L_halfres = 0.5 * 1000./512.
xmin, xmax = L_subbox * float(i_x) + L_halfres, ((L_subbox * float(i_x+1) + L_halfres) % 1000.)
ymin, ymax = L_subbox * float(i_y) + L_halfres, L_subbox * float(i_y+1) + L_halfres
zmin, zmax = L_subbox * float(i_z) + L_halfres, L_subbox * float(i_z+1) + L_halfres
if xmax < xmin: 
    xlim = ((x >= xmin) | (x < xmax))
else: 
    xlim = ((x >= xmin) & (x < xmax))
ylim = ((y >= ymin) & (y < ymax))
zlim = ((z >= zmin) & (z < zmax))
print xmin, xmax
print xmin - i_x * (1000./8.), (xmax - i_x * (1000./8.)) % 1000.
insubbox = (xlim & ylim & zlim)
print('%i particles in subox' % np.sum(insubbox))
print('%i particles SHOULD be in the subbox' % (Npart/(8**3)))
fig = plt.figure(figsize=(10,5))
sub = fig.add_subplot(121)
sub.scatter(x[insubbox], y[insubbox])
#sub.scatter(x[near_subbox], y[near_subbox] - 1000.)
sub.set_xlabel('X', fontsize=25)
sub.set_xlim([-1., 18.])
sub.set_ylabel('Y', fontsize=25)
sub.set_ylim([-1., 18.])

sub = fig.add_subplot(122)
sub.scatter(z[insubbox], y[insubbox])
#sub.scatter(z[near_subbox], y[near_subbox] - 1000.)
sub.set_xlabel('Z', fontsize=25)
sub.set_xlim([-1., 18.])
sub.set_ylabel('Y', fontsize=25)
sub.set_ylim([-1., 18.])
for i_x in range(8): 
    for i_y in range(8): 
        for i_z in range(8): 
            insubbox = (
                (x > i_x * (1000./64.) + 1.) & (x < (i_x+1) * (1000./64.) + 1.) & 
                (y > i_y * (1000./64.) + 1.) & (y < (i_y+1) * (1000./64.) + 1.) &
                (z > i_z * (1000./64.) + 1.) & (z < (i_z+1) * (1000./64.) + 1.))
            if np.sum(insubbox) != 512: 
                print('%i particles in subox' % np.sum(insubbox))
                print('%i, %i, %i' % (i_x, i_y, i_z))
parts = Cats.mNuParticles(0.0, 1, 2)
i_ic_sorted = np.argsort(IC['ID'])
i_part_sorted = np.argsort(parts['ID'])
print IC['ID'][i_ic_sorted]
print parts['ID'][i_part_sorted]
print np.array_equal(IC['ID'][i_ic_sorted], parts['ID'][i_part_sorted])
print np.array_equal(IC['ID'][i_ic_sorted], np.arange(1, Npart+1))
firstten = [] 
for i in range(1,11): 
    firstten.append(np.arange(Npart)[box['ID']==i][0])
    
nextten = [] 
for i in range(512,523): 
    nextten.append(np.arange(Npart)[box['ID']==i][0])
fig = plt.figure()
sub = fig.add_subplot(121)
sub.scatter(x[firstten], y[firstten])
sub.scatter(x[nextten], y[nextten])
sub.set_xlim([0., 1000.])
sub.set_ylim([0., 1000.])
sub = fig.add_subplot(122)
sub.scatter(x[firstten], z[firstten])
sub.scatter(x[nextten], z[nextten])
sub.set_xlim([0., 1000.])
sub.set_ylim([0., 1000.])
print x[firstten]
print y[firstten]
print z[firstten]
print x[nextten]
print y[nextten]
print z[nextten]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2178013557323902, 'fraction_numerical': 0.05452402004126142, 'mean_word_length': 3.9985272459499264, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 19, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '214366', 'license': 'MIT', 'n_tokens_mistral': 1649, 'n_tokens_neox': 1511, 'n_words': 295, 'path': 'notebook/notes_dispfield.ipynb', 'repo_name': 'changhoonhahn/mNuCosmoMap', 'size': '3393'}