flaredetector: util: set data per different instance specific to not duplicate code
This commit is contained in:
@@ -5,7 +5,8 @@ from lightkurve.periodogram import Periodogram
|
|||||||
|
|
||||||
def findMaxIndices(lc, num=3, distance=100):
|
def findMaxIndices(lc, num=3, distance=100):
|
||||||
if(isinstance(lc, Periodogram)):
|
if(isinstance(lc, Periodogram)):
|
||||||
peak_indices, peak_dict = find_peaks(lc.power, height=(None, None), distance=distance)
|
data = lc.power
|
||||||
peak_heights = peak_dict["peak_heights"]
|
peak_indices, peak_dict = find_peaks(data, height=(None, None), distance=distance)
|
||||||
maxIndices = peak_indices[np.argsort(peak_heights)[-num:][::-1]]
|
peak_heights = peak_dict["peak_heights"]
|
||||||
return maxIndices
|
maxIndices = peak_indices[np.argsort(peak_heights)[-num:][::-1]]
|
||||||
|
return maxIndices
|
||||||
Reference in New Issue
Block a user