astrodatagui: FlaredetectorWidget: show peaks in flatten
This commit is contained in:
@@ -4,6 +4,7 @@ from matplotlib.backends.backend_qtagg import (
|
||||
FigureCanvas, NavigationToolbar2QT as NavigationToolbar)
|
||||
|
||||
from astropy.io import fits
|
||||
from astropy.visualization import time_support
|
||||
import lightkurve as lk
|
||||
|
||||
from ...flaredetector.util import findMaxIndices
|
||||
@@ -188,6 +189,8 @@ class FlaredetectorWidget(QtWidgets.QWidget):
|
||||
lc = lc.flatten(window_length=self.FlattenState["WindowLength"],
|
||||
polyorder=self.FlattenState["PolynomialOrder"])
|
||||
label += " - flattened"
|
||||
|
||||
maxPowers = findMaxIndices(lc, 100, height=1.005, distance=1)
|
||||
if(self.FoldState["Enabled"]):
|
||||
lc = lc.fold(period=self.FoldState["Period"],
|
||||
epoch_time=self.FoldState["EpochTime"])
|
||||
@@ -214,6 +217,10 @@ class FlaredetectorWidget(QtWidgets.QWidget):
|
||||
self.figureAxis.plot(lc.period[maxPowers], lc.power[maxPowers], "x")
|
||||
if(self.PeriodogramState["View"] == "frequency"):
|
||||
self.figureAxis.plot(lc.frequency[maxPowers], lc.power[maxPowers], "x")
|
||||
elif(self.FlattenState["Enabled"]):
|
||||
time_support()
|
||||
lc.plot(label=label, ax=self.figureAxis)
|
||||
self.figureAxis.plot(lc.time[maxPowers], lc.flux[maxPowers], "x")
|
||||
else:
|
||||
lc.plot(label=label, ax=self.figureAxis)
|
||||
self.figure.canvas.draw_idle()
|
||||
Reference in New Issue
Block a user