Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sea 178 test actions loading #56

Merged
merged 30 commits into from May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8d4a6c1
load test actions if using tekrsa sigan, add test action configs, cha…
jhazentia Feb 5, 2024
fdec377
add debug logging
jhazentia Feb 5, 2024
51d2a91
fix action config
jhazentia Feb 5, 2024
d3b6eda
fix cal_params bug when testing
jhazentia Feb 6, 2024
ab20d23
add log debug messages
jhazentia Feb 6, 2024
b8eb3ed
fix bug when testing
jhazentia Feb 6, 2024
fd66a07
fix bug when testing
jhazentia Feb 6, 2024
ed8ee81
disable cal adjust in test data product
jhazentia Feb 6, 2024
73d2e97
add debug log messages
jhazentia Feb 9, 2024
c959774
adjust test survey action params
jhazentia Feb 12, 2024
e59edd8
test survey with different params
jhazentia Feb 12, 2024
08b6488
Merge branch 'main' of https://github.com/NTIA/scos-tekrsa into SEA-1…
jhazentia Feb 20, 2024
a38c885
add cal adjust to measure baseline, add test monitor action, remove d…
jhazentia Feb 20, 2024
c2210c8
remove 56 msps survey, keep 14 msps survey
jhazentia Feb 20, 2024
1489e22
remove debug message
jhazentia Feb 20, 2024
57ebd7a
fix survey action name
jhazentia Feb 27, 2024
5fc96ae
add test to monitor action name in test actions
jhazentia Feb 28, 2024
8c1d680
autoformat code
jhazentia Feb 28, 2024
f9171ae
add plugin_name property to tekrsa_sigan
jhazentia Mar 11, 2024
ce5a5c8
only load actions if sigan set to tekrsa sigan
jhazentia Mar 15, 2024
6bef0b5
Merge branch 'main' of https://github.com/NTIA/scos-tekrsa into SEA-1…
jhazentia Mar 15, 2024
84d2972
Merge branch 'main' of https://github.com/NTIA/scos-tekrsa into SEA-1…
jhazentia Apr 4, 2024
b32eb3b
autoformat
jhazentia Apr 4, 2024
87f81d4
update scos-actions version to release tag
jhazentia Apr 26, 2024
88cde1f
change scos-actions branch
jhazentia Apr 26, 2024
e90f757
Change scos-actions version to 10.0.0
jhazentia Apr 29, 2024
62565d7
Change scos-actions branch, Only set SIGAN_MODULE and SIGAN_CLASS whe…
jhazentia Apr 29, 2024
caca013
Update scos-actions version to 10.0.1
jhazentia Apr 30, 2024
186dfaa
Update version to 7.0.0
jhazentia Apr 30, 2024
fe07f3d
Merge branch 'main' into SEA-178_test_actions_loading
dboulware May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -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@8.0.0",
"scos_actions @ git+https://github.com/NTIA/scos-actions@SEA-178_test_actions_loading",
]

[project.optional-dependencies]
Expand Down
Expand Up @@ -43,3 +43,4 @@ nasctn_sea_data_product:
- 3685e6
- 3695e6
- 3705e6
calibration_adjust: True
43 changes: 43 additions & 0 deletions src/scos_tekrsa/configs/test/test_SEA_CBRS_Measure_Baseline.yml
@@ -0,0 +1,43 @@
nasctn_sea_data_product:
name: test_SEA_CBRS_Measure_Baseline
rf_path: antenna
calibration_adjust: False
# IIR filter settings
iir_gpass_dB: 0.1 # Max passband ripple below unity gain
iir_gstop_dB: 40 # Minimum stopband attenuation
iir_pb_edge_Hz: 5e6 # Passband edge frequency
iir_sb_edge_Hz: 5.008e6 # Stopband edge frequency
# FFT settings
nffts: 320e3
# PFP frame
pfp_frame_period_ms: 10
# APD downsampling settings
apd_bin_size_dB: 1.0 # Set to 0 or negative for no downsampling
apd_max_bin_dBm: -30
apd_min_bin_dBm: -180
# Time domain power statistics settings
td_bin_size_ms: 10
# Sigan Settings
preamp_enable: True
reference_level: -25
attenuation: 0
sample_rate: 14e6
# Acquisition settings (3550-3700 MHz in 10 MHz steps, each 4s long)
duration_ms: 4000
nskip: 0
frequency:
- 3555e6
- 3565e6
- 3575e6
- 3585e6
- 3595e6
- 3605e6
- 3615e6
- 3625e6
- 3635e6
- 3645e6
- 3655e6
- 3665e6
- 3675e6
- 3685e6
- 3695e6
19 changes: 19 additions & 0 deletions src/scos_tekrsa/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
reference_level: -10
sample_rate: 56e6
duration_ms: 80
nskip: 0
classification: UNCLASSIFIED
calibration_adjust: False
@@ -0,0 +1,9 @@
single_frequency_time_domain_iq:
name: test_single_frequency_iq_action
frequency: 739e6
reference_level: -10
sample_rate: 56e6
duration_ms: 714
nskip: 0
classification: UNCLASSIFIED
calibration_adjust: False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you add an rf_path: antenna parameter it will allow this action to work on sensors that have a configurable preselector and sensors that have no preselector. Currently, it errors when the sensor has a configurable preselector.

