Skip to content

Commit

Permalink
Merge pull request #56 from NTIA/SEA-178_test_actions_loading
Browse files Browse the repository at this point in the history
Sea 178 test actions loading
  • Loading branch information
dboulware authored May 6, 2024
2 parents 53982ec + fe07f3d commit cc1eb09
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/scos_tekrsa/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = "6.0.1"
__version__ = "7.0.0"

42 changes: 42 additions & 0 deletions src/scos_tekrsa/configs/test/test_SEA_CBRS_Measure_Baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
nasctn_sea_data_product:
name: test_SEA_CBRS_Measure_Baseline
rf_path: antenna
# 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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions src/scos_tekrsa/configs/test/test_single_frequency_m4s_action.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions src/scos_tekrsa/configs/test/test_survey_iq_action.yml
Original file line number Diff line number Diff line change
@@ -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
35 changes: 27 additions & 8 deletions src/scos_tekrsa/discover/__init__.py
Original file line number Diff line number Diff line change
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 @@ -28,10 +29,28 @@
)
ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions-500-600"
logger.debug(f"Action configs directory: {ACTION_DEFINITIONS_DIR}")
actions["monitor_tekrsa"] = MonitorSignalAnalyzer(parameters={"name": "monitor_tekrsa"})
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)
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":
actions["monitor_tekrsa"] = MonitorSignalAnalyzer(
parameters={"name": "monitor_tekrsa"}
)
logger.debug("Created Monitor SIGAN action")
# SDR specific yaml files
logger.debug("Initializing yaml actions")
yaml_actions, _ = init(yaml_dir=ACTION_DEFINITIONS_DIR)
logger.debug(f"Created {len(yaml_actions)} actions")
actions.update(yaml_actions)
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)}")
7 changes: 7 additions & 0 deletions src/scos_tekrsa/hardware/tekrsa_sigan.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from scos_actions.hardware.sigan_iface import SignalAnalyzerInterface

import scos_tekrsa.hardware.tekrsa_constants as rsa_constants
from scos_tekrsa import __package__ as SCOS_TEKRSA_NAME
from scos_tekrsa import __version__ as SCOS_TEKRSA_VERSION
from scos_tekrsa import settings
from scos_tekrsa.hardware.mocks.rsa_block import MockRSA
Expand All @@ -26,6 +27,7 @@ def __init__(
super().__init__(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 @@ -120,6 +122,11 @@ 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:
"""Returns the current firmware version of the connected RSA device."""
Expand Down
8 changes: 8 additions & 0 deletions src/scos_tekrsa/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from environs import Env
from scos_actions.settings import *

logger = logging.getLogger(__name__)
env = Env()

CONFIG_DIR = Path(__file__).parent.resolve() / "configs"
Expand All @@ -18,3 +19,10 @@
RUNNING_MIGRATIONS = env.bool("RUNNING_MIGRATIONS", default=False)
if RUNNING_TESTS:
logging.basicConfig(level=logging.DEBUG)
SIGAN_MODULE = env.str("SIGAN_MODULE", default=None)
SIGAN_CLASS = env.str("SIGAN_CLASS", default=None)
if RUNNING_TESTS:
SIGAN_MODULE = "scos_tekrsa.hardware.tekrsa_sigan"
SIGAN_CLASS = "TekRSASigan"
logger.debug(f"scos-tekrsa: SIGAN_MODULE:{SIGAN_MODULE}")
logger.debug(f"scos-tekrsa: SIGAN_CLASS:{SIGAN_CLASS}")

0 comments on commit cc1eb09

Please sign in to comment.