Skip to content

Commit

Permalink
Merge pull request #50 from LSSTDESC/raphaelshirley-patch-1
Browse files Browse the repository at this point in the history
Allow estimate to run without redshift
  • Loading branch information
raphaelshirley authored May 17, 2024
2 parents 822f486 + 03ba798 commit 5137235
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rail/estimation/algos/lephare.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def _rail_to_lephare_input(data, mag_cols, mag_err_cols):
"""
ng = data["redshift"].shape[0]
ng = data[mag_cols[0]].shape[0]
# Make input catalogue in standard lephare format
input = Table()
try:
Expand All @@ -256,7 +256,10 @@ def _rail_to_lephare_input(data, mag_cols, mag_err_cols):
input[mag_err_cols[n]] = data[mag_err_cols[n]].T
# Set context to use all bands
input["context"] = np.sum([2**n for n in np.arange(ng)])
input["zspec"] = data["redshift"]
try:
input["zspec"] = data["redshift"]
except KeyError:
input["zspec"] = np.full(ng,-99.)
input["string_data"] = " "
return input

Expand Down

0 comments on commit 5137235

Please sign in to comment.