aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorDmitry Butyugin <dmbutyugin@google.com>2021-03-14 14:58:29 +0100
committerKevinOConnor <kevin@koconnor.net>2021-03-20 13:24:43 -0400
commit2d8945dc1c5a799476c10bf54d7eb1bca3a0fd36 (patch)
tree3041c293063cde6a72460fac15627c811ab8331c /klippy/extras
parentb6908e56aa5584e7646422e8362bc7b994eae742 (diff)
downloadkutter-2d8945dc1c5a799476c10bf54d7eb1bca3a0fd36.tar.gz
kutter-2d8945dc1c5a799476c10bf54d7eb1bca3a0fd36.tar.xz
kutter-2d8945dc1c5a799476c10bf54d7eb1bca3a0fd36.zip
graph_accelerometer: Support axis-level comparison of adxl345 data
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/shaper_calibrate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/klippy/extras/shaper_calibrate.py b/klippy/extras/shaper_calibrate.py
index 1df4c943..71e5e489 100644
--- a/klippy/extras/shaper_calibrate.py
+++ b/klippy/extras/shaper_calibrate.py
@@ -139,6 +139,8 @@ class CalibrationData:
self.psd_y = psd_y
self.psd_z = psd_z
self._psd_list = [self.psd_sum, self.psd_x, self.psd_y, self.psd_z]
+ self._psd_map = {'x': self.psd_x, 'y': self.psd_y, 'z': self.psd_z,
+ 'all': self.psd_sum}
self.data_sets = 1
def join(self, other):
np = self.numpy
@@ -159,6 +161,8 @@ class CalibrationData:
psd /= self.freq_bins + .1
# Remove low-frequency noise
psd[self.freq_bins < MIN_FREQ] = 0.
+ def get_psd(self, axis='all'):
+ return self._psd_map[axis]
CalibrationResult = collections.namedtuple(