Skip to content

Commit

Permalink
Added None -> nan in photometry ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
hover2pi committed Mar 19, 2021
1 parent a031ee5 commit 7a33dec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sedkit/sed.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def add_photometry(self, band, mag, mag_unc=None, system='Vega', ref=None, **kwa
if not isinstance(mag_unc, (float, np.float32, type(None), np.ma.core.MaskedConstant)):
raise TypeError("{}: Magnitude uncertainty must be a float, NaN, or None.".format(type(mag_unc)))

# Make NaN if 0
if (isinstance(mag_unc, (float, int)) and mag_unc == 0) or isinstance(mag_unc, np.ma.core.MaskedConstant):
# Make NaN if 0 or None
if (isinstance(mag_unc, (float, int)) and mag_unc == 0) or isinstance(mag_unc, (np.ma.core.MaskedConstant, type(None))):
mag_unc = np.nan

# Get the bandpass
Expand Down

0 comments on commit 7a33dec

Please sign in to comment.