10 changes: 10 additions & 0 deletions src/scos_tekrsa/configs/test/test_single_frequency_m4s_action.yml
@@ -0,0 +1,10 @@
single_frequency_fft:
name: test_single_frequency_m4s_action
frequency: 739e6
reference_level: -10
sample_rate: 56e6
fft_size: 2048
nffts: 300
nskip: 0
classification: UNCLASSIFIED
calibration_adjust: False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add rf_path param as in IQ action comment.

29 changes: 29 additions & 0 deletions src/scos_tekrsa/configs/test/test_survey_iq_action.yml
@@ -0,0 +1,29 @@
stepped_frequency_time_domain_iq:
name: test_survey_iq_action
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add rf_path param. See single action IQ yml comment.

20 changes: 18 additions & 2 deletions src/scos_tekrsa/discover/__init__.py
Expand Up @@ -3,11 +3,12 @@
from scos_actions.actions.monitor_sigan import MonitorSignalAnalyzer
from scos_actions.discover import init

from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL
from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL, SIGAN_CLASS, SIGAN_MODULE

logger = logging.getLogger(__name__)

actions = {}
test_actions = {}
logger.debug("scos-tekrsa: discovering actions")
# Adjust ACTION_DEFINITIONS_DIR for specific Tektronix analyzer in use
logger.debug(f"Device Model: {DEVICE_MODEL}")
Expand All @@ -32,6 +33,21 @@
logger.debug("Created Monitor SIGAN action")
# Pass new radio to existing action classes with new SDR specific yaml files
logger.debug("Initializing yaml actions")
yaml_actions, yaml_test_actions = init(yaml_dir=ACTION_DEFINITIONS_DIR)
yaml_actions, _ = init(yaml_dir=ACTION_DEFINITIONS_DIR)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a similar check as done below to only load these actions if the SIGAN_MODULE and SIGAN_CLASS are tekrsa.

logger.debug(f"Created {len(yaml_actions)} actions")
actions.update(yaml_actions)
logger.debug(f"scos-tekrsa: SIGAN_MODULE = {SIGAN_MODULE}")
logger.debug(f"scos-tekrsa: SIGAN_CLASS = {SIGAN_CLASS}")
if SIGAN_MODULE == "scos_tekrsa.hardware.tekrsa_sigan" and SIGAN_CLASS == "TekRSASigan":
logger.debug("scos-tekrsa: loading test action configs")
test_actions["test_monitor_tekrsa"] = MonitorSignalAnalyzer(
parameters={"name": "monitor_tekrsa"}
)
TEST_ACTION_DEFINITIONS_DIR = CONFIG_DIR / "test"
logger.debug(
f"scos-tekrsa: TEST_ACTION_DEFINITIONS_DIR = {TEST_ACTION_DEFINITIONS_DIR}"
)
_, yaml_test_actions = init(yaml_dir=TEST_ACTION_DEFINITIONS_DIR)
logger.debug(f"scos-tekrsa: Found {len(yaml_test_actions)} test action configs")
test_actions.update(yaml_test_actions)
logger.debug(f"scos-tekrsa: len(test_actions) = {len(test_actions)}")
10 changes: 8 additions & 2 deletions src/scos_tekrsa/hardware/tekrsa_sigan.py
Expand Up @@ -9,6 +9,7 @@

import scos_tekrsa.hardware.tekrsa_constants as rsa_constants
from scos_tekrsa import __version__ as SCOS_TEKRSA_VERSION
from scos_tekrsa import __package__ as SCOS_TEKRSA_NAME
from scos_tekrsa import settings
from scos_tekrsa.hardware.mocks.rsa_block import MockRSA

Expand All @@ -28,6 +29,7 @@ def __init__(
super().__init__(sensor_cal, sigan_cal, switches)
logger.debug("Initializing Tektronix RSA Signal Analyzer")
self._plugin_version = SCOS_TEKRSA_VERSION
self._plugin_name = SCOS_TEKRSA_NAME

self.rsa = None
self._is_available = False # should not be set outside of connect method
Expand Down Expand Up @@ -119,6 +121,11 @@ def is_available(self) -> bool:
def plugin_version(self) -> str:
"""Returns the current version of scos-tekrsa."""
return self._plugin_version

@property
def plugin_name(self) -> str:
"""Returns the current package name of scos-tekrsa."""
return self._plugin_name

@property
def firmware_version(self) -> str:
Expand Down Expand Up @@ -296,7 +303,7 @@ def acquire_time_domain_samples(
cal_params = self.sensor_calibration.calibration_parameters
else:
# Make it work for mock sigan/testing. Just match frequency.
cal_params = [vars(self)["_frequency"]]
cal_params = ["frequency"]
try:
cal_args = [vars(self)[f"_{p}"] for p in cal_params]
except KeyError:
Expand Down Expand Up @@ -375,7 +382,6 @@ def acquire_time_domain_samples(
# Scale data to RF power and return
logger.debug(f"Applying gain of {linear_gain}")
data /= linear_gain

measurement_result = {
"data": data,
"overload": self.overload,
Expand Down
2 changes: 2 additions & 0 deletions src/scos_tekrsa/settings.py
Expand Up @@ -18,3 +18,5 @@
RUNNING_MIGRATIONS = env.bool("RUNNING_MIGRATIONS", default=False)
if RUNNING_TESTS:
logging.basicConfig(level=logging.DEBUG)
SIGAN_MODULE = env.str("SIGAN_MODULE", default="scos_tekrsa.hardware.tekrsa_sigan")
SIGAN_CLASS = env.str("SIGAN_CLASS", default="TekRSASigan")