Add analyze_fft_ellipses.py

This commit is contained in:
Benjamin Loison 2024-05-22 19:19:09 +02:00
parent 7a002f8b0d
commit ffd71ce5b8
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -0,0 +1,40 @@
import matplotlib.pyplot as plt
from enum import Enum, auto
import itertools
class Axis(Enum):
ABSCISSA = auto()
ORDINATE = auto()
def __str__(self):
return self.name.title()
# TODO: with right color
# TODO: precising somehow low or high
# TODO: limit axis based on these values
INTERESTING_VALUES_OF_AXES = {
Axis.ABSCISSA: [0, 30, 60, 84],
Axis.ORDINATE: [0, 25, 40, 55],
}
for axisName, axisProfile in zip(Axis, [secondImage[height // 2, width // 2:], secondImage[height // 2:, width // 2]]):
plt.title('Axis Fourier transform profile')
plt.xlabel('Fourier transform axis')
plt.ylabel('Fourier transform logarithmic intensity')
height, width = secondImage.shape
plt.plot(axisProfile, label = axisName)
'''
for axis in Axis:
for interestingValueOfAxis in INTERESTING_VALUES_OF_AXES[axis]:
match axis:
case Axis.ABSCISSA:
plt.vlines(interestingValueOfAxis)
#case Axis.ORDINATE:
'''
#allInterestingValuesOfAxes = list(set(itertools.chain(*INTERESTING_VALUES_OF_AXES.values())))
plt.xticks(list(plt.xticks()[0]) + allInterestingValuesOfAxes)
plt.legend()
plt.show()