Skip to content

Commit

Permalink
avoiding NaNs in SCISEN* header keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Nov 11, 2024
1 parent 430d2b5 commit 5001300
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/lvmdrp/functions/fluxCalMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,13 @@ def fluxcal_sci_ifu_stars(in_rss, plot=True, GAIA_CACHE_DIR=None, NSCI_MAX=15):

label = rss._header['CCD']
channel = label.lower()
rss.setHdrValue(f"SCISENM{label}", np.nanmean(mean_sci[1000:3000]), f"Mean scistar sensitivity in {channel}")
rss.setHdrValue(f"SCISENR{label}", np.nanmean(rms_sci[1000:3000]), f"Mean scistar sensitivity rms in {channel}")
log.info(f"Mean scistar sensitivity in {channel} : {np.nanmean(mean_sci[1000:3000])}")
mean_sci_band = np.nanmean(mean_sci[1000:3000])
rms_sci_band = np.nanmean(rms_sci[1000:3000])
mean_sci_band = -999.9 if np.isnan(mean_sci_band) else mean_sci_band
rms_sci_band = -999.9 if np.isnan(rms_sci_band) else rms_sci_band
rss.setHdrValue(f"SCISENM{label}", mean_sci_band, f"Mean scistar sensitivity in {channel}")
rss.setHdrValue(f"SCISENR{label}", rms_sci_band, f"Mean scistar sensitivity rms in {channel}")
log.info(f"Mean scistar sensitivity in {channel} : {mean_sci_band}")

if plot:
plt.ylabel("sensitivity [(ergs/s/cm^2/A) / (e-/s/A)]")
Expand Down

0 comments on commit 5001300

Please sign in to comment.