mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 20:58:02 +00:00
fdb0df8d4c
* Move paths to a separate file * Add mmain reader * Add a verbosity flag * Fix imports * Fix bug * Rename files * Return ultimate parents * Add script to generate mmain * Remove mmain path * edit path * Add mmain path * Change function name * Rename function * Turn off verbose * Fix list requirement * Edit init match paths * Fix init pathing * Edit paths docs * Edit dumpdir name * Rename path * Fix split paths * Remove unused import * Add comment * Update readme * remove read mmain * Rename haloatalogue * Fix minor bugs * Update nbs * Add create directory option * Move split jobs * Move spliot jobs * Remove splitting * Add import * Edit script * Deeper split folder * Fix paths bug * Rename catalogue * Rename Catalogue * Add new clumpread * Edit paths * add knn paths * Update commenting * Update imports * Add more conversions * Update temp file * Add a note * Add catalogue * Cooment * Update TODO * Update script * add nb * Update * pep8 * edit paths & pep8 * Fix knn auto paths * add paths docs * Add auto and cross knn paths * Add new paths * Simplify tpcf reading * pep8 patch * update readme * Update progress * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * pep8 * Pep 8 and restructure * add lambda spin * add clump and halo * add checks * Edit halo profile fit * Update gitignore * backup script
686 KiB
686 KiB
In [1]:
import numpy as np
%matplotlib notebook
import matplotlib.pyplot as plt
try:
import csiborgtools
except ModuleNotFoundError:
print("not found")
import sys
sys.path.append("../")
import csiborgtools
import utils
import joblib
from os.path import join
%load_ext autoreload
%autoreload 2
from gc import collect
In [2]:
surv = utils.SDSS()()
X = np.vstack([surv[p] for p in ("DIST", "RA", "DEC")]).T
X = X.astype(np.float32)
In [3]:
particles = np.load("/mnt/extraspace/rstiskalek/csiborg/scratch/particles.npy")
In [4]:
grid = 256
length = 677.05
paths = csiborgtools.read.CSiBORGPaths()
paths.set_info(7444, paths.get_maximum_snapshot(7444))
box = csiborgtools.units.BoxUnits(paths)
MAS = "CIC"
field = csiborgtools.field.DensityField(particles, length, box, MAS)
In [27]:
x0 = field.potential_field(grid, 2)
In [28]:
x1 = field.potential_fieldal_field(grid)
In [34]:
plt.figure()
plt.imshow(np.mean(x0, axis=2) - np.mean(x1, axis=2))
plt.show()
In [33]:
plt.figure()
plt.imshow(np.mean(x1, axis=2))
plt.show()
In [ ]:
In [ ]:
delta = field.overdensity_field(grid, verbose=True)
In [ ]:
field.evaluate_sky(delta, pos=X, isdeg=True)
In [ ]:
dtype = {"names": ['x', 'y'], "formats": [float, float]}
In [ ]:
z = np.zeros((2, 2), dtype=dtype)
In [ ]:
z['x']
In [ ]:
T = field.tensor_field(grid)
In [ ]:
Teval = field.evaluate_sky(T.T00, T.T01, T.T02, T.T11, T.T12, T.T22, pos=X, isdeg=True)
In [ ]:
field.tensor_field_eigvals(*Teval)
In [ ]:
In [ ]:
np.sort()
In [ ]:
Teval[0].shape
In [ ]:
a
In [ ]:
Z = np.zeros((N, 3, 3), dtype=np.float32)
Z[:, 0, 0] = Teval[0]
Z[:, 0, 1] = Teval[1]
Z[:, 0, 2] = Teval[2]
Z[:, 1, 1] = Teval[3]
Z[:, 1, 2] = Teval[4]
Z[:, 2, 2] = Teval[5]
Zall = np.zeros((N, 3, 3), dtype=np.float32)
Zall[:, 0, 0] = Teval[0]
Zall[:, 0, 1] = Teval[1]
Zall[:, 1, 0] = Teval[1]
Zall[:, 0, 2] = Teval[2]
Zall[:, 2, 0] = Teval[2]
Zall[:, 1, 1] = Teval[3]
Zall[:, 1, 2] = Teval[4]
Zall[:, 2, 1] = Teval[4]
Zall[:, 2, 2] = Teval[5]
In [ ]:
np.linalg.eigvalsh(Z[120, ...], 'U')
In [ ]:
np.linalg.eigvals(Zall[120, ...])
In [ ]:
out = field.evaluate_sky(g.gx, g.gy, g.gz, pos=X)
In [ ]:
out
In [ ]:
plt.figure()
plt.hist(np.log10(np.linalg.norm(out, axis=0)), bins="auto")
plt.show()
In [ ]: