Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lightcurvelynx/astro_utils/redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def rest_to_obs_flux(flux_density, redshift):
flux_density : numpy.ndarray
The observer frame flux (in nJy).
"""
# Note that since we are f_nu the flux density gets multiplied by (1+z)
# instead of divided by it as it would be in f_lambda.
return flux_density * (1 + redshift)


Expand Down
2 changes: 2 additions & 0 deletions tests/lightcurvelynx/astro_utils/test_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def test_redshifted_flux_densities() -> None:

for i, time in enumerate(times):
if t0 <= time and time <= (t1 - t0) * (1 + redshift) + t0:
# Note that since we are f_nu the flux density gets multiplied by (1+z)
# instead of divided by it as it would be in f_lambda.
assert np.all(values_redshift[i] == brightness * (1 + redshift))
else:
assert np.all(values_redshift[i] == 0.0)
Expand Down