Add Lilow2024 velocity fields (#133)

* Add Lilow data

* Fix Lilow NaNs

* Update nb

* Update nb
This commit is contained in:
Richard Stiskalek 2024-06-28 11:55:42 +01:00 committed by GitHub
parent 301ff61e89
commit 84a1609d77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 623 additions and 46 deletions

View File

@ -103,12 +103,11 @@ class DataLoader:
nobject = self._los_density.shape[1]
dtype = self._los_density.dtype
# In case of Carrick 2015 the box is in galactic coordinates..
if simname == "Carrick2015":
# Carrick+2015 box is in galactic coordinates
if simname in ["Carrick2015", "Lilow2024"]:
# Carrick+2015 and Lilow+2024 are in galactic coordinates
d1, d2 = radec_to_galactic(self._cat["RA"], self._cat["DEC"])
elif "CF4" in simname:
# CF4 box is in supergalactic coordinates
# CF4 is in supergalactic coordinates
d1, d2 = radec_to_supergalactic(self._cat["RA"], self._cat["DEC"])
else:
d1, d2 = self._cat["RA"], self._cat["DEC"]
@ -142,6 +141,12 @@ class DataLoader:
if simname in ["CF4", "CF4gp"]:
self._los_density = np.clip(self._los_density, 1e-5, None,)
# Lilow+2024 outside of the range data is NaN. Replace it with some
# finite values. This is OK because the PV tracers are not so far.
if simname == "Lilow2024":
self._los_density[np.isnan(self._los_density)] = 1.
self._los_radial_velocity[np.isnan(self._los_radial_velocity)] = 0.
self._mask = np.ones(len(self._cat), dtype=bool)
self._catname = catalogue

View File

@ -79,6 +79,7 @@ def simname2boxsize(simname):
"Carrick2015": 400.,
"CF4": 1000., # These need to be checked with Helene Courtois.
"CF4gp": 1000.,
"Lilow2024": 400.,
}
boxsize = d.get(simname, None)
@ -101,6 +102,7 @@ def simname2Omega_m(simname):
"Carrick2015": 0.3,
"CF4": 0.3,
"CF4gp": 0.3,
"Lilow2024": 0.3175,
}
omega_m = d.get(simname, None)

View File

@ -117,6 +117,8 @@ class Paths:
return [0]
elif simname in ["CF4", "CF4gp"]:
return [0]
elif simname == "Lilow2024":
return [0]
else:
raise ValueError(f"Unknown simulation name `{simname}`.")

File diff suppressed because one or more lines are too long

View File

@ -89,9 +89,9 @@ def get_los(catalogue_name, simname, comm):
if comm.Get_rank() == 0:
print(f"The dataset contains {len(RA)} objects.")
if simname == "Carrick2015":
# The Carrick+2015 is in galactic coordinates, so we need to
# convert the RA/dec to galactic coordinates.
if simname in ["Carrick2015", "Lilow2024"]:
# The Carrick+2015 and Lilow+2024 are in galactic coordinates, so
# we need to convert the RA/dec to galactic coordinates.
c = SkyCoord(ra=RA*u.degree, dec=dec*u.degree, frame='icrs')
pos = np.vstack((c.galactic.l, c.galactic.b)).T
elif "CF4" in simname:
@ -177,6 +177,21 @@ def get_field(simname, nsim, kind, MAS, grid):
if kind == "velocity":
field *= 52
return field.astype(np.float32)
elif simname == "Lilow2024":
folder = "/mnt/extraspace/rstiskalek/catalogs"
warn(f"Using local paths from `{folder}`.", RuntimeWarning)
if kind == "density":
fpath = join(folder, "Lilow2024_density.npy")
field = np.load(fpath)
elif kind == "velocity":
field = []
for p in ["x", "y", "z"]:
fpath = join(folder, f"Lilow2024_{p}Velocity.npy")
field.append(np.load(fpath).astype(np.float32))
field = np.stack(field)
return field.astype(np.float32)
else:
raise ValueError(f"Unknown simulation name: `{simname}`.")

View File

@ -17,7 +17,7 @@ if [ "$on_login" != "1" ] && [ "$on_login" != "0" ]; then
fi
# Submit a job for each combination of simname, catalogue, ksim
for simname in "CF4gp"; do
for simname in "Lilow2024"; do
for catalogue in "LOSS"; do
# for ksim in 0 1 2; do
# for ksim in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 "none"; do