From b6786b65fcf3dd2e40fa48dc3caf646d3c6fe41e Mon Sep 17 00:00:00 2001 From: Anthony Romaniello <66272872+aromanielloNTIA@users.noreply.github.com> Date: Thu, 22 Jun 2023 14:28:00 -0600 Subject: [PATCH] Update to SCOS Actions 6.3.0 (#44) * switch scos-actions branch * Add temporary configs for metadata testing * change example IQ/M4S action names to exclude "test" * add rf_path to example action configs * update calibration key names * update to tagged scos-actions * remove temporary action configs these were used for testing but aren't needed * bump version to 3.1.0 --- pyproject.toml | 2 +- src/scos_tekrsa/__init__.py | 2 +- .../configs/sensor_calibration_example.json | 206 ++++++++---------- .../configs/sigan_calibration_example.json | 50 ++--- src/scos_tekrsa/hardware/tekrsa_sigan.py | 2 +- tests/test_calibration.py | 6 +- 6 files changed, 117 insertions(+), 151 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 60bd5619..af6f07b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ classifiers = [ dependencies = [ "environs>=9.5.0", "tekrsa-api-wrap>=1.3.2", - "scos_actions @ git+https://github.com/NTIA/scos-actions@6.2.4", + "scos_actions @ git+https://github.com/NTIA/scos-actions@6.3.0", ] [project.optional-dependencies] diff --git a/src/scos_tekrsa/__init__.py b/src/scos_tekrsa/__init__.py index 6ed01825..f5f41e56 100644 --- a/src/scos_tekrsa/__init__.py +++ b/src/scos_tekrsa/__init__.py @@ -1 +1 @@ -__version__ = "3.0.6" +__version__ = "3.1.0" diff --git a/src/scos_tekrsa/configs/sensor_calibration_example.json b/src/scos_tekrsa/configs/sensor_calibration_example.json index 93cb44fb..8a01b1d4 100644 --- a/src/scos_tekrsa/configs/sensor_calibration_example.json +++ b/src/scos_tekrsa/configs/sensor_calibration_example.json @@ -6,20 +6,18 @@ "preamp_enable", "attenuation" ], - "last_calibration_datetime": "2020-11-18T23:13:09.156274Z", + "last_calibration_datetime": "1970-01-01T00:00:00.000000Z", "calibration_data": { "14000000.0":{ "3545000000": { "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -29,13 +27,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -45,13 +41,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -61,13 +55,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -77,13 +69,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -93,13 +83,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -109,13 +97,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -125,13 +111,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -141,13 +125,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -157,13 +139,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -173,13 +153,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -189,13 +167,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -205,13 +181,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -221,13 +195,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -237,13 +209,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -253,13 +223,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } @@ -269,13 +237,11 @@ "-25":{ "true": { "0": { - "noise_figure_sensor": 5.0, - "enbw_sensor": 15723428.858731967, - "gain_sensor": 30.0, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "1db_compression_sensor": -12.0, - "datetime": "2020-11-18T23:13:09.156274Z", + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, "temperature": 20.0 } } diff --git a/src/scos_tekrsa/configs/sigan_calibration_example.json b/src/scos_tekrsa/configs/sigan_calibration_example.json index 5c1e5326..9d017ba0 100644 --- a/src/scos_tekrsa/configs/sigan_calibration_example.json +++ b/src/scos_tekrsa/configs/sigan_calibration_example.json @@ -6,27 +6,27 @@ "preamp_enable", "attenuation" ], - "last_calibration_datetime": "2020-11-18T23:13:09.156274Z", + "last_calibration_datetime": "1970-01-01T00:00:00.000000Z", "calibration_data": { "14000000.0":{ "3555000000":{ "-25":{ "true": { "0": { - "noise_figure_sigan": 46.03993010994134, - "enbw_sigan": 15723428.858731967, - "gain_sigan": 0.40803345928877379, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "datetime": "2020-11-18T23:13:09.156274Z" + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, + "temperature": 20.0 }, "5": { - "noise_figure_sigan": 46.03993010994134, - "enbw_sigan": 15723428.858731967, - "gain_sigan": 0.40803345928877379, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "datetime": "2020-11-18T23:13:09.156274Z" + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, + "temperature": 20.0 } } } @@ -35,20 +35,20 @@ "-25":{ "true": { "0": { - "noise_figure_sigan": 46.03993010994134, - "enbw_sigan": 15723428.858731967, - "gain_sigan": 0.40803345928877379, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "datetime": "2020-11-18T23:13:09.156274Z" + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, + "temperature": 20.0 }, "5": { - "noise_figure_sigan": 46.03993010994134, - "enbw_sigan": 15723428.858731967, - "gain_sigan": 0.40803345928877379, - "gain_preselector": 0, - "noise_figure_preselector": 0, - "datetime": "2020-11-18T23:13:09.156274Z" + "datetime": "1970-01-01T00:00:00.000000Z", + "gain": 30.0, + "noise_figure": 5.0, + "1db_compression_point": -12.0, + "enbw": 15723428.858731967, + "temperature": 20.0 } } } diff --git a/src/scos_tekrsa/hardware/tekrsa_sigan.py b/src/scos_tekrsa/hardware/tekrsa_sigan.py index 348569cd..3225d396 100644 --- a/src/scos_tekrsa/hardware/tekrsa_sigan.py +++ b/src/scos_tekrsa/hardware/tekrsa_sigan.py @@ -281,7 +281,7 @@ def acquire_time_domain_samples( logger.debug(f"Matched calibration params: {cal_args}") self.recompute_sensor_calibration_data(cal_args) # Compute the linear gain - db_gain = self.sensor_calibration_data["gain_sensor"] + db_gain = self.sensor_calibration_data["gain"] linear_gain = 10.0 ** (db_gain / 20.0) else: linear_gain = 1 diff --git a/tests/test_calibration.py b/tests/test_calibration.py index 86739e88..677e32aa 100644 --- a/tests/test_calibration.py +++ b/tests/test_calibration.py @@ -16,8 +16,8 @@ def test_sigan_calibration(self): assert ( sigan_calibration.calibration_data["14000000.0"]["3555000000"]["-25"][ "true" - ]["0"]["noise_figure_sigan"] - == 46.03993010994134 + ]["0"]["noise_figure"] + == 5.0 ) def test_sensor_calibration(self): @@ -28,7 +28,7 @@ def test_sensor_calibration(self): assert ( sensor_calibration.calibration_data["14000000.0"]["3555000000"]["-25"][ "true" - ]["0"]["noise_figure_sensor"] + ]["0"]["noise_figure"] == 5.0 ) assert isinstance(sensor_calibration.calibration_data, dict)