diff --git a/main/flaredetector/util.py b/main/flaredetector/util.py index 0c6c9ff..e557877 100644 --- a/main/flaredetector/util.py +++ b/main/flaredetector/util.py @@ -139,3 +139,23 @@ def getPhaseRangesNearPeak(maxArgs, phase): maxPhaseBoundsIndices.append([findNearestIndexOfValue(phase, lv) for lv in l]) return minPhaseBoundsIndices, maxPhaseBoundsIndices + +def plotPhaseRangesNearPeak(indices, phase, ax=None): + minPhaseBoundsIndices = indices[0] + maxPhaseBoundsIndices = indices[1] + + if(ax is None): + import matplotlib.pyplot as plt + for pair in minPhaseBoundsIndices: + for l in pair: + plt.axes.axvline(phase[l], color="violet") + for pair in maxPhaseBoundsIndices: + for l in pair: + plt.axes.axvline(phase[l], color="orange") + else: + for pair in minPhaseBoundsIndices: + for l in pair: + ax.axvline(phase[l], color="violet") + for pair in maxPhaseBoundsIndices: + for l in pair: + ax.axvline(phase[l], color="orange") \ No newline at end of file