Skip to content

Commit

Permalink
added a catch for None SNR
Browse files Browse the repository at this point in the history
  • Loading branch information
dvida committed Dec 14, 2024
1 parent 41a6ef7 commit 7f7bd38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Utils/SkyFit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f7bd38

Please sign in to comment.