Skip to content

Commit c7cb107

Browse files
committed
Update to add redshift to spectral grid test
1 parent 0133762 commit c7cb107

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

beast/physicsmodel/stars/tests/test_spectral_grid.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from astropy.utils.data import download_file
77
from astropy.tests.helper import remote_data
88
from astropy import units
9+
from astropy import constants as const
910

1011
from ...stars import stellib
1112
from ...stars.isochrone import ezIsoch
@@ -52,9 +53,11 @@ def test_make_kurucz_tlusty_spectral_grid():
5253
oiso = ezIsoch(iso_fname)
5354

5455
# define the distance
55-
distanceModulus = 24.47 * units.mag
56-
dmod = distanceModulus.value
57-
distance = 10 ** ((dmod / 5.) + 1) * units.pc
56+
distances = [24.47]
57+
distance_unit = units.mag
58+
59+
velocity = -300 * units.km / units.s
60+
redshift = (velocity / const.c).decompose().value
5861

5962
# define the spectral libraries to use
6063
osl = stellib.Tlusty(filename=tlusty_fname) \
@@ -65,8 +68,12 @@ def test_make_kurucz_tlusty_spectral_grid():
6568
add_spectral_properties_kwargs = dict(filternames=filters)
6669

6770
spec_fname = '/tmp/beast_example_phat_spec_grid.hd5'
68-
spec_fname, g = make_spectral_grid('test', oiso, osl=osl,
69-
distance=distance,
71+
spec_fname, g = make_spectral_grid('test',
72+
oiso,
73+
osl=osl,
74+
redshift=redshift,
75+
distance=distances,
76+
distance_unit=distance_unit,
7077
spec_fname=spec_fname,
7178
filterLib=filter_fname,
7279
add_spectral_properties_kwargs=add_spectral_properties_kwargs)

0 commit comments

Comments
 (0)