flaredetector: util: add function to convert normal index to folded index/cycle pair
This commit is contained in:
@@ -68,4 +68,15 @@ def plotFlareFits(ax, fits):
|
||||
|
||||
def markFlare(ax, fits, flux):
|
||||
for fit in fits:
|
||||
ax.plot(fit["FlareFitTime"], flux[fit["StandardIndex"]], color="red")
|
||||
ax.plot(fit["FlareFitTime"], flux[fit["StandardIndex"]], color="red")
|
||||
|
||||
def convertStarndardIndexToFoldedIndex(foldedLc, standardIndex):
|
||||
foldedIndex = standardIndex; cycle = 0
|
||||
for i in range(max(foldedLc.cycle)+1):
|
||||
if(foldedIndex - len(foldedLc.phase[foldedLc.cycle == i]) >= 0):
|
||||
foldedIndex = foldedIndex - len(foldedLc.phase[foldedLc.cycle == i])
|
||||
else:
|
||||
cycle = i
|
||||
break
|
||||
|
||||
return cycle, foldedIndex
|
||||
Reference in New Issue
Block a user