aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2021-06-09 16:07:58 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-06-10 08:12:45 -0500
commit4fd3bfe203157e9767bcf174d26b17dd840bb130 (patch)
tree4a7ad6f09525bc4c51f8821f577e90c04c309c58
parenta04e0c2d30327a96409792a55818ba209ea9dd0a (diff)
downloaduhd-4fd3bfe203157e9767bcf174d26b17dd840bb130.tar.gz
uhd-4fd3bfe203157e9767bcf174d26b17dd840bb130.tar.bz2
uhd-4fd3bfe203157e9767bcf174d26b17dd840bb130.zip
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.
-rw-r--r--host/python/uhd/usrp/cal/usrp_calibrator.py6
1 files changed, 4 insertions, 2 deletions
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