Skip to content

Commit c0cc4d5

Browse files
author
sambit-giri
committed
imports cosmology from astropy
instead of Planck18 directly
1 parent 57b81b8 commit c0cc4d5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/tools21cm/line_intensity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from glob import glob
33
import astropy
44
from astropy import constants, units
5-
from astropy.cosmology import Planck18
5+
from astropy import cosmology
66

77
from .nbody_file import halo_list_to_grid
88

@@ -39,7 +39,7 @@ def M_HI_on_grid(z, mass, pos_xyz, box_dim, n_grid, cosmo=None,
3939
assert recipe.lower() in ['padmanabhan2017']
4040
if cosmo is None:
4141
print('Assuming Planck18 cosmology.')
42-
cosmo = Planck18
42+
cosmo = cosmology.Planck18
4343
Ob = cosmo.Ob0
4444
Om = cosmo.Om0
4545
hlittle = cosmo.h
@@ -109,7 +109,7 @@ def L_CII_on_grid(z, mass, pos_xyz, box_dim, n_grid, SFR=None, cosmo=None,
109109
assert recipe.lower() in ['silva2015m1', 'silva2015m2', 'silva2015m3', 'silva2015m4']
110110
if cosmo is None:
111111
print('Assuming Planck18 cosmology.')
112-
cosmo = Planck18
112+
cosmo = cosmology.Planck18
113113
Ob = cosmo.Ob0
114114
Om = cosmo.Om0
115115
hlittle = cosmo.h

src/tools21cm/temperature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .helper_functions import print_msg, read_cbin, \
99
get_data_and_type, determine_redshift_from_filename
1010
from astropy import constants, units
11-
from astropy.cosmology import Planck18
11+
from astropy import cosmology
1212

1313
def calc_dt_halo(mhalo, box_dim, z, Y_p=0.249, cosmo=None):
1414
'''
@@ -28,7 +28,7 @@ def calc_dt_halo(mhalo, box_dim, z, Y_p=0.249, cosmo=None):
2828
'''
2929
if cosmo is None:
3030
print('Assuming Planck18 cosmology.')
31-
cosmo = Planck18
31+
cosmo = cosmology.Planck18
3232

3333
if isinstance(mhalo, units.quantity.Quantity):
3434
mhalo = mhalo.to('Msun')

0 commit comments

Comments
 (0)