flaredetector: support plotting peaks onto given non-normalized fluxes

This commit is contained in:
2024-04-17 08:35:58 +02:00
parent b56a2e3701
commit ad8c22978e
+9 -3
View File
@@ -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):
if(flux is None):
for peak in peaks: for peak in peaks:
ax.plot(peak["FlarePeakTime"], peak["FlarePeak"], "x", color="red") 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: