mirror of
https://github.com/Findus23/halo_comparison.git
synced 2024-09-13 09:03:49 +02:00
Added file to study weird bloody Arepo stuff
This commit is contained in:
parent
7ddfd8a74a
commit
5e7981517c
2 changed files with 50 additions and 2 deletions
43
study_cosmo_params_arepo.py
Normal file
43
study_cosmo_params_arepo.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
import numpy as np
|
||||
|
||||
hubbleparam = 0.6777
|
||||
omega0 = 0.307
|
||||
omegab = 0.04825
|
||||
Gconst = 43.0187
|
||||
zstart = 127
|
||||
astart = 1 / (1 + zstart)
|
||||
|
||||
m_gas = 0.00310523 / hubbleparam
|
||||
m_highres = 0.0166524 / hubbleparam
|
||||
m_lowres_1 = 0.15806103 / hubbleparam
|
||||
m_lowres_2 = 1.2644882 / hubbleparam
|
||||
|
||||
n_gas = 174432
|
||||
n_highres = 174432
|
||||
n_lowres_1 = 46964
|
||||
n_lowres_2 = 2135520 - n_lowres_1
|
||||
|
||||
boxsize = 67.77 / hubbleparam
|
||||
|
||||
Hsquared = (hubbleparam * 100) ** 2 * (omega0 / (astart) ** 3 + 1 - omega0)
|
||||
|
||||
rhocrit = 3 * (hubbleparam * 100) ** 2 / (8 * np.pi * Gconst)
|
||||
print(rhocrit / hubbleparam ** 2)
|
||||
|
||||
#m_gas = omegab *
|
||||
mass_b = m_gas * n_gas
|
||||
omega_b = mass_b / (boxsize ** 3) / (3 * (hubbleparam * 100) ** 2 / (8 * np.pi * Gconst))
|
||||
|
||||
mass_lowres_1 = m_lowres_1 * n_lowres_1
|
||||
mass_lowres_2 = m_lowres_2 * n_lowres_2
|
||||
mass_lowres = mass_lowres_1 + mass_lowres_2
|
||||
mass_highres = m_highres * n_highres
|
||||
mass_total = mass_b + mass_highres + mass_lowres
|
||||
|
||||
omega_0 = mass_total / (boxsize ** 3) / (3 * (hubbleparam * 100) ** 2 / (8 * np.pi * Gconst))
|
||||
|
||||
|
||||
print(omega_b)
|
||||
print(omega_0)
|
||||
|
||||
print(mass_b * hubbleparam)
|
|
@ -41,8 +41,13 @@ def plotnp3d(pl: Plotter, data: np.ndarray, color="white"):
|
|||
glrenderer.SetPass(blur_pass)
|
||||
|
||||
if __name__ == "__main__":
|
||||
input_file = cdm_zoom_dir / f"snapshot_{int(sys.argv[1]):03d}.hdf5"
|
||||
highres_coords, lowres_coords = read_g4_file(input_file, 'cdm')
|
||||
if sys.argv[1] == 'cdm':
|
||||
input_file = cdm_zoom_dir / f"snapshot_{int(sys.argv[2]):03d}.hdf5"
|
||||
elif sys.argv[1] == 'pbh':
|
||||
input_file = pbh_zoom_dir / f"snapshot_{int(sys.argv[2]):03d}.hdf5"
|
||||
else:
|
||||
raise ValueError('Please select pbh or cdm as zoom_type!')
|
||||
highres_coords, lowres_coords = read_g4_file(input_file, sys.argv[1])
|
||||
|
||||
random_highres_selection = highres_coords[np.random.choice(highres_coords.shape[0], 100000, replace=False)]
|
||||
random_lowres_selection = lowres_coords[np.random.choice(lowres_coords.shape[0], 100000, replace=False)]
|
||||
|
|
Loading…
Reference in a new issue