From 7f7bd38fec34fb79b822f826c77e86958abd8bc0 Mon Sep 17 00:00:00 2001 From: Denis Vida Date: Sat, 14 Dec 2024 12:38:41 -0500 Subject: [PATCH] added a catch for None SNR --- Utils/SkyFit2.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Utils/SkyFit2.py b/Utils/SkyFit2.py index 2b680a76b..a0ed3a6ec 100644 --- a/Utils/SkyFit2.py +++ b/Utils/SkyFit2.py @@ -4825,7 +4825,7 @@ def loadDark(self): return dark_file, dark - def addCentroid(self, frame, x_centroid, y_centroid, mode=1, snr=0, saturated=False): + def addCentroid(self, frame, x_centroid, y_centroid, mode=1, snr=1, saturated=False): """ Adds or modifies a pick marker at given frame to self.pick_list with given information @@ -6175,8 +6175,15 @@ def saveECSV(self): if pick['mode'] == 0: continue + + # If SNR is None, then set the random error to 0 + if pick['snr'] is None: + mag_err_random = 0 + + else: + mag_err_random = 2.5*np.log10(1 + 1/pick['snr']) + # Compute the magnitude errors - mag_err_random = 2.5*np.log10(1 + 1/pick['snr']) mag_err_total = np.sqrt(mag_err_random**2 + self.platepar.mag_lev_stddev**2) # Use a modified platepar if ground points are being picked