Skip to content

Commit

Permalink
Find monochromator fit range endpoints consistently.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jul 10, 2024
1 parent bdebc0c commit 95fc965
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions python/lsst/cp/pipe/cpFilterScan.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,19 +415,16 @@ def _fitPeak(spectrum, peakBoxSize=20):
# Search for the 50% points for FWHM estimate. Search for the
# 10% points to define the range for Gaussian fit.
for dx in range(maxIdx, maxIdx + peakBoxSize):
if not highHM:
if normFlux[dx] < 0.5:
highHM = dx
if not high:
if normFlux[dx] < 0.1:
high = dx
if normFlux[dx] >= 0.5:
highHM = dx
if normFlux[dx] >= 0.1:
high = dx

for dx in range(maxIdx, maxIdx - peakBoxSize, -1):
if not lowHM:
if normFlux[dx] > 0.5:
lowHM = dx - 1
if not low:
if normFlux[dx] > 0.1:
low = dx - 1
if normFlux[dx] >= 0.5:
lowHM = dx - 1
if normFlux[dx] >= 0.1:
low = dx - 1

# The above search should be fine, but let's ensure we have
# reasonable limits.
Expand Down

0 comments on commit 95fc965

Please sign in to comment.