flaredetector: support plotting peaks onto given non-normalized fluxes
This commit is contained in:
@@ -32,15 +32,21 @@ def calculateFlareFitsForLightcurve(lightcurve, num=100, distance=1, height=0.05
|
|||||||
for index in maxIndices:
|
for index in maxIndices:
|
||||||
Peak, flareFitDataPoints, fit = calculateFitForFlare(lightcurve, index)
|
Peak, flareFitDataPoints, fit = calculateFitForFlare(lightcurve, index)
|
||||||
peaks.append({"FlarePeak": Peak,
|
peaks.append({"FlarePeak": Peak,
|
||||||
"FlarePeakTime": lightcurve.time[index]})
|
"FlarePeakTime": lightcurve.time[index],
|
||||||
|
"StandardIndex": index})
|
||||||
fits.append({"FlareFit": fit,
|
fits.append({"FlareFit": fit,
|
||||||
"FlareFitTime": lightcurve.time[flareFitDataPoints]})
|
"FlareFitTime": lightcurve.time[flareFitDataPoints],
|
||||||
|
"StandardIndex": flareFitDataPoints})
|
||||||
|
|
||||||
return peaks, fits
|
return peaks, fits
|
||||||
|
|
||||||
def plotFlarePeaks(ax, peaks):
|
def plotFlarePeaks(ax, peaks, flux = None):
|
||||||
for peak in peaks:
|
if(flux is None):
|
||||||
ax.plot(peak["FlarePeakTime"], peak["FlarePeak"], "x", color="red")
|
for peak in peaks:
|
||||||
|
ax.plot(peak["FlarePeakTime"], peak["FlarePeak"], "x", color="red")
|
||||||
|
else:
|
||||||
|
for peak in peaks:
|
||||||
|
ax.plot(peak["FlarePeakTime"], flux[peak["StandardIndex"]], "x", color="red")
|
||||||
|
|
||||||
def plotFlareFits(ax, fits):
|
def plotFlareFits(ax, fits):
|
||||||
for fit in fits:
|
for fit in fits:
|
||||||
|
|||||||
Reference in New Issue
Block a user