diff --git a/main/flaredetector/flaredetector.py b/main/flaredetector/flaredetector.py index 6e8afc5..2a0a467 100644 --- a/main/flaredetector/flaredetector.py +++ b/main/flaredetector/flaredetector.py @@ -36,6 +36,9 @@ def getFlareRange(flux, peakIndex): if(minInd < 0): minInd = 0 + while(np.isnan(flux[minInd].unmasked)): + minInd += 1 + deltaCount = 0 delta = 100 prevFlux = flux[peakIndex] @@ -54,4 +57,7 @@ def getFlareRange(flux, peakIndex): if(maxInd > len(flux)-1): maxInd = len(flux)-1 + while(np.isnan(flux[maxInd].unmasked)): + maxInd -= 1 + return minInd, maxInd