Add dependencies and format

This commit is contained in:
linarphy 2024-05-13 18:35:26 +02:00
parent 5d801b0f3a
commit e3fea228a7
No known key found for this signature in database
GPG key ID: E61920135EFF2295
2 changed files with 10 additions and 20 deletions

View file

@ -15,6 +15,11 @@ classifiers = [
"Development Status :: 2 - Pre-Alpha", "Development Status :: 2 - Pre-Alpha",
"Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering",
] ]
dependencies = [
"numpy",
"scipy",
"rich",
]
[project.urls] [project.urls]
Homepage = "https://git.linarphy.net/linarphy/backscattering-analyzer" Homepage = "https://git.linarphy.net/linarphy/backscattering-analyzer"

View file

@ -187,29 +187,14 @@ class Analyzer:
""" """
coupling = self.modelisation[self.settings.coupling_name()] coupling = self.modelisation[self.settings.coupling_name()]
coupling_1, coupling_2 = ( nperseg = int(len(coupling[0]) * 2) - 1
array(
[
self.modelisation["freq"][0],
coupling[0],
]
),
array(
[
self.modelisation["freq"][0],
coupling[1],
]
),
)
rate = 1 / (self.movement[0, 1] - self.movement[0, 0]) 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] scattering_factor = [0, 0]
for index in range( for index in range(len(coupling)):
len(self.modelisation[self.settings.coupling_name()])
):
argument = ( argument = (
self.movement[1] self.movement[1]
* 4 * 4
@ -226,7 +211,7 @@ class Analyzer:
psd( psd(
sin(argument), sin(argument),
fs=rate, fs=rate,
nperseg=2999, nperseg=nperseg,
)[1] )[1]
* abs(coupling[0]) * abs(coupling[0])
) )
@ -235,7 +220,7 @@ class Analyzer:
psd( psd(
cos(argument), cos(argument),
fs=rate, fs=rate,
nperseg=2999, nperseg=nperseg,
)[1] )[1]
* abs(coupling[1]) * abs(coupling[1])
) )