From 3e7ecb4e131d2ba1aad55e50c87ec4ca9214ff18 Mon Sep 17 00:00:00 2001
From: Tobias Hangleiter <tobias.hangleiter@rwth-aachen.de>
Date: Wed, 21 May 2025 19:27:37 +0200
Subject: [PATCH] Only resolve settings once fmax is settled

---
 src/python_spectrometer/daq/zurich_instruments.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/python_spectrometer/daq/zurich_instruments.py b/src/python_spectrometer/daq/zurich_instruments.py
index 76f520d..c087277 100644
--- a/src/python_spectrometer/daq/zurich_instruments.py
+++ b/src/python_spectrometer/daq/zurich_instruments.py
@@ -194,7 +194,7 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
                 ``freq = 10e3, f_max = 2e3``, the spectrum will have a
                 bandwidth of ``[8e3, 12e3]``.
         **settings : Mapping
-            Additional settings for data acqusition.
+            Additional settings for data acquisition.
 
         Notes
         -----
@@ -225,7 +225,7 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
         .. [1] https://www.zhinst.com/europe/en/resources/principles-of-lock-in-detection
 
         """
-        settings = self.DAQSettings(freq=freq, **settings).to_consistent_dict()
+        settings = self.DAQSettings(freq=freq, **settings)
 
         if 'bandwidth' in settings:
             warnings.warn('The bandwidth parameter has been replaced by f_max',
@@ -237,6 +237,8 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
         if filter_order is not None:
             self.device.demods[self.demod].order(int(filter_order))
 
+        settings = settings.to_consistent_dict()
+
         # BW 3dB = √(2^(1/n) - 1) / 2πτ
         # BW NEP = Γ(n - 1/2) / 4τ √(π)Γ(n)
         n = self.device.demods[self.demod].order()
-- 
GitLab