diff --git a/pyproject.toml b/pyproject.toml index 74445cc..0a57f44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,11 @@ classifiers = [ "Development Status :: 2 - Pre-Alpha", "Topic :: Scientific/Engineering", ] +dependencies = [ + "numpy", + "scipy", + "rich", +] [project.urls] Homepage = "https://git.linarphy.net/linarphy/backscattering-analyzer" diff --git a/src/backscattering_analyzer/analyzer.py b/src/backscattering_analyzer/analyzer.py index 128326f..bcced61 100644 --- a/src/backscattering_analyzer/analyzer.py +++ b/src/backscattering_analyzer/analyzer.py @@ -187,29 +187,14 @@ class Analyzer: """ coupling = self.modelisation[self.settings.coupling_name()] - coupling_1, coupling_2 = ( - array( - [ - self.modelisation["freq"][0], - coupling[0], - ] - ), - array( - [ - self.modelisation["freq"][0], - coupling[1], - ] - ), - ) + nperseg = int(len(coupling[0]) * 2) - 1 rate = 1 / (self.movement[0, 1] - self.movement[0, 0]) - result = zeros(self.bench_movement.shape[1]) + result = zeros(coupling.shape[1]) scattering_factor = [0, 0] - for index in range( - len(self.modelisation[self.settings.coupling_name()]) - ): + for index in range(len(coupling)): argument = ( self.movement[1] * 4 @@ -226,7 +211,7 @@ class Analyzer: psd( sin(argument), fs=rate, - nperseg=2999, + nperseg=nperseg, )[1] * abs(coupling[0]) ) @@ -235,7 +220,7 @@ class Analyzer: psd( cos(argument), fs=rate, - nperseg=2999, + nperseg=nperseg, )[1] * abs(coupling[1]) )