From 4fd3bfe203157e9767bcf174d26b17dd840bb130 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 9 Jun 2021 16:07:58 +0200 Subject: cal: Add min_freq and max_freq attributes to USRPCalibratorBase These allow specifying a min/max frequency on a device basis, instead of querying those from get_?x_freq_range(). The trouble with those methods is, they include the tune range provided by DSP tuning, which is not what we want for this calibration. --- host/python/uhd/usrp/cal/usrp_calibrator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'host/python') diff --git a/host/python/uhd/usrp/cal/usrp_calibrator.py b/host/python/uhd/usrp/cal/usrp_calibrator.py index a095a102c..ad3b23046 100644 --- a/host/python/uhd/usrp/cal/usrp_calibrator.py +++ b/host/python/uhd/usrp/cal/usrp_calibrator.py @@ -87,6 +87,8 @@ class USRPCalibratorBase: min_detectable_signal = -70 default_rate = DEFAULT_SAMP_RATE lo_offset = 0.0 + min_freq = None + max_freq = None def __init__(self, usrp, meas_dev, direction, **kwargs): self._usrp = usrp @@ -157,12 +159,12 @@ class USRPCalibratorBase: If a particular device needs to check specific frequencies, then override this. """ - start_min = \ + start_min = self.min_freq or \ getattr(self._usrp, 'get_{}_freq_range'.format(self._dir))( self._chan).start() start_hint = start_hint or start_min start = max(start_hint, start_min) - stop_max = \ + stop_max = self.max_freq or \ getattr(self._usrp, 'get_{}_freq_range'.format(self._dir))( self._chan).stop() stop_hint = stop_hint or stop_max -- cgit v1.2.3