Skip to content

Commit

Permalink
Fix compute_relative_photometry (#111)
Browse files Browse the repository at this point in the history
It was stopping if there were several targets, one without calibrators.
  • Loading branch information
juanep97 authored May 21, 2024
1 parent 4f2723c commit 992e731
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iop4lib/instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,9 @@ def compute_relative_photometry(cls, redf: 'ReducedFit') -> None:
calib_mag_zp_array_err = calib_mag_zp_array_err[~np.isnan(calib_mag_zp_array_err)]

if len(calib_mag_zp_array) == 0:
logger.error(f"{redf}: can not perform relative photometry without any calibrators for this reduced fit. Deleting results.")
[result.delete() for result in redf.photopolresults.all()]
return
logger.error(f"{redf}: can not perform relative photometry on source {result.astrosource.name}, no calibrator zero-points found.")
# [result.delete() for result in redf.photopolresults.all()]
continue

zp_avg = np.nanmean(calib_mag_zp_array)
zp_std = np.nanstd(calib_mag_zp_array)
Expand Down

0 comments on commit 992e731

Please sign in to comment.