Skip to content

Commit

Permalink
fixing wrong conditional for out-of-bounds centroids
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Sep 16, 2024
1 parent 9f88d14 commit 6a9980e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lvmdrp/core/spectrum1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,7 @@ def fitSepGauss(
fact = numpy.sqrt(2 * numpy.pi)
hw = aperture // 2
for i, centre in enumerate(cent_guess):
if numpy.isnan(centre) or (centre + hw < self._wave[0] or centre - hw > self._wave[-1]):
if numpy.isnan(centre) or (centre - hw < self._wave[0] or centre + hw > self._wave[-1]):
continue

select = (self._wave >= centre - hw) & (self._wave <= centre + hw)
Expand Down Expand Up @@ -3457,7 +3457,7 @@ def obtainGaussFluxPeaks(self, pos, sigma, replace_error=1e10, plot=False):
if self._error is None:
self._error = numpy.ones_like(self._data)

# construct sparse projection matrix
# construct sparse projection matrix
fact = numpy.sqrt(2.0 * numpy.pi)
kernel_width = 7 # should exceed 4 sigma
vI = []
Expand All @@ -3483,7 +3483,7 @@ def obtainGaussFluxPeaks(self, pos, sigma, replace_error=1e10, plot=False):
if bad_pix is not None and bn.nansum(bad_pix) > 0:
error[bad_pix] = replace_error

# pyfits.writeto('B1.fits', B1.toarray(), overwrite=True)
# pyfits.writeto('B1.fits', B1.toarray(), overwrite=True)
# if plot:
# plt.figure(figsize=(15, 10))
# plt.plot(self._data, "ok")
Expand Down

0 comments on commit 6a9980e

Please sign in to comment.