diff --git a/main/flaredetector/util.py b/main/flaredetector/util.py index 95367d5..d10da27 100644 --- a/main/flaredetector/util.py +++ b/main/flaredetector/util.py @@ -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") \ No newline at end of file + 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 \ No newline at end of file