From 4b884238a3725fa756d5f9ffef35d34d16fc7cc9 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 12 Feb 2024 11:20:52 -0700 Subject: [PATCH 01/37] update scos-actions, cleanup settings, add sigan settings, add test actions, remove passing of sigan instance to actions, remove sigan register component --- pyproject.toml | 2 +- .../test/test_multi_frequency_iq_action.yml | 19 ++++++++++++ .../test/test_single_frequency_iq_action.yml | 9 ++++++ .../test/test_single_frequency_m4s_action.yml | 10 +++++++ .../test/test_survey_iq_action_sr15.yml | 29 +++++++++++++++++++ .../test/test_survey_iq_action_sr56.yml | 29 +++++++++++++++++++ scos_usrp/discover/__init__.py | 26 +++++++++++------ scos_usrp/hardware/__init__.py | 3 -- scos_usrp/settings.py | 19 +++++------- 9 files changed, 122 insertions(+), 24 deletions(-) create mode 100644 scos_usrp/configs/test/test_multi_frequency_iq_action.yml create mode 100644 scos_usrp/configs/test/test_single_frequency_iq_action.yml create mode 100644 scos_usrp/configs/test/test_single_frequency_m4s_action.yml create mode 100644 scos_usrp/configs/test/test_survey_iq_action_sr15.yml create mode 100644 scos_usrp/configs/test/test_survey_iq_action_sr56.yml diff --git a/pyproject.toml b/pyproject.toml index eb3ffbf..b0a4c62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@7.0.1", + "scos_actions @ git+https://github.com/NTIA/scos-actions@8.0.0", ] [project.optional-dependencies] diff --git a/scos_usrp/configs/test/test_multi_frequency_iq_action.yml b/scos_usrp/configs/test/test_multi_frequency_iq_action.yml new file mode 100644 index 0000000..cce2422 --- /dev/null +++ b/scos_usrp/configs/test/test_multi_frequency_iq_action.yml @@ -0,0 +1,19 @@ +stepped_frequency_time_domain_iq: + name: test_multi_frequency_iq_action + frequency: + - 700.5e6 + - 709e6 + - 731.5e6 + - 739e6 + - 751e6 + - 763e6 + - 772e6 + - 782e6 + - 793e6 + - 802e6 + gain: 40 + sample_rate: 15.36e6 + duration_ms: 80 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False diff --git a/scos_usrp/configs/test/test_single_frequency_iq_action.yml b/scos_usrp/configs/test/test_single_frequency_iq_action.yml new file mode 100644 index 0000000..87943a4 --- /dev/null +++ b/scos_usrp/configs/test/test_single_frequency_iq_action.yml @@ -0,0 +1,9 @@ +single_frequency_time_domain_iq: + name: test_single_frequency_iq_action + frequency: 739e6 + gain: 40 + sample_rate: 15.36e6 + duration_ms: 1000 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False diff --git a/scos_usrp/configs/test/test_single_frequency_m4s_action.yml b/scos_usrp/configs/test/test_single_frequency_m4s_action.yml new file mode 100644 index 0000000..5c6ac63 --- /dev/null +++ b/scos_usrp/configs/test/test_single_frequency_m4s_action.yml @@ -0,0 +1,10 @@ +single_frequency_fft: + name: test_single_frequency_m4s_action + frequency: 739e6 + gain: 40 + sample_rate: 15.36e6 + fft_size: 1024 + nffts: 300 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False \ No newline at end of file diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr15.yml b/scos_usrp/configs/test/test_survey_iq_action_sr15.yml new file mode 100644 index 0000000..8eec06a --- /dev/null +++ b/scos_usrp/configs/test/test_survey_iq_action_sr15.yml @@ -0,0 +1,29 @@ +stepped_frequency_time_domain_iq: + name: test_survey_iq_action_sr15 + frequency: + - 700.5e6 + - 709e6 + - 731.5e6 + - 739e6 + - 751e6 + - 763e6 + - 772e6 + - 782e6 + - 793e6 + - 802e6 + gain: 40 + sample_rate: 15.36e6 + duration_ms: + - 1000 + - 1000 + - 1000 + - 1000 + - 1000 + - 1000 + - 10000 + - 1000 + - 1000 + - 10000 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr56.yml b/scos_usrp/configs/test/test_survey_iq_action_sr56.yml new file mode 100644 index 0000000..e9000c8 --- /dev/null +++ b/scos_usrp/configs/test/test_survey_iq_action_sr56.yml @@ -0,0 +1,29 @@ +stepped_frequency_time_domain_iq: + name: test_survey_iq_action_sr56 + frequency: + - 700.5e6 + - 709e6 + - 731.5e6 + - 739e6 + - 751e6 + - 763e6 + - 772e6 + - 782e6 + - 793e6 + - 802e6 + gain: 40 + sample_rate: 56e6 + duration_ms: + - 714 + - 714 + - 714 + - 714 + - 714 + - 714 + - 7140 + - 714 + - 714 + - 7140 + nskip: 56e4 + classification: UNCLASSIFIED + calibration_adjust: False \ No newline at end of file diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index da283da..5a16af0 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -4,24 +4,32 @@ from scos_actions.actions.sync_gps import SyncGps from scos_actions.discover import init -from scos_usrp.hardware import gps, sigan -from scos_usrp.settings import ACTION_DEFINITIONS_DIR +from scos_usrp.hardware import gps +from scos_usrp.settings import CONFIG_DIR, SIGAN_MODULE, SIGAN_CLASS logger = logging.getLogger(__name__) actions = { "monitor_usrp": MonitorSignalAnalyzer( - parameters={"name": "monitor_usrp"}, sigan=sigan + parameters={"name": "monitor_usrp"} ), - "sync_gps": SyncGps(gps, {"name": "sync_gps"}, sigan), + "sync_gps": SyncGps(gps, {"name": "sync_gps"}), } +test_actions = {} +ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions" logger.debug("scos_usrp: ACTION_DEFINITIONS_DIR = " + ACTION_DEFINITIONS_DIR) yaml_actions, yaml_test_actions = init( - sigan=sigan, gps=gps, yaml_dir=ACTION_DEFINITIONS_DIR + yaml_dir=ACTION_DEFINITIONS_DIR ) actions.update(yaml_actions) - - -def get_last_calibration_time(): - return sigan.last_calibration_time +logger.debug(f"scos-usrp: SIGAN_MODULE = {SIGAN_MODULE}") +logger.debug(f"scos-usrp: SIGAN_CLASS = {SIGAN_CLASS}") +if SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer": + logger.debug("scos-usrp: loading test action configs") + TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test" + logger.debug(f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}") + _, yaml_test_actions = init(yaml_dir=TEST_ACTION_DEFINITIONS_DIR) + logger.debug(f"scos-usrp: Found {len(yaml_test_actions)} test action configs") + test_actions.update(yaml_test_actions) +logger.debug(f"scos-usrp: len(test_actions) = {len(test_actions)}") \ No newline at end of file diff --git a/scos_usrp/hardware/__init__.py b/scos_usrp/hardware/__init__.py index 9ef83aa..faa1dd0 100644 --- a/scos_usrp/hardware/__init__.py +++ b/scos_usrp/hardware/__init__.py @@ -1,8 +1,5 @@ -from scos_actions.signals import register_component_with_status - from scos_usrp.hardware.gps_iface import USRPLocation from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer sigan = USRPSignalAnalyzer() -register_component_with_status.send(sigan, component=sigan) gps = USRPLocation(sigan) diff --git a/scos_usrp/settings.py b/scos_usrp/settings.py index e386a20..8735016 100644 --- a/scos_usrp/settings.py +++ b/scos_usrp/settings.py @@ -1,3 +1,4 @@ +import logging import sys from os import path @@ -7,18 +8,14 @@ env = Env() CONFIG_DIR = path.join(path.dirname(path.abspath(__file__)), "configs") -ACTION_DEFINITIONS_DIR = path.join(CONFIG_DIR, "actions") __cmd = path.split(sys.argv[0])[-1] -RUNNING_TESTS = "test" in __cmd - -if not settings.configured or not hasattr(settings, "MOCK_SIGAN"): - MOCK_SIGAN = env.bool("MOCK_SIGAN", default=False) or RUNNING_TESTS -else: - MOCK_SIGAN = settings.MOCK_SIGAN -if not settings.configured or not hasattr(settings, "MOCK_SIGAN_RANDOM"): - MOCK_SIGAN_RANDOM = env.bool("MOCK_SIGAN_RANDOM", default=False) -else: - MOCK_SIGAN_RANDOM = settings.MOCK_SIGAN_RANDOM +RUNNING_TESTS = "test" in __cmd +MOCK_SIGAN = env.bool("MOCK_SIGAN", default=False) or RUNNING_TESTS +MOCK_SIGAN_RANDOM = env.bool("MOCK_SIGAN_RANDOM", default=False) +if RUNNING_TESTS: + logging.basicConfig(level=logging.DEBUG) +SIGAN_MODULE = env.str("SIGAN_MODULE", default="scos_usrp.hardware.usrp_sigan") +SIGAN_CLASS = env.str("SIGAN_CLASS", default="USRPSignalAnalyzer") USRP_CONNECTION_ARGS = env("USRP_CONNECTION_ARGS", default="num_recv_frames=650") From 073f331d14c15cdcdd180a43982fb3ab0f9c1171 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 12 Feb 2024 11:23:04 -0700 Subject: [PATCH 02/37] capitalize yaml boolean for consistency with python --- scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml | 2 +- scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml | 2 +- scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml | 2 +- scos_usrp/configs/actions/survey_700MHz_band_iq.yml | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml index 8b71297..516ee58 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml index 5f839f2..9cc112e 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml index c104ff7..1415c42 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml index 1448621..d4d8a1d 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml index 0fba5a9..a273496 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml index 287df52..53bce37 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml index 83b274d..ff676f1 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml index da9b06d..82d7030 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml index a4d2c4d..5220cf9 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml index d1bb0b4..1feda27 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml @@ -6,4 +6,4 @@ single_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml index c038a31..5a62ed6 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml index 95c32ed..add2b26 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml index ba357e2..68eae93 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml index 36e2c30..31aed18 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml index ce1105d..cf5d669 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml index f02f544..644f0e5 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml index a378a67..1f9169f 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml index 5128cba..fae5647 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml index edbf610..781f09f 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml index f49e84d..bf10825 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml index 9905d24..6361dce 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml index dd43cd0..ece5252 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml index bf00680..dbcbd10 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml index 6f8ec90..e5d77ca 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml index 3044250..2ba10bb 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml index 12272f0..3ed44d4 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True diff --git a/scos_usrp/configs/actions/survey_700MHz_band_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_iq.yml index f276cf2..c7e11b4 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_iq.yml @@ -26,4 +26,4 @@ stepped_frequency_time_domain_iq: - 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: true + calibration_adjust: True From 2b8552b86ab40c5735b4bbd07c8a7d2d814f8598 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Wed, 14 Feb 2024 15:50:20 -0700 Subject: [PATCH 03/37] remove sigan/gps instantiation, make compatible with latest scos-actions changes, move calibration related code under cal_adjust check, disable cal adjust in tests --- scos_usrp/discover/__init__.py | 3 +- scos_usrp/hardware/__init__.py | 4 -- scos_usrp/hardware/tests/test_gps.py | 4 +- scos_usrp/hardware/tests/test_usrp.py | 10 ++--- scos_usrp/hardware/usrp_sigan.py | 58 ++++++++++++++------------- 5 files changed, 39 insertions(+), 40 deletions(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 5a16af0..e71d98b 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -4,7 +4,6 @@ from scos_actions.actions.sync_gps import SyncGps from scos_actions.discover import init -from scos_usrp.hardware import gps from scos_usrp.settings import CONFIG_DIR, SIGAN_MODULE, SIGAN_CLASS logger = logging.getLogger(__name__) @@ -13,7 +12,7 @@ "monitor_usrp": MonitorSignalAnalyzer( parameters={"name": "monitor_usrp"} ), - "sync_gps": SyncGps(gps, {"name": "sync_gps"}), + "sync_gps": SyncGps({"name": "sync_gps"}), } test_actions = {} diff --git a/scos_usrp/hardware/__init__.py b/scos_usrp/hardware/__init__.py index faa1dd0..8b13789 100644 --- a/scos_usrp/hardware/__init__.py +++ b/scos_usrp/hardware/__init__.py @@ -1,5 +1 @@ -from scos_usrp.hardware.gps_iface import USRPLocation -from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer -sigan = USRPSignalAnalyzer() -gps = USRPLocation(sigan) diff --git a/scos_usrp/hardware/tests/test_gps.py b/scos_usrp/hardware/tests/test_gps.py index bdfb57e..64aad2d 100644 --- a/scos_usrp/hardware/tests/test_gps.py +++ b/scos_usrp/hardware/tests/test_gps.py @@ -2,9 +2,9 @@ from unittest.mock import MagicMock, patch from pytest import approx +from scos_usrp.hardware.gps_iface import USRPLocation -from scos_usrp.hardware import USRPLocation, USRPSignalAnalyzer - +from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer class TestGPS: @patch("uhd.usrp.MultiUSRP") diff --git a/scos_usrp/hardware/tests/test_usrp.py b/scos_usrp/hardware/tests/test_usrp.py index 048848f..609095f 100644 --- a/scos_usrp/hardware/tests/test_usrp.py +++ b/scos_usrp/hardware/tests/test_usrp.py @@ -2,7 +2,7 @@ import pytest -from scos_usrp.hardware import sigan +from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer class TestUSRP: @@ -12,6 +12,7 @@ class TestUSRP: @pytest.fixture(autouse=True) def setup_mock_usrp(self): """Create the mock USRP""" + self.rx = USRPSignalAnalyzer() # Only setup once if self.setup_complete: @@ -19,9 +20,8 @@ def setup_mock_usrp(self): # Create the SignalAnalyzerInterface with the mock usrp_block and get the sigan # usrp_iface.connect() - if not sigan.is_available: + if not self.rx.is_available: raise RuntimeError("Receiver is not available.") - self.rx = sigan # Alert that the setup was complete self.setup_complete = True @@ -41,7 +41,7 @@ def test_acquire_samples_with_retries(self): self.rx.usrp.set_times_to_fail(times_to_fail) try: - self.rx.acquire_time_domain_samples(1000, retries=max_retries) + self.rx.acquire_time_domain_samples(1000, retries=max_retries, cal_adjust=False) except RuntimeError: msg = "Acquisition failing {} times sequentially with {}\n" msg += "retries requested should NOT have raised an error." @@ -66,7 +66,7 @@ def test_acquire_samples_fails_when_over_max_retries(self): msg += "retries requested SHOULD have raised an error." msg = msg.format(times_to_fail, max_retries) with pytest.raises(RuntimeError): - self.rx.acquire_time_domain_samples(1000, 1000, max_retries) + self.rx.acquire_time_domain_samples(1000, 1000, max_retries, cal_adjust=False) pytest.fail(msg) self.rx.usrp.set_times_to_fail(0) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 280b396..aa4b76f 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -12,10 +12,12 @@ """ import logging +from typing import Dict, Optional import numpy as np +from its_preselector.web_relay import WebRelay from scos_actions import utils -from scos_actions.calibration import sensor_calibration, sigan_calibration +from scos_actions.calibration.calibration import Calibration from scos_actions.hardware.sigan_iface import SignalAnalyzerInterface from scos_usrp import __version__ as SCOS_USRP_VERSION @@ -49,8 +51,8 @@ def overload(self): 0.01 # Ratio of samples above the ADC full range to trigger overload ) - def __init__(self): - super().__init__() + def __init__(self, sensor_cal: Calibration = None, sigan_cal: Calibration = None, switches: Optional[Dict[str, WebRelay]] =None): + super().__init__(sensor_cal, sigan_cal, switches) self._plugin_version = SCOS_USRP_VERSION self.uhd = None self.usrp = None @@ -64,6 +66,8 @@ def __init__(self): self.requested_frequency = 0 self.requested_gain = 0 self.requested_clock_rate = 0 + self.sensor_calibration_data = None + self.sigan_calibration_data = None self.connect() def connect(self): @@ -133,8 +137,8 @@ def sample_rate(self, rate): fs_MSps = self.sample_rate / 1e6 logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) # Set the clock rate based on calibration - if sigan_calibration is not None: - clock_rate = sigan_calibration.get_clock_rate(rate) + if self.sensor_calibration is not None: + clock_rate = self.sensor_calibration.get_clock_rate(rate) else: clock_rate = self.sample_rate # Maximize clock rate while keeping it under 40e6 @@ -228,7 +232,7 @@ def check_sensor_overload(self, data): ) # Convert log(V^2) to dBm self._sensor_overload = False # explicitly check is not None since 1db compression could be 0 - if self.sensor_calibration_data["1db_compression_point"] is not None: + if self.sensor_calibration_data and self.sensor_calibration_data["1db_compression_point"] is not None: self._sensor_overload = bool( time_domain_avg_power > self.sensor_calibration_data["1db_compression_point"] @@ -265,31 +269,31 @@ def acquire_time_domain_samples( ) cal_params = [] - if sensor_calibration is not None: - cal_params = sensor_calibration.calibration_parameters - try: - logger.debug(f"Using cal params: {cal_params}") - cal_args = [] - if cal_params is not None: - for p in cal_params: - cal_args.append(getattr(self, "requested_" + p)) - else: - cal_args = None - except KeyError: - raise Exception( - "One or more required cal parameters is not a valid sigan setting." - ) - logger.debug(f"Calibration arguments:{cal_args}") - self.recompute_sensor_calibration_data(cal_args) - nsamps = int(num_samples) - nskip = int(num_samples_skip) - - # Compute the linear gain - db_gain = self.sensor_calibration_data["gain"] if cal_adjust: + if not (settings.RUNNING_TESTS or settings.MOCK_SIGAN): + cal_params = self.sensor_calibration.calibration_parameters + try: + logger.debug(f"Using cal params: {cal_params}") + cal_args = [] + if cal_params is not None: + for p in cal_params: + cal_args.append(getattr(self, "requested_" + p)) + else: + cal_args = None + except KeyError: + raise Exception( + "One or more required cal parameters is not a valid sigan setting." + ) + logger.debug(f"Calibration arguments:{cal_args}") + self.recompute_sensor_calibration_data(cal_args) + # Compute the linear gain + db_gain = self.sensor_calibration_data["gain"] linear_gain = 10 ** (db_gain / 20.0) else: linear_gain = 1 + nsamps = int(num_samples) + nskip = int(num_samples_skip) + # Try to acquire the samples max_retries = retries while True: From 1944aa542ac9607f229a40fb3355aefcf3c5d658 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 08:52:28 -0700 Subject: [PATCH 04/37] change scos-actions branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b0a4c62..d43bb0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@8.0.0", + "scos_actions @ git+https://github.com/NTIA/scos-actions@SEA-178_test_actions_loading", ] [project.optional-dependencies] From 2acb7b93c8ecf64283aad3c34548c138b5b40cf9 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 12:44:53 -0700 Subject: [PATCH 05/37] fix bug in settings, make settings consistent with scos-tekrsa --- scos_usrp/settings.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scos_usrp/settings.py b/scos_usrp/settings.py index 8735016..c5959c7 100644 --- a/scos_usrp/settings.py +++ b/scos_usrp/settings.py @@ -1,15 +1,13 @@ import logging import sys -from os import path +from pathlib import Path -from django.conf import settings from environs import Env env = Env() +CONFIG_DIR = Path(__file__).parent.resolve() / "configs" -CONFIG_DIR = path.join(path.dirname(path.abspath(__file__)), "configs") - -__cmd = path.split(sys.argv[0])[-1] +__cmd = Path(sys.argv[0]).name RUNNING_TESTS = "test" in __cmd MOCK_SIGAN = env.bool("MOCK_SIGAN", default=False) or RUNNING_TESTS From e11f7ae6e080618a9601a3b2ec6c5a0c81d92803 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 13:00:49 -0700 Subject: [PATCH 06/37] fix log message bug --- scos_usrp/discover/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index e71d98b..79c1058 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -17,7 +17,7 @@ test_actions = {} ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions" -logger.debug("scos_usrp: ACTION_DEFINITIONS_DIR = " + ACTION_DEFINITIONS_DIR) +logger.debug("scos_usrp: ACTION_DEFINITIONS_DIR = " + str(ACTION_DEFINITIONS_DIR)) yaml_actions, yaml_test_actions = init( yaml_dir=ACTION_DEFINITIONS_DIR ) From c1df7ad4d558974bec75c9cc99aaf2f66e27d0a4 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 14:08:55 -0700 Subject: [PATCH 07/37] add get_pp_string() to mock usrp block --- scos_usrp/hardware/mocks/usrp_block.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scos_usrp/hardware/mocks/usrp_block.py b/scos_usrp/hardware/mocks/usrp_block.py index 0223768..b33ab94 100644 --- a/scos_usrp/hardware/mocks/usrp_block.py +++ b/scos_usrp/hardware/mocks/usrp_block.py @@ -71,3 +71,6 @@ def set_rx_gain(self, g): def get_rx_gain(self): return self.gain + + def get_pp_string() -> str: + return "Mock USRP" \ No newline at end of file From 085a071a14d84b7f1e0d91d722ca58acd6b2eec6 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 15:00:12 -0700 Subject: [PATCH 08/37] fix bug in mock get_pp_string() --- scos_usrp/hardware/mocks/usrp_block.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scos_usrp/hardware/mocks/usrp_block.py b/scos_usrp/hardware/mocks/usrp_block.py index b33ab94..be24de5 100644 --- a/scos_usrp/hardware/mocks/usrp_block.py +++ b/scos_usrp/hardware/mocks/usrp_block.py @@ -72,5 +72,5 @@ def set_rx_gain(self, g): def get_rx_gain(self): return self.gain - def get_pp_string() -> str: + def get_pp_string(self) -> str: return "Mock USRP" \ No newline at end of file From 53e51dc52b39ee4edf9e32fca3e6a63c490d2d97 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 15 Feb 2024 15:39:41 -0700 Subject: [PATCH 09/37] add test action --- .../test/test_survey_iq_action_sr14.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 scos_usrp/configs/test/test_survey_iq_action_sr14.yml diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr14.yml b/scos_usrp/configs/test/test_survey_iq_action_sr14.yml new file mode 100644 index 0000000..5b2e9ff --- /dev/null +++ b/scos_usrp/configs/test/test_survey_iq_action_sr14.yml @@ -0,0 +1,29 @@ +stepped_frequency_time_domain_iq: + name: test_survey_iq_action_sr14 + frequency: + - 700.5e6 + - 709e6 + - 731.5e6 + - 739e6 + - 751e6 + - 763e6 + - 772e6 + - 782e6 + - 793e6 + - 802e6 + reference_level: -10 + sample_rate: 14e6 + duration_ms: + - 1000 + - 1000 + - 1000 + - 1000 + - 1000 + - 1000 + - 10000 + - 1000 + - 1000 + - 10000 + nskip: 0 + classification: UNCLASSIFIED + calibration_adjust: False From 734e2789289009f18dc804b14507afba93273f5c Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 20 Feb 2024 10:47:23 -0700 Subject: [PATCH 10/37] load test monitor and gps actions, fix get_clock_rate() call, check overload dependent on cal_adjust --- scos_usrp/discover/__init__.py | 4 ++++ scos_usrp/hardware/usrp_sigan.py | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 79c1058..a84a354 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -26,6 +26,10 @@ logger.debug(f"scos-usrp: SIGAN_CLASS = {SIGAN_CLASS}") if SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer": logger.debug("scos-usrp: loading test action configs") + test_actions["monitor_usrp"] = MonitorSignalAnalyzer( + parameters={"name": "monitor_usrp"} + ) + test_actions["sync_gps"] = SyncGps({"name": "sync_gps"}) TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test" logger.debug(f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}") _, yaml_test_actions = init(yaml_dir=TEST_ACTION_DEFINITIONS_DIR) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index aa4b76f..b23f369 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -137,8 +137,8 @@ def sample_rate(self, rate): fs_MSps = self.sample_rate / 1e6 logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) # Set the clock rate based on calibration - if self.sensor_calibration is not None: - clock_rate = self.sensor_calibration.get_clock_rate(rate) + if self.sigan_calibration is not None: + clock_rate = self.sigan_calibration.get_clock_rate(rate) else: clock_rate = self.sample_rate # Maximize clock rate while keeping it under 40e6 @@ -222,7 +222,7 @@ def gain(self, gain): msg = "set USRP gain: {:.1f} dB" logger.debug(msg.format(self.usrp.get_rx_gain())) - def check_sensor_overload(self, data): + def check_sensor_overload(self, data, cal_adjust=True): """Check for sensor overload in the measurement data.""" measured_data = data.astype(np.complex64) @@ -232,7 +232,7 @@ def check_sensor_overload(self, data): ) # Convert log(V^2) to dBm self._sensor_overload = False # explicitly check is not None since 1db compression could be 0 - if self.sensor_calibration_data and self.sensor_calibration_data["1db_compression_point"] is not None: + if cal_adjust and self.sensor_calibration_data["1db_compression_point"] is not None: self._sensor_overload = bool( time_domain_avg_power > self.sensor_calibration_data["1db_compression_point"] @@ -345,7 +345,7 @@ def acquire_time_domain_samples( # Scale the data back to RF power and return it data /= linear_gain - self.check_sensor_overload(data) + self.check_sensor_overload(data, cal_adjust) measurement_result = { "data": data, "overload": self.overload, From 5b6803af71184a8b607ad8bacf4a6dd41bfec75e Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 20 Feb 2024 15:33:53 -0700 Subject: [PATCH 11/37] remove extra test survey actions --- ...ion_sr15.yml => test_survey_iq_action.yml} | 0 .../test/test_survey_iq_action_sr14.yml | 29 ------------------- .../test/test_survey_iq_action_sr56.yml | 29 ------------------- 3 files changed, 58 deletions(-) rename scos_usrp/configs/test/{test_survey_iq_action_sr15.yml => test_survey_iq_action.yml} (100%) delete mode 100644 scos_usrp/configs/test/test_survey_iq_action_sr14.yml delete mode 100644 scos_usrp/configs/test/test_survey_iq_action_sr56.yml diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr15.yml b/scos_usrp/configs/test/test_survey_iq_action.yml similarity index 100% rename from scos_usrp/configs/test/test_survey_iq_action_sr15.yml rename to scos_usrp/configs/test/test_survey_iq_action.yml diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr14.yml b/scos_usrp/configs/test/test_survey_iq_action_sr14.yml deleted file mode 100644 index 5b2e9ff..0000000 --- a/scos_usrp/configs/test/test_survey_iq_action_sr14.yml +++ /dev/null @@ -1,29 +0,0 @@ -stepped_frequency_time_domain_iq: - name: test_survey_iq_action_sr14 - frequency: - - 700.5e6 - - 709e6 - - 731.5e6 - - 739e6 - - 751e6 - - 763e6 - - 772e6 - - 782e6 - - 793e6 - - 802e6 - reference_level: -10 - sample_rate: 14e6 - duration_ms: - - 1000 - - 1000 - - 1000 - - 1000 - - 1000 - - 1000 - - 10000 - - 1000 - - 1000 - - 10000 - nskip: 0 - classification: UNCLASSIFIED - calibration_adjust: False diff --git a/scos_usrp/configs/test/test_survey_iq_action_sr56.yml b/scos_usrp/configs/test/test_survey_iq_action_sr56.yml deleted file mode 100644 index e9000c8..0000000 --- a/scos_usrp/configs/test/test_survey_iq_action_sr56.yml +++ /dev/null @@ -1,29 +0,0 @@ -stepped_frequency_time_domain_iq: - name: test_survey_iq_action_sr56 - frequency: - - 700.5e6 - - 709e6 - - 731.5e6 - - 739e6 - - 751e6 - - 763e6 - - 772e6 - - 782e6 - - 793e6 - - 802e6 - gain: 40 - sample_rate: 56e6 - duration_ms: - - 714 - - 714 - - 714 - - 714 - - 714 - - 714 - - 7140 - - 714 - - 714 - - 7140 - nskip: 56e4 - classification: UNCLASSIFIED - calibration_adjust: False \ No newline at end of file From ad7134b6ef9e9e354206bf5b278f3a7110d86611 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 27 Feb 2024 15:34:50 -0700 Subject: [PATCH 12/37] fix survey action name --- scos_usrp/configs/test/test_survey_iq_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scos_usrp/configs/test/test_survey_iq_action.yml b/scos_usrp/configs/test/test_survey_iq_action.yml index 8eec06a..495078a 100644 --- a/scos_usrp/configs/test/test_survey_iq_action.yml +++ b/scos_usrp/configs/test/test_survey_iq_action.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: test_survey_iq_action_sr15 + name: test_survey_iq_action frequency: - 700.5e6 - 709e6 From 22b8dac90eec7666ec3ee05175dd2d15823334b8 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Wed, 28 Feb 2024 09:05:53 -0700 Subject: [PATCH 13/37] add test to monitor and gps action names in test actions --- scos_usrp/discover/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index a84a354..8b05db8 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -26,10 +26,10 @@ logger.debug(f"scos-usrp: SIGAN_CLASS = {SIGAN_CLASS}") if SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer": logger.debug("scos-usrp: loading test action configs") - test_actions["monitor_usrp"] = MonitorSignalAnalyzer( + test_actions["test_monitor_usrp"] = MonitorSignalAnalyzer( parameters={"name": "monitor_usrp"} ) - test_actions["sync_gps"] = SyncGps({"name": "sync_gps"}) + test_actions["test_sync_gps"] = SyncGps({"name": "sync_gps"}) TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test" logger.debug(f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}") _, yaml_test_actions = init(yaml_dir=TEST_ACTION_DEFINITIONS_DIR) From b44743b6993d2c0074a918c69e9d8ac5b8cd05cb Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Wed, 28 Feb 2024 10:52:05 -0700 Subject: [PATCH 14/37] autoformat code --- .../test/test_single_frequency_m4s_action.yml | 2 +- scos_usrp/discover/__init__.py | 23 ++++++++++--------- scos_usrp/hardware/__init__.py | 1 - scos_usrp/hardware/mocks/usrp_block.py | 2 +- scos_usrp/hardware/tests/test_gps.py | 3 ++- scos_usrp/hardware/tests/test_usrp.py | 8 +++++-- scos_usrp/hardware/usrp_sigan.py | 14 ++++++++--- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/scos_usrp/configs/test/test_single_frequency_m4s_action.yml b/scos_usrp/configs/test/test_single_frequency_m4s_action.yml index 5c6ac63..d1cb0a8 100644 --- a/scos_usrp/configs/test/test_single_frequency_m4s_action.yml +++ b/scos_usrp/configs/test/test_single_frequency_m4s_action.yml @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: False \ No newline at end of file + calibration_adjust: False diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 8b05db8..3126736 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -4,35 +4,36 @@ from scos_actions.actions.sync_gps import SyncGps from scos_actions.discover import init -from scos_usrp.settings import CONFIG_DIR, SIGAN_MODULE, SIGAN_CLASS +from scos_usrp.settings import CONFIG_DIR, SIGAN_CLASS, SIGAN_MODULE logger = logging.getLogger(__name__) actions = { - "monitor_usrp": MonitorSignalAnalyzer( - parameters={"name": "monitor_usrp"} - ), + "monitor_usrp": MonitorSignalAnalyzer(parameters={"name": "monitor_usrp"}), "sync_gps": SyncGps({"name": "sync_gps"}), } test_actions = {} ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions" logger.debug("scos_usrp: ACTION_DEFINITIONS_DIR = " + str(ACTION_DEFINITIONS_DIR)) -yaml_actions, yaml_test_actions = init( - yaml_dir=ACTION_DEFINITIONS_DIR -) +yaml_actions, yaml_test_actions = init(yaml_dir=ACTION_DEFINITIONS_DIR) actions.update(yaml_actions) logger.debug(f"scos-usrp: SIGAN_MODULE = {SIGAN_MODULE}") logger.debug(f"scos-usrp: SIGAN_CLASS = {SIGAN_CLASS}") -if SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer": +if ( + SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" + and SIGAN_CLASS == "USRPSignalAnalyzer" +): logger.debug("scos-usrp: loading test action configs") test_actions["test_monitor_usrp"] = MonitorSignalAnalyzer( parameters={"name": "monitor_usrp"} ) - test_actions["test_sync_gps"] = SyncGps({"name": "sync_gps"}) + test_actions["test_sync_gps"] = SyncGps({"name": "sync_gps"}) TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test" - logger.debug(f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}") + logger.debug( + f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}" + ) _, yaml_test_actions = init(yaml_dir=TEST_ACTION_DEFINITIONS_DIR) logger.debug(f"scos-usrp: Found {len(yaml_test_actions)} test action configs") test_actions.update(yaml_test_actions) -logger.debug(f"scos-usrp: len(test_actions) = {len(test_actions)}") \ No newline at end of file +logger.debug(f"scos-usrp: len(test_actions) = {len(test_actions)}") diff --git a/scos_usrp/hardware/__init__.py b/scos_usrp/hardware/__init__.py index 8b13789..e69de29 100644 --- a/scos_usrp/hardware/__init__.py +++ b/scos_usrp/hardware/__init__.py @@ -1 +0,0 @@ - diff --git a/scos_usrp/hardware/mocks/usrp_block.py b/scos_usrp/hardware/mocks/usrp_block.py index be24de5..7803619 100644 --- a/scos_usrp/hardware/mocks/usrp_block.py +++ b/scos_usrp/hardware/mocks/usrp_block.py @@ -73,4 +73,4 @@ def get_rx_gain(self): return self.gain def get_pp_string(self) -> str: - return "Mock USRP" \ No newline at end of file + return "Mock USRP" diff --git a/scos_usrp/hardware/tests/test_gps.py b/scos_usrp/hardware/tests/test_gps.py index 64aad2d..ece7bfb 100644 --- a/scos_usrp/hardware/tests/test_gps.py +++ b/scos_usrp/hardware/tests/test_gps.py @@ -2,10 +2,11 @@ from unittest.mock import MagicMock, patch from pytest import approx -from scos_usrp.hardware.gps_iface import USRPLocation +from scos_usrp.hardware.gps_iface import USRPLocation from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer + class TestGPS: @patch("uhd.usrp.MultiUSRP") def test_get_lat_long_returns_location(self, mock_usrp, caplog): diff --git a/scos_usrp/hardware/tests/test_usrp.py b/scos_usrp/hardware/tests/test_usrp.py index 609095f..d8f2ec6 100644 --- a/scos_usrp/hardware/tests/test_usrp.py +++ b/scos_usrp/hardware/tests/test_usrp.py @@ -41,7 +41,9 @@ def test_acquire_samples_with_retries(self): self.rx.usrp.set_times_to_fail(times_to_fail) try: - self.rx.acquire_time_domain_samples(1000, retries=max_retries, cal_adjust=False) + self.rx.acquire_time_domain_samples( + 1000, retries=max_retries, cal_adjust=False + ) except RuntimeError: msg = "Acquisition failing {} times sequentially with {}\n" msg += "retries requested should NOT have raised an error." @@ -66,7 +68,9 @@ def test_acquire_samples_fails_when_over_max_retries(self): msg += "retries requested SHOULD have raised an error." msg = msg.format(times_to_fail, max_retries) with pytest.raises(RuntimeError): - self.rx.acquire_time_domain_samples(1000, 1000, max_retries, cal_adjust=False) + self.rx.acquire_time_domain_samples( + 1000, 1000, max_retries, cal_adjust=False + ) pytest.fail(msg) self.rx.usrp.set_times_to_fail(0) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index b23f369..38bc62f 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -51,7 +51,12 @@ def overload(self): 0.01 # Ratio of samples above the ADC full range to trigger overload ) - def __init__(self, sensor_cal: Calibration = None, sigan_cal: Calibration = None, switches: Optional[Dict[str, WebRelay]] =None): + def __init__( + self, + sensor_cal: Calibration = None, + sigan_cal: Calibration = None, + switches: Optional[Dict[str, WebRelay]] = None, + ): super().__init__(sensor_cal, sigan_cal, switches) self._plugin_version = SCOS_USRP_VERSION self.uhd = None @@ -232,7 +237,10 @@ def check_sensor_overload(self, data, cal_adjust=True): ) # Convert log(V^2) to dBm self._sensor_overload = False # explicitly check is not None since 1db compression could be 0 - if cal_adjust and self.sensor_calibration_data["1db_compression_point"] is not None: + if ( + cal_adjust + and self.sensor_calibration_data["1db_compression_point"] is not None + ): self._sensor_overload = bool( time_domain_avg_power > self.sensor_calibration_data["1db_compression_point"] @@ -293,7 +301,7 @@ def acquire_time_domain_samples( linear_gain = 1 nsamps = int(num_samples) nskip = int(num_samples_skip) - + # Try to acquire the samples max_retries = retries while True: From b6e2a42d6d711878b5e29d567db1fce1f03f8cb5 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 29 Feb 2024 08:58:42 -0700 Subject: [PATCH 15/37] remove test gps action --- scos_usrp/discover/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 3126736..08b17d2 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -28,7 +28,6 @@ test_actions["test_monitor_usrp"] = MonitorSignalAnalyzer( parameters={"name": "monitor_usrp"} ) - test_actions["test_sync_gps"] = SyncGps({"name": "sync_gps"}) TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test" logger.debug( f"scos-usrp: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}" From 07d46253c78e70b24596c31c32ddc2c06dac74b3 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 1 Mar 2024 11:12:48 -0700 Subject: [PATCH 16/37] add check for 1db compression --- scos_usrp/hardware/usrp_sigan.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 38bc62f..0ecac6f 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -239,6 +239,7 @@ def check_sensor_overload(self, data, cal_adjust=True): # explicitly check is not None since 1db compression could be 0 if ( cal_adjust + and "1db_compression_point" in self.sensor_calibration_data and self.sensor_calibration_data["1db_compression_point"] is not None ): self._sensor_overload = bool( From 09345edbfb12e2ac49a284b5482a5e93fa94b841 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 4 Mar 2024 11:30:37 -0700 Subject: [PATCH 17/37] remove outdated method (already in base class) --- scos_usrp/hardware/usrp_sigan.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 0ecac6f..48bd2d8 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -33,12 +33,6 @@ class USRPSignalAnalyzer(SignalAnalyzerInterface): - @property - def last_calibration_time(self): - """Returns the last calibration time from calibration data.""" - return utils.convert_string_to_millisecond_iso_format( - sensor_calibration.calibration_datetime - ) @property def overload(self): From 8e629902f9fe5a5ec97dadf7b34058dec288afed Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 11 Mar 2024 09:52:34 -0600 Subject: [PATCH 18/37] add plugin_name property to usrp_sigan --- scos_usrp/hardware/usrp_sigan.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 48bd2d8..2e28abf 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -21,6 +21,7 @@ from scos_actions.hardware.sigan_iface import SignalAnalyzerInterface from scos_usrp import __version__ as SCOS_USRP_VERSION +from scos_usrp import __package__ as SCOS_USRP_NAME from scos_usrp import settings from scos_usrp.hardware.mocks.usrp_block import MockUsrp @@ -53,6 +54,7 @@ def __init__( ): super().__init__(sensor_cal, sigan_cal, switches) self._plugin_version = SCOS_USRP_VERSION + self._plugin_name = SCOS_USRP_NAME self.uhd = None self.usrp = None self._is_available = False @@ -113,6 +115,11 @@ def connect(self): def plugin_version(self): """Returns the current version of scos-usrp.""" return self._plugin_version + + @property + def plugin_name(self) -> str: + """Returns the current package name of scos-usrp.""" + return self._plugin_name @property def is_available(self): From f1729b14a5b77e428b9db76d9abbb3e995b34eae Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 15 Mar 2024 12:18:15 -0600 Subject: [PATCH 19/37] only load actions if sigan set to USRP sigan --- scos_usrp/discover/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 08b17d2..34d26a8 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -8,22 +8,24 @@ logger = logging.getLogger(__name__) -actions = { - "monitor_usrp": MonitorSignalAnalyzer(parameters={"name": "monitor_usrp"}), - "sync_gps": SyncGps({"name": "sync_gps"}), -} +actions = {} test_actions = {} ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions" logger.debug("scos_usrp: ACTION_DEFINITIONS_DIR = " + str(ACTION_DEFINITIONS_DIR)) -yaml_actions, yaml_test_actions = init(yaml_dir=ACTION_DEFINITIONS_DIR) -actions.update(yaml_actions) + logger.debug(f"scos-usrp: SIGAN_MODULE = {SIGAN_MODULE}") logger.debug(f"scos-usrp: SIGAN_CLASS = {SIGAN_CLASS}") if ( SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer" ): + actions.update({ + "monitor_usrp": MonitorSignalAnalyzer(parameters={"name": "monitor_usrp"}), + "sync_gps": SyncGps({"name": "sync_gps"}), + }) + yaml_actions, yaml_test_actions = init(yaml_dir=ACTION_DEFINITIONS_DIR) + actions.update(yaml_actions) logger.debug("scos-usrp: loading test action configs") test_actions["test_monitor_usrp"] = MonitorSignalAnalyzer( parameters={"name": "monitor_usrp"} From 528ac136339f1db082b5752b9a8d8f897cd1e960 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 8 Apr 2024 11:06:31 -0600 Subject: [PATCH 20/37] formatting, update to latest scos-actions changes, pass sensor to gps methods, always maximize clock rate when setting sample rate --- scos_usrp/discover/__init__.py | 10 ++++++---- scos_usrp/hardware/gps_iface.py | 18 +++++++----------- scos_usrp/hardware/tests/test_gps.py | 11 +++++++---- scos_usrp/hardware/usrp_sigan.py | 24 ++++++++---------------- 4 files changed, 28 insertions(+), 35 deletions(-) diff --git a/scos_usrp/discover/__init__.py b/scos_usrp/discover/__init__.py index 34d26a8..77c1519 100644 --- a/scos_usrp/discover/__init__.py +++ b/scos_usrp/discover/__init__.py @@ -20,10 +20,12 @@ SIGAN_MODULE == "scos_usrp.hardware.usrp_sigan" and SIGAN_CLASS == "USRPSignalAnalyzer" ): - actions.update({ - "monitor_usrp": MonitorSignalAnalyzer(parameters={"name": "monitor_usrp"}), - "sync_gps": SyncGps({"name": "sync_gps"}), - }) + actions.update( + { + "monitor_usrp": MonitorSignalAnalyzer(parameters={"name": "monitor_usrp"}), + "sync_gps": SyncGps({"name": "sync_gps"}), + } + ) yaml_actions, yaml_test_actions = init(yaml_dir=ACTION_DEFINITIONS_DIR) actions.update(yaml_actions) logger.debug("scos-usrp: loading test action configs") diff --git a/scos_usrp/hardware/gps_iface.py b/scos_usrp/hardware/gps_iface.py index 7633906..f49e231 100644 --- a/scos_usrp/hardware/gps_iface.py +++ b/scos_usrp/hardware/gps_iface.py @@ -1,27 +1,23 @@ """Provides an interface to the on-board GPS.""" import logging -import subprocess from datetime import datetime from time import sleep, time from scos_actions.hardware.gps_iface import GPSInterface +from scos_actions.hardware.sensor import Sensor logger = logging.getLogger(__name__) class USRPLocation(GPSInterface): - def __init__(self, sigan): - self.sigan = sigan - - def get_location(self, timeout_s=1): + def get_location(self, sensor: Sensor, timeout_s: float = 1): """Use low-level UHD and USRP block methods to sync with GPS.""" - if not self.sigan.is_available: + if not sensor.signal_analyzer.is_available: return None - uhd = self.sigan.uhd - usrp = self.sigan.usrp + usrp = sensor.signal_analyzer.usrp logger.debug("Waiting for GPS lock... ") start = time() @@ -126,9 +122,9 @@ def get_location(self, timeout_s=1): return latitude_dd, longitude_dd, height - def get_gps_time(self): - uhd = self.sigan.uhd - usrp = self.sigan.usrp + def get_gps_time(self, sensor: Sensor): + uhd = sensor.signal_analyzer.uhd + usrp = sensor.signal_analyzer.usrp gps_t = uhd.types.TimeSpec(usrp.get_mboard_sensor("gps_time").to_int() + 1) usrp.set_time_next_pps(gps_t) diff --git a/scos_usrp/hardware/tests/test_gps.py b/scos_usrp/hardware/tests/test_gps.py index ece7bfb..bbcc3d9 100644 --- a/scos_usrp/hardware/tests/test_gps.py +++ b/scos_usrp/hardware/tests/test_gps.py @@ -3,6 +3,7 @@ from pytest import approx +from scos_actions.hardware.sensor import Sensor from scos_usrp.hardware.gps_iface import USRPLocation from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer @@ -33,8 +34,9 @@ def side_effect(value): sigan.uhd = MagicMock() sigan.uhd.types = MagicMock() sigan.uhd.types.TimeSpec = MagicMock() - gps = USRPLocation(sigan) - latitude, longitude, height = gps.get_location() + gps = USRPLocation() + sensor = Sensor(sigan, {}, gps) + latitude, longitude, height = gps.get_location(sensor) assert latitude == approx(39.99511463) assert longitude == approx(-105.26158690) assert height == approx(10.0) @@ -66,6 +68,7 @@ def side_effect(value): sigan.uhd = MagicMock() sigan.uhd.types = MagicMock() sigan.uhd.types.TimeSpec = MagicMock() - gps = USRPLocation(sigan) - ret = gps.get_location() + gps = USRPLocation() + sensor = Sensor(sigan, {}, gps) + ret = gps.get_location(sensor) assert ret == None diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 2e28abf..7ac8c4c 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -17,11 +17,10 @@ import numpy as np from its_preselector.web_relay import WebRelay from scos_actions import utils -from scos_actions.calibration.calibration import Calibration from scos_actions.hardware.sigan_iface import SignalAnalyzerInterface -from scos_usrp import __version__ as SCOS_USRP_VERSION from scos_usrp import __package__ as SCOS_USRP_NAME +from scos_usrp import __version__ as SCOS_USRP_VERSION from scos_usrp import settings from scos_usrp.hardware.mocks.usrp_block import MockUsrp @@ -34,7 +33,6 @@ class USRPSignalAnalyzer(SignalAnalyzerInterface): - @property def overload(self): """Returns True if overload occurred, otherwise returns False.""" @@ -48,11 +46,9 @@ def overload(self): def __init__( self, - sensor_cal: Calibration = None, - sigan_cal: Calibration = None, switches: Optional[Dict[str, WebRelay]] = None, ): - super().__init__(sensor_cal, sigan_cal, switches) + super().__init__(switches) self._plugin_version = SCOS_USRP_VERSION self._plugin_name = SCOS_USRP_NAME self.uhd = None @@ -115,7 +111,7 @@ def connect(self): def plugin_version(self): """Returns the current version of scos-usrp.""" return self._plugin_version - + @property def plugin_name(self) -> str: """Returns the current package name of scos-usrp.""" @@ -142,15 +138,11 @@ def sample_rate(self, rate): self.usrp.set_rx_rate(rate) fs_MSps = self.sample_rate / 1e6 logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) - # Set the clock rate based on calibration - if self.sigan_calibration is not None: - clock_rate = self.sigan_calibration.get_clock_rate(rate) - else: - clock_rate = self.sample_rate - # Maximize clock rate while keeping it under 40e6 - while clock_rate <= 40e6: - clock_rate *= 2 - clock_rate /= 2 + clock_rate = self.sample_rate + # Maximize clock rate while keeping it under 40e6 + while clock_rate <= 40e6: + clock_rate *= 2 + clock_rate /= 2 self.clock_rate = clock_rate @property From 47434415a07e9b3d582710453089abcd41d9076f Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 8 Apr 2024 14:43:01 -0600 Subject: [PATCH 21/37] rename gps_iface.py to usrp_gps.py, USRPLocation to UsrpGps --- scos_usrp/hardware/tests/test_gps.py | 6 +++--- scos_usrp/hardware/{gps_iface.py => usrp_gps.py} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename scos_usrp/hardware/{gps_iface.py => usrp_gps.py} (99%) diff --git a/scos_usrp/hardware/tests/test_gps.py b/scos_usrp/hardware/tests/test_gps.py index bbcc3d9..259db53 100644 --- a/scos_usrp/hardware/tests/test_gps.py +++ b/scos_usrp/hardware/tests/test_gps.py @@ -4,7 +4,7 @@ from pytest import approx from scos_actions.hardware.sensor import Sensor -from scos_usrp.hardware.gps_iface import USRPLocation +from scos_usrp.hardware.usrp_gps import UsrpGps from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer @@ -34,7 +34,7 @@ def side_effect(value): sigan.uhd = MagicMock() sigan.uhd.types = MagicMock() sigan.uhd.types.TimeSpec = MagicMock() - gps = USRPLocation() + gps = UsrpGps() sensor = Sensor(sigan, {}, gps) latitude, longitude, height = gps.get_location(sensor) assert latitude == approx(39.99511463) @@ -68,7 +68,7 @@ def side_effect(value): sigan.uhd = MagicMock() sigan.uhd.types = MagicMock() sigan.uhd.types.TimeSpec = MagicMock() - gps = USRPLocation() + gps = UsrpGps() sensor = Sensor(sigan, {}, gps) ret = gps.get_location(sensor) assert ret == None diff --git a/scos_usrp/hardware/gps_iface.py b/scos_usrp/hardware/usrp_gps.py similarity index 99% rename from scos_usrp/hardware/gps_iface.py rename to scos_usrp/hardware/usrp_gps.py index f49e231..e8ef63d 100644 --- a/scos_usrp/hardware/gps_iface.py +++ b/scos_usrp/hardware/usrp_gps.py @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) -class USRPLocation(GPSInterface): +class UsrpGps(GPSInterface): def get_location(self, sensor: Sensor, timeout_s: float = 1): """Use low-level UHD and USRP block methods to sync with GPS.""" From 950b636823f1b6fffcf0fdc4cfb70f02dd8d8b6d Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 9 Apr 2024 13:23:26 -0600 Subject: [PATCH 22/37] simplify sigan overload, move sensor overload to sensor class in scos-actions, update to be compatible with latest scos-actions --- scos_usrp/hardware/tests/test_gps.py | 2 +- scos_usrp/hardware/usrp_sigan.py | 83 +++------------------------- 2 files changed, 10 insertions(+), 75 deletions(-) diff --git a/scos_usrp/hardware/tests/test_gps.py b/scos_usrp/hardware/tests/test_gps.py index 259db53..25d5750 100644 --- a/scos_usrp/hardware/tests/test_gps.py +++ b/scos_usrp/hardware/tests/test_gps.py @@ -2,8 +2,8 @@ from unittest.mock import MagicMock, patch from pytest import approx - from scos_actions.hardware.sensor import Sensor + from scos_usrp.hardware.usrp_gps import UsrpGps from scos_usrp.hardware.usrp_sigan import USRPSignalAnalyzer diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 7ac8c4c..1d9853a 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -33,11 +33,6 @@ class USRPSignalAnalyzer(SignalAnalyzerInterface): - @property - def overload(self): - """Returns True if overload occurred, otherwise returns False.""" - return self._sigan_overload or self._sensor_overload - # Define thresholds for determining ADC overload for the sigan ADC_FULL_RANGE_THRESHOLD = 0.98 # ADC scale -1 self.sensor_calibration_data["1db_compression_point"] - ) - - def acquire_time_domain_samples( - self, num_samples, num_samples_skip=0, retries=5, cal_adjust: bool = True - ): + def acquire_time_domain_samples(self, num_samples: int, num_samples_skip: int = 0): """Acquire num_samples_skip+num_samples samples and return the last num_samples :type num_samples: int @@ -251,9 +222,6 @@ def acquire_time_domain_samples( :type num_samples_skip: int :param num_samples_skip: Skip samples to allow signal analyzer DC offset and IQ imbalance algorithms to take effect - :type retries: int - :param retries: The number of retries to attempt when failing to acquire samples - :rtype: dictionary containing the following: data - (list) measurement data overload - (boolean) True if overload occurred, otherwise False @@ -263,41 +231,16 @@ def acquire_time_domain_samples( capture_time - (string) Measurement capture time calibration_annotation - (dict) SigMF calibration annotation """ - self._sigan_overload = False + sigan_overload = False self._capture_time = None # Get the calibration data for the acquisition logger.debug( "Using requested sample rate of " + str(self.requested_sample_rate) ) - cal_params = [] - - if cal_adjust: - if not (settings.RUNNING_TESTS or settings.MOCK_SIGAN): - cal_params = self.sensor_calibration.calibration_parameters - try: - logger.debug(f"Using cal params: {cal_params}") - cal_args = [] - if cal_params is not None: - for p in cal_params: - cal_args.append(getattr(self, "requested_" + p)) - else: - cal_args = None - except KeyError: - raise Exception( - "One or more required cal parameters is not a valid sigan setting." - ) - logger.debug(f"Calibration arguments:{cal_args}") - self.recompute_sensor_calibration_data(cal_args) - # Compute the linear gain - db_gain = self.sensor_calibration_data["gain"] - linear_gain = 10 ** (db_gain / 20.0) - else: - linear_gain = 1 nsamps = int(num_samples) nskip = int(num_samples_skip) # Try to acquire the samples - max_retries = retries while True: # No need to skip initial samples when simulating the signal analyzer if not settings.RUNNING_TESTS and not settings.MOCK_SIGAN: @@ -322,20 +265,14 @@ def acquire_time_domain_samples( data = data[nskip:] if not len(data) == num_samples: - if retries > 0: - msg = "USRP error: requested {} samples, but got {}." - logger.warning(msg.format(num_samples + num_samples_skip, data_len)) - logger.warning("Retrying {} more times.".format(retries)) - retries = retries - 1 - else: - err = "Failed to acquire correct number of samples " - err += "{} times in a row.".format(max_retries) - raise RuntimeError(err) + msg = f"USRP error: requested {num_samples + num_samples_skip} samples, but got {data_len}." + logger.error(msg) + raise RuntimeError(msg) else: logger.debug("Successfully acquired {} samples.".format(num_samples)) # Check IQ values versus ADC max for sigan compression - self._sigan_overload = False + sigan_overload = False i_samples = np.abs(np.real(data)) q_samples = np.abs(np.imag(data)) i_over_threshold = np.sum(i_samples > self.ADC_FULL_RANGE_THRESHOLD) @@ -343,14 +280,12 @@ def acquire_time_domain_samples( total_over_threshold = i_over_threshold + q_over_threshold ratio_over_threshold = float(total_over_threshold) / num_samples if ratio_over_threshold > self.ADC_OVERLOAD_THRESHOLD: - self._sigan_overload = True + sigan_overload = True + logger.warning("Signal Analyzer overload occurred!") - # Scale the data back to RF power and return it - data /= linear_gain - self.check_sensor_overload(data, cal_adjust) measurement_result = { "data": data, - "overload": self.overload, + "overload": sigan_overload, "frequency": self.frequency, "gain": self.gain, "sample_rate": self.sample_rate, From 891b7b660656541ddf62689c62ae9f0a76845a54 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 9 Apr 2024 13:27:17 -0600 Subject: [PATCH 23/37] remove tests no longer applicable --- scos_usrp/hardware/tests/test_usrp.py | 49 --------------------------- 1 file changed, 49 deletions(-) diff --git a/scos_usrp/hardware/tests/test_usrp.py b/scos_usrp/hardware/tests/test_usrp.py index d8f2ec6..e98c72b 100644 --- a/scos_usrp/hardware/tests/test_usrp.py +++ b/scos_usrp/hardware/tests/test_usrp.py @@ -26,55 +26,6 @@ def setup_mock_usrp(self): # Alert that the setup was complete self.setup_complete = True - # Ensure the usrp can recover from acquisition errors - def test_acquire_samples_with_retries(self): - """Acquire samples should retry without error up to `max_retries`.""" - - # Check that the setup was completed - assert self.setup_complete, "Setup was not completed" - - max_retries = 5 - times_to_fail = 3 - self.rx.sample_rate = 10000000.0 - self.rx.frequency = 650000000.0 - self.rx.gain = 40.0 - self.rx.usrp.set_times_to_fail(times_to_fail) - - try: - self.rx.acquire_time_domain_samples( - 1000, retries=max_retries, cal_adjust=False - ) - except RuntimeError: - msg = "Acquisition failing {} times sequentially with {}\n" - msg += "retries requested should NOT have raised an error." - msg = msg.format(times_to_fail, max_retries) - pytest.fail(msg) - - self.rx.usrp.set_times_to_fail(0) - - def test_acquire_samples_fails_when_over_max_retries(self): - """After `max_retries`, an error should be thrown.""" - - # Check that the setup was completed - assert self.setup_complete, "Setup was not completed" - - max_retries = 5 - times_to_fail = 7 - self.rx.usrp.set_times_to_fail(times_to_fail) - self.rx.sample_rate = 10000000.0 - self.rx.frequency = 650000000.0 - self.rx.gain = 40.0 - msg = "Acquisition failing {} times sequentially with {}\n" - msg += "retries requested SHOULD have raised an error." - msg = msg.format(times_to_fail, max_retries) - with pytest.raises(RuntimeError): - self.rx.acquire_time_domain_samples( - 1000, 1000, max_retries, cal_adjust=False - ) - pytest.fail(msg) - - self.rx.usrp.set_times_to_fail(0) - def test_tune_result(self): """Check that the tuning is correct""" # Check that the setup was completed From 9c1574491b0404f965f70ea5e87ed39c07ed1fe1 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 11 Apr 2024 10:08:47 -0600 Subject: [PATCH 24/37] Update readme testing instructions --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 291caa9..da93e08 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ hatchling build ### Running Tests -Since the UHD drivers are required, a docker container is used for testing. [Install +Without the python3-uhd package installed, a docker container can be used for testing. [Install Docker](https://docs.docker.com/get-docker/). ```bash @@ -115,6 +115,14 @@ docker build -f docker/Dockerfile-test -t usrp_test . docker run usrp_test ``` +With the python3-uhd package installed (`sudo apt install python3-uhd` on Ubuntu), +pytest can be run directly when using a compatible version of Python +(3.8 on Ubuntu 20.04): + +```bash +pytest +``` + ### Committing Besides running the test suite and ensuring that all tests are passing, we also expect From a809ee0e2af6e682639cb19979a34a1cb119b622 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 11 Apr 2024 11:24:40 -0600 Subject: [PATCH 25/37] disable cal adjust on most actions except a couple for testing --- .../actions/acquire_iq_700MHz_ATT_DL_no_cal.yml | 9 +++++++++ ..._ATT_UL.yml => acquire_iq_700MHz_ATT_UL_no_cal.yml} | 4 ++-- ...DL.yml => acquire_iq_700MHz_FirstNet_DL_no_cal.yml} | 4 ++-- ...UL.yml => acquire_iq_700MHz_FirstNet_UL_no_cal.yml} | 4 ++-- ....yml => acquire_iq_700MHz_P-SafetyNB_DL_no_cal.yml} | 4 ++-- ....yml => acquire_iq_700MHz_P-SafetyNB_UL_no_cal.yml} | 4 ++-- ...DL.yml => acquire_iq_700MHz_T-Mobile_DL_no_cal.yml} | 4 ++-- ...TT_DL.yml => acquire_iq_700MHz_T-Mobile_UL_cal.yml} | 4 ++-- ...UL.yml => acquire_iq_700MHz_T-Mobile_UL_no_cal.yml} | 4 ++-- ..._DL.yml => acquire_iq_700MHz_Verizon_DL_no_cal.yml} | 4 ++-- ..._UL.yml => acquire_iq_700MHz_Verizon_UL_no_cal.yml} | 4 ++-- .../actions/acquire_m4s_700MHz_ATT_DL_no_cal.yml | 10 ++++++++++ ...ATT_UL.yml => acquire_m4s_700MHz_ATT_UL_no_cal.yml} | 4 ++-- ...L.yml => acquire_m4s_700MHz_FirstNet_DL_no_cal.yml} | 4 ++-- ...L.yml => acquire_m4s_700MHz_FirstNet_UL_no_cal.yml} | 4 ++-- ...yml => acquire_m4s_700MHz_P-SafetyNB_DL_no_cal.yml} | 4 ++-- ...yml => acquire_m4s_700MHz_P-SafetyNB_UL_no_cal.yml} | 4 ++-- ...L.yml => acquire_m4s_700MHz_T-Mobile_DL_no_cal.yml} | 4 ++-- ...T_DL.yml => acquire_m4s_700MHz_T-Mobile_UL_cal.yml} | 4 ++-- ...L.yml => acquire_m4s_700MHz_T-Mobile_UL_no_cal.yml} | 4 ++-- ...DL.yml => acquire_m4s_700MHz_Verizon_DL_no_cal.yml} | 4 ++-- ...UL.yml => acquire_m4s_700MHz_Verizon_UL_no_cal.yml} | 4 ++-- ...ml => survey_700MHz_band_10dB_1000ms_iq_no_cal.yml} | 4 ++-- ...yml => survey_700MHz_band_10dB_80ms_iq__no_cal.yml} | 4 ++-- ...ml => survey_700MHz_band_20dB_1000ms_iq_no_cal.yml} | 4 ++-- ....yml => survey_700MHz_band_20dB_80ms_iq_no_cal.yml} | 4 ++-- ...ml => survey_700MHz_band_40dB_1000ms_iq_no_cal.yml} | 4 ++-- ....yml => survey_700MHz_band_40dB_80ms_iq_no_cal.yml} | 4 ++-- ...Hz_band_iq.yml => survey_700MHz_band_iq_no_cal.yml} | 4 ++-- 29 files changed, 73 insertions(+), 54 deletions(-) create mode 100644 scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL_no_cal.yml rename scos_usrp/configs/actions/{acquire_iq_700MHz_ATT_UL.yml => acquire_iq_700MHz_ATT_UL_no_cal.yml} (69%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_FirstNet_DL.yml => acquire_iq_700MHz_FirstNet_DL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_FirstNet_UL.yml => acquire_iq_700MHz_FirstNet_UL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_P-SafetyNB_DL.yml => acquire_iq_700MHz_P-SafetyNB_DL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_P-SafetyNB_UL.yml => acquire_iq_700MHz_P-SafetyNB_UL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_T-Mobile_DL.yml => acquire_iq_700MHz_T-Mobile_DL_no_cal.yml} (68%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_ATT_DL.yml => acquire_iq_700MHz_T-Mobile_UL_cal.yml} (72%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_T-Mobile_UL.yml => acquire_iq_700MHz_T-Mobile_UL_no_cal.yml} (68%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_Verizon_DL.yml => acquire_iq_700MHz_Verizon_DL_no_cal.yml} (68%) rename scos_usrp/configs/actions/{acquire_iq_700MHz_Verizon_UL.yml => acquire_iq_700MHz_Verizon_UL_no_cal.yml} (68%) create mode 100644 scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL_no_cal.yml rename scos_usrp/configs/actions/{acquire_m4s_700MHz_ATT_UL.yml => acquire_m4s_700MHz_ATT_UL_no_cal.yml} (68%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_FirstNet_DL.yml => acquire_m4s_700MHz_FirstNet_DL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_FirstNet_UL.yml => acquire_m4s_700MHz_FirstNet_UL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_P-SafetyNB_DL.yml => acquire_m4s_700MHz_P-SafetyNB_DL_no_cal.yml} (66%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_P-SafetyNB_UL.yml => acquire_m4s_700MHz_P-SafetyNB_UL_no_cal.yml} (66%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_T-Mobile_DL.yml => acquire_m4s_700MHz_T-Mobile_DL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_ATT_DL.yml => acquire_m4s_700MHz_T-Mobile_UL_cal.yml} (72%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_T-Mobile_UL.yml => acquire_m4s_700MHz_T-Mobile_UL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_Verizon_DL.yml => acquire_m4s_700MHz_Verizon_DL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{acquire_m4s_700MHz_Verizon_UL.yml => acquire_m4s_700MHz_Verizon_UL_no_cal.yml} (67%) rename scos_usrp/configs/actions/{survey_700MHz_band_10dB_1000ms_iq.yml => survey_700MHz_band_10dB_1000ms_iq_no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_10dB_80ms_iq.yml => survey_700MHz_band_10dB_80ms_iq__no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_20dB_1000ms_iq.yml => survey_700MHz_band_20dB_1000ms_iq_no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_20dB_80ms_iq.yml => survey_700MHz_band_20dB_80ms_iq_no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_40dB_1000ms_iq.yml => survey_700MHz_band_40dB_1000ms_iq_no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_40dB_80ms_iq.yml => survey_700MHz_band_40dB_80ms_iq_no_cal.yml} (78%) rename scos_usrp/configs/actions/{survey_700MHz_band_iq.yml => survey_700MHz_band_iq_no_cal.yml} (85%) diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL_no_cal.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL_no_cal.yml new file mode 100644 index 0000000..5e62863 --- /dev/null +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL_no_cal.yml @@ -0,0 +1,9 @@ +single_frequency_time_domain_iq: + name: acquire_iq_700MHz_ATT_DL_no_cal + frequency: 739e6 + gain: 40 + sample_rate: 15.36e6 + duration_ms: 1000 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL_no_cal.yml similarity index 69% rename from scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL_no_cal.yml index 9cc112e..8a7c215 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_UL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_ATT_UL + name: acquire_iq_700MHz_ATT_UL_no_cal frequency: 709e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL_no_cal.yml index 1415c42..db34b96 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_DL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_FirstNet_DL + name: acquire_iq_700MHz_FirstNet_DL_no_cal frequency: 763e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL_no_cal.yml index d4d8a1d..99d79c2 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_FirstNet_UL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_FirstNet_UL + name: acquire_iq_700MHz_FirstNet_UL_no_cal frequency: 793e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL_no_cal.yml index a273496..d1a52ac 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_DL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_P-SafetyNB_DL + name: acquire_iq_700MHz_P-SafetyNB_DL_no_cal frequency: 772e6 gain: 40 sample_rate: 15.36e6 duration_ms: 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL_no_cal.yml index 53bce37..5a75285 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_P-SafetyNB_UL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_P-SafetyNB_UL + name: acquire_iq_700MHz_P-SafetyNB_UL_no_cal frequency: 802e6 gain: 40 sample_rate: 15.36e6 duration_ms: 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL_no_cal.yml similarity index 68% rename from scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL_no_cal.yml index ff676f1..58eadb9 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_DL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_T-Mobile_DL + name: acquire_iq_700MHz_T-Mobile_DL_no_cal frequency: 731.5e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_cal.yml similarity index 72% rename from scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_cal.yml index 516ee58..7704645 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_ATT_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_cal.yml @@ -1,6 +1,6 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_ATT_DL - frequency: 739e6 + name: acquire_iq_700MHz_T-Mobile_UL_cal + frequency: 700e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_no_cal.yml similarity index 68% rename from scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_no_cal.yml index 82d7030..eb47039 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_T-Mobile_UL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_T-Mobile_UL + name: acquire_iq_700MHz_T-Mobile_UL_no_cal frequency: 700.5e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL_no_cal.yml similarity index 68% rename from scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL_no_cal.yml index 5220cf9..1f0503d 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_DL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_Verizon_DL + name: acquire_iq_700MHz_Verizon_DL_no_cal frequency: 751e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL_no_cal.yml similarity index 68% rename from scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml rename to scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL_no_cal.yml index 1feda27..d57583c 100644 --- a/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL.yml +++ b/scos_usrp/configs/actions/acquire_iq_700MHz_Verizon_UL_no_cal.yml @@ -1,9 +1,9 @@ single_frequency_time_domain_iq: - name: acquire_iq_700MHz_Verizon_UL + name: acquire_iq_700MHz_Verizon_UL_no_cal frequency: 782e6 gain: 40 sample_rate: 15.36e6 duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL_no_cal.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL_no_cal.yml new file mode 100644 index 0000000..dd4795d --- /dev/null +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL_no_cal.yml @@ -0,0 +1,10 @@ +single_frequency_fft: + name: acquire_m4s_700MHz_ATT_DL_no_cal + frequency: 739e6 + gain: 40 + sample_rate: 15.36e6 + fft_size: 1024 + nffts: 300 + nskip: 15.36e4 + classification: UNCLASSIFIED + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL_no_cal.yml similarity index 68% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL_no_cal.yml index add2b26..8bfe397 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_UL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_ATT_UL + name: acquire_m4s_700MHz_ATT_UL_no_cal frequency: 709e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL_no_cal.yml index 68eae93..6ed5dca 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_DL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_FirstNet_DL + name: acquire_m4s_700MHz_FirstNet_DL_no_cal frequency: 763e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL_no_cal.yml index 31aed18..1f3fa13 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_FirstNet_UL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_FirstNet_UL + name: acquire_m4s_700MHz_FirstNet_UL_no_cal frequency: 793e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL_no_cal.yml similarity index 66% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL_no_cal.yml index cf5d669..4dbbf88 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_DL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_P-SafetyNB_DL + name: acquire_m4s_700MHz_P-SafetyNB_DL_no_cal frequency: 772e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL_no_cal.yml similarity index 66% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL_no_cal.yml index 644f0e5..250a601 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_P-SafetyNB_UL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_P-SafetyNB_UL + name: acquire_m4s_700MHz_P-SafetyNB_UL_no_cal frequency: 802e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL_no_cal.yml index 1f9169f..5b0dde6 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_DL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_T-Mobile_DL + name: acquire_m4s_700MHz_T-Mobile_DL_no_cal frequency: 731.5e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_cal.yml similarity index 72% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_cal.yml index 5a62ed6..2bc9d78 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_ATT_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_cal.yml @@ -1,6 +1,6 @@ single_frequency_fft: - name: acquire_m4s_700MHz_ATT_DL - frequency: 739e6 + name: acquire_m4s_700MHz_T-Mobile_UL_cal + frequency: 700e6 gain: 40 sample_rate: 15.36e6 fft_size: 1024 diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_no_cal.yml index fae5647..0b61406 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_T-Mobile_UL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_T-Mobile_UL + name: acquire_m4s_700MHz_T-Mobile_UL_no_cal frequency: 700.5e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL_no_cal.yml index 781f09f..c45ff96 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_DL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_Verizon_DL + name: acquire_m4s_700MHz_Verizon_DL_no_cal frequency: 751e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL_no_cal.yml similarity index 67% rename from scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml rename to scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL_no_cal.yml index bf10825..8d962bd 100644 --- a/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL.yml +++ b/scos_usrp/configs/actions/acquire_m4s_700MHz_Verizon_UL_no_cal.yml @@ -1,5 +1,5 @@ single_frequency_fft: - name: acquire_m4s_700MHz_Verizon_UL + name: acquire_m4s_700MHz_Verizon_UL_no_cal frequency: 782e6 gain: 40 sample_rate: 15.36e6 @@ -7,4 +7,4 @@ single_frequency_fft: nffts: 300 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq_no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq_no_cal.yml index 6361dce..352f304 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_10dB_1000ms_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_10dB_1000ms_iq + name: survey_700MHz_band_10dB_1000ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq__no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq__no_cal.yml index ece5252..7a2e5d5 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_10dB_80ms_iq__no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_10dB_80ms_iq + name: survey_700MHz_band_10dB_80ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq_no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq_no_cal.yml index dbcbd10..3c4d69e 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_20dB_1000ms_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_20dB_1000ms_iq + name: survey_700MHz_band_20dB_1000ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq_no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq_no_cal.yml index e5d77ca..afed372 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_20dB_80ms_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_20dB_80ms_iq + name: survey_700MHz_band_20dB_80ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq_no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq_no_cal.yml index 2ba10bb..f24fafd 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_40dB_1000ms_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_40dB_1000ms_iq + name: survey_700MHz_band_40dB_1000ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 1000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq_no_cal.yml similarity index 78% rename from scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq_no_cal.yml index 3ed44d4..7452f1a 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_40dB_80ms_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_40dB_80ms_iq + name: survey_700MHz_band_40dB_80ms_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -16,4 +16,4 @@ stepped_frequency_time_domain_iq: duration_ms: 80 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False diff --git a/scos_usrp/configs/actions/survey_700MHz_band_iq.yml b/scos_usrp/configs/actions/survey_700MHz_band_iq_no_cal.yml similarity index 85% rename from scos_usrp/configs/actions/survey_700MHz_band_iq.yml rename to scos_usrp/configs/actions/survey_700MHz_band_iq_no_cal.yml index c7e11b4..efde454 100644 --- a/scos_usrp/configs/actions/survey_700MHz_band_iq.yml +++ b/scos_usrp/configs/actions/survey_700MHz_band_iq_no_cal.yml @@ -1,5 +1,5 @@ stepped_frequency_time_domain_iq: - name: survey_700MHz_band_iq + name: survey_700MHz_band_iq_no_cal frequency: - 700.5e6 - 709e6 @@ -26,4 +26,4 @@ stepped_frequency_time_domain_iq: - 10000 nskip: 15.36e4 classification: UNCLASSIFIED - calibration_adjust: True + calibration_adjust: False From ddc6cd5c80cc7034785e494cc034758aeef0acf1 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Thu, 11 Apr 2024 13:37:13 -0600 Subject: [PATCH 26/37] Change gain check behavior --- scos_usrp/hardware/usrp_sigan.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 1d9853a..b34be8e 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -204,10 +204,9 @@ def gain(self, gain): :param gain: Gain in dB """ if gain not in VALID_GAINS: - err = "Requested invalid gain {}. ".format(gain) - err += "Choose one of {!r}.".format(VALID_GAINS) - logger.error(err) - return + msg = "Requested invalid gain {}. ".format(gain) + msg += "It is recommended to choose one of {!r}.".format(VALID_GAINS) + logger.warning(msg) self.requested_gain = gain self.usrp.set_rx_gain(gain) msg = "set USRP gain: {:.1f} dB" From d495ff0b8b6e79b9017800219f6698dd27a3fdeb Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Fri, 26 Apr 2024 12:17:43 -0600 Subject: [PATCH 27/37] change scos-actions branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d43bb0a..437b043 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@SEA-178_test_actions_loading", + "scos_actions @ git+https://github.com/NTIA/scos-actions@revert-117-revert-110-SEA-178_test_actions_loading", ] [project.optional-dependencies] From 710c3114bcab1bbcb006eb171010f73ff8a82c3e Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 29 Apr 2024 08:48:58 -0600 Subject: [PATCH 28/37] Change scos-actions version to 10.0.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 437b043..6180428 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@revert-117-revert-110-SEA-178_test_actions_loading", + "scos_actions @ git+https://github.com/NTIA/scos-actions@10.0.0", ] [project.optional-dependencies] From dd83ec429f2b1d1d406763b418b03b11b93b7697 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 29 Apr 2024 08:57:26 -0600 Subject: [PATCH 29/37] Change scos-usrp version to 5.0.0 --- scos_usrp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scos_usrp/__init__.py b/scos_usrp/__init__.py index ce1305b..ba7be38 100644 --- a/scos_usrp/__init__.py +++ b/scos_usrp/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0" +__version__ = "5.0.0" From f8326ca43baccd69849ed886e0af864be3bbb849 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 29 Apr 2024 09:12:48 -0600 Subject: [PATCH 30/37] README lint, only set default SIGAN_MODULE and SIGAN_CLASS when running tests --- README.md | 4 ++-- scos_usrp/settings.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index da93e08..c444e22 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ hatchling build ### Running Tests -Without the python3-uhd package installed, a docker container can be used for testing. [Install -Docker](https://docs.docker.com/get-docker/). +Without the python3-uhd package installed, a docker container can be used for +testing. [Install Docker](https://docs.docker.com/get-docker/). ```bash docker build -f docker/Dockerfile-test -t usrp_test . diff --git a/scos_usrp/settings.py b/scos_usrp/settings.py index c5959c7..06651b4 100644 --- a/scos_usrp/settings.py +++ b/scos_usrp/settings.py @@ -4,6 +4,7 @@ from environs import Env +logger = logging.getLogger(__name__) env = Env() CONFIG_DIR = Path(__file__).parent.resolve() / "configs" @@ -14,6 +15,11 @@ MOCK_SIGAN_RANDOM = env.bool("MOCK_SIGAN_RANDOM", default=False) if RUNNING_TESTS: logging.basicConfig(level=logging.DEBUG) -SIGAN_MODULE = env.str("SIGAN_MODULE", default="scos_usrp.hardware.usrp_sigan") -SIGAN_CLASS = env.str("SIGAN_CLASS", default="USRPSignalAnalyzer") +SIGAN_MODULE = env.str("SIGAN_MODULE", default=None) +SIGAN_CLASS = env.str("SIGAN_CLASS", default=None) +if RUNNING_TESTS: + SIGAN_MODULE = "scos_usrp.hardware.usrp_sigan" + SIGAN_CLASS = "USRPSignalAnalyzer" +logger.debug(f"scos-usrp: SIGAN_MODULE:{SIGAN_MODULE}") +logger.debug(f"scos-usrp: SIGAN_CLASS:{SIGAN_CLASS}") USRP_CONNECTION_ARGS = env("USRP_CONNECTION_ARGS", default="num_recv_frames=650") From 27816fb49c71e4c278ae730da09c922e4dd0d536 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 29 Apr 2024 12:50:34 -0600 Subject: [PATCH 31/37] change scos-actions version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6180428..fa73b87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@10.0.0", + "scos_actions @ git+https://github.com/NTIA/scos-actions@fix_test_cbrs_measure", ] [project.optional-dependencies] From 94db391e72d9a27be669fd1260c7b7324818bcda Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 30 Apr 2024 14:48:17 -0600 Subject: [PATCH 32/37] update scos-actions version to 10.0.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fa73b87..dfbdfdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@fix_test_cbrs_measure", + "scos_actions @ git+https://github.com/NTIA/scos-actions@10.0.1", ] [project.optional-dependencies] From f9629f16dd530844607660eaf5237a5bf734dfa0 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 6 May 2024 09:33:56 -0600 Subject: [PATCH 33/37] set clock rate before sample rate, raise exceptions --- scos_usrp/hardware/usrp_sigan.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index b34be8e..613b89b 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -127,16 +127,22 @@ def sample_rate(self, rate): :type sample_rate: float :param sample_rate: Sample rate in samples per second """ - self.requested_sample_rate = rate - self.usrp.set_rx_rate(rate) - fs_MSps = self.sample_rate / 1e6 - logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) - clock_rate = self.sample_rate + clock_rate = rate # Maximize clock rate while keeping it under 40e6 while clock_rate <= 40e6: clock_rate *= 2 clock_rate /= 2 self.clock_rate = clock_rate + logger.debug(f"Clock rate set to {self.clock_rate}") + if self.clock_rate != clock_rate: + raise Exception(f"Clock rate {self.clock_rate} does not match requested rate {clock_rate}!") + self.requested_sample_rate = rate + self.usrp.set_rx_rate(rate) + fs_MSps = self.sample_rate / 1e6 + logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) + if self.sample_rate != self.requested_sample_rate: + raise Exception(f"Sample rate {self.sample_rate} does not match requested rate {self.requested_sample_rate}!") + @property def clock_rate(self): From 1077fd28fbc019c20f4e141a36bbc1520b1333a2 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 6 May 2024 10:19:00 -0600 Subject: [PATCH 34/37] autoformat, change scos-actions branch --- pyproject.toml | 2 +- scos_usrp/hardware/usrp_sigan.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dfbdfdb..72c1de1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@10.0.1", + "scos_actions @ git+https://github.com/NTIA/scos-actions@fix_calc_num_samples", ] [project.optional-dependencies] diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index 613b89b..b75bd53 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -135,14 +135,17 @@ def sample_rate(self, rate): self.clock_rate = clock_rate logger.debug(f"Clock rate set to {self.clock_rate}") if self.clock_rate != clock_rate: - raise Exception(f"Clock rate {self.clock_rate} does not match requested rate {clock_rate}!") + raise Exception( + f"Clock rate {self.clock_rate} does not match requested rate {clock_rate}!" + ) self.requested_sample_rate = rate self.usrp.set_rx_rate(rate) fs_MSps = self.sample_rate / 1e6 logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) if self.sample_rate != self.requested_sample_rate: - raise Exception(f"Sample rate {self.sample_rate} does not match requested rate {self.requested_sample_rate}!") - + raise Exception( + f"Sample rate {self.sample_rate} does not match requested rate {self.requested_sample_rate}!" + ) @property def clock_rate(self): From 8c52a8ee6c23459c91e91298603fc810319e4d07 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Mon, 6 May 2024 11:04:44 -0600 Subject: [PATCH 35/37] round for sample rate and clock rate check --- scos_usrp/hardware/usrp_sigan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index b75bd53..c5e39d7 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -134,7 +134,7 @@ def sample_rate(self, rate): clock_rate /= 2 self.clock_rate = clock_rate logger.debug(f"Clock rate set to {self.clock_rate}") - if self.clock_rate != clock_rate: + if round(self.clock_rate, 1) != round(clock_rate, 1): raise Exception( f"Clock rate {self.clock_rate} does not match requested rate {clock_rate}!" ) @@ -142,7 +142,7 @@ def sample_rate(self, rate): self.usrp.set_rx_rate(rate) fs_MSps = self.sample_rate / 1e6 logger.debug("set USRP sample rate: {:.2f} MSps".format(fs_MSps)) - if self.sample_rate != self.requested_sample_rate: + if round(self.sample_rate, 1) != round(self.requested_sample_rate, 1): raise Exception( f"Sample rate {self.sample_rate} does not match requested rate {self.requested_sample_rate}!" ) From ab1127a4af7bf22cbb800f491ad3a79e25be66f2 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 7 May 2024 10:27:47 -0600 Subject: [PATCH 36/37] remove unneeded log message --- scos_usrp/hardware/usrp_sigan.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scos_usrp/hardware/usrp_sigan.py b/scos_usrp/hardware/usrp_sigan.py index c5e39d7..3a1b13e 100644 --- a/scos_usrp/hardware/usrp_sigan.py +++ b/scos_usrp/hardware/usrp_sigan.py @@ -133,7 +133,6 @@ def sample_rate(self, rate): clock_rate *= 2 clock_rate /= 2 self.clock_rate = clock_rate - logger.debug(f"Clock rate set to {self.clock_rate}") if round(self.clock_rate, 1) != round(clock_rate, 1): raise Exception( f"Clock rate {self.clock_rate} does not match requested rate {clock_rate}!" From d23d3a670a77ae4aa0f7b3ec95e8fc6dde0f0a08 Mon Sep 17 00:00:00 2001 From: Justin Haze Date: Tue, 7 May 2024 13:18:13 -0600 Subject: [PATCH 37/37] change scos-actions version back to 10.0.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 72c1de1..dfbdfdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ dependencies = [ "django>=3.2.15,<4.0", "environs>=9.0, <10.0", "numpy>=1.22.0", - "scos_actions @ git+https://github.com/NTIA/scos-actions@fix_calc_num_samples", + "scos_actions @ git+https://github.com/NTIA/scos-actions@10.0.1", ] [project.optional-dependencies]