flaredetector: util: add function to plot peak/valley areas
This commit is contained in:
@@ -139,3 +139,23 @@ def getPhaseRangesNearPeak(maxArgs, phase):
|
|||||||
maxPhaseBoundsIndices.append([findNearestIndexOfValue(phase, lv) for lv in l])
|
maxPhaseBoundsIndices.append([findNearestIndexOfValue(phase, lv) for lv in l])
|
||||||
|
|
||||||
return minPhaseBoundsIndices, maxPhaseBoundsIndices
|
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")
|
||||||
Reference in New Issue
Block a user