flaredetector: make sure we dont run into ranges without data
This commit is contained in:
@@ -36,6 +36,9 @@ def getFlareRange(flux, peakIndex):
|
|||||||
if(minInd < 0):
|
if(minInd < 0):
|
||||||
minInd = 0
|
minInd = 0
|
||||||
|
|
||||||
|
while(np.isnan(flux[minInd].unmasked)):
|
||||||
|
minInd += 1
|
||||||
|
|
||||||
deltaCount = 0
|
deltaCount = 0
|
||||||
delta = 100
|
delta = 100
|
||||||
prevFlux = flux[peakIndex]
|
prevFlux = flux[peakIndex]
|
||||||
@@ -54,4 +57,7 @@ def getFlareRange(flux, peakIndex):
|
|||||||
if(maxInd > len(flux)-1):
|
if(maxInd > len(flux)-1):
|
||||||
maxInd = len(flux)-1
|
maxInd = len(flux)-1
|
||||||
|
|
||||||
|
while(np.isnan(flux[maxInd].unmasked)):
|
||||||
|
maxInd -= 1
|
||||||
|
|
||||||
return minInd, maxInd
|
return minInd, maxInd
|
||||||
|
|||||||
Reference in New Issue
Block a user