csiborgtools/scripts_independent/A2_to_hdf5.ipynb
Richard Stiskalek a65e3cb15b
Add simple distance flow model (#114)
* Add imports

* Add field LOS paths

* Add basic flow model

* Edit script

* Add nb

* Add nb

* Update nb

* Add some docs

* Add RA reading

* Add imoprts

* Updates to the flow model

* Update script

* Bring back A2

* Update imports

* Update imports

* Add Carrick to ICs

* Add Carrick boxsize

* Add Carrick and fix minor bugs

* Add Carrick box

* Update script

* Edit imports

* Add fixed flow!

* Update omega_m and add it

* Update nb

* Update nb

* Update nb

* Remove old print statements

* Update params

* Add thinning of chains

* Add import

* Add flow validation script

* Add submit script

* Add ksmooth

* Update nb

* Update params

* Update script

* Update string

* Move where distributions are defined

* Add density bias parameter

* Add lognorm mean

* Update scripts

* Update script
2024-03-08 10:44:19 +00:00

4 KiB

In [1]:
import numpy as np
import matplotlib.pyplot as plt
from h5py import File
from scipy.stats import spearmanr

import csiborgtools

%matplotlib inline
%load_ext autoreload
%autoreload 2
In [2]:
paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)

# d = np.load(paths.field_interpolated("SDSS", "csiborg2_main", 16817, "density", "SPH", 1024))
In [33]:
survey = csiborgtools.SDSS()(apply_selection=False)
# survey = csiborgtools.SDSSxALFALFA()(apply_selection=False)
In [35]:
for kind in ["main", "random"]:
    x, smooth = csiborgtools.summary.read_interpolated_field(survey, f"csiborg2_{kind}", "density", "SPH", 1024, paths)
    np .savez(f"../data/{survey.name}_{kind}_density_SPH_1024.npz", val=x, smooth_scales=smooth)
Reading fields:   0%|          | 0/20 [00:00<?, ?it/s]Reading fields: 100%|██████████| 20/20 [00:11<00:00,  1.80it/s]
Reading fields: 100%|██████████| 20/20 [00:10<00:00,  1.86it/s]
In [37]:

Out[37]:
(20, 641409, 5)
In [24]:
np.load("../data/SDSS_main_density_SPH_1024.npz")["val"]
Out[24]:
array([[[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]],

       [[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]],

       [[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]],

       ...,

       [[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]],

       [[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]],

       [[nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        ...,
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan],
        [nan, nan, nan, nan, nan]]], dtype=float32)
In [ ]: