Skip to content

Commit

Permalink
fixed warning owing to NaNs in fringe
Browse files Browse the repository at this point in the history
one step was creating NaNs while the next issued warning because of them
  • Loading branch information
trmrsh committed Jun 2, 2021
1 parent ade017b commit edc0436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hipercam/fringe.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,13 @@ def scale(self, ccd, ccdref, nhalf, rmin=None, rmax=None, reset=False, verbose=F
' '.join([f'{rat:.3f}' for rat in np.sort(ratios)])
)

if rmin is not None:
if rmin is not None and rmax is not None:
ratios[(ratios < rmin) & (ratios > rmax)] = np.nan
elif rmin is not None:
ratios[ratios < rmin] = np.nan
if rmax is not None:
elif rmax is not None:
ratios[ratios > rmax] = np.nan

return np.nanmedian(ratios)

class MccdFringePair(Group):
Expand Down

0 comments on commit edc0436

Please sign in to comment.