diff --git a/scos_actions/actions/acquire_sea_data_product.py b/scos_actions/actions/acquire_sea_data_product.py index 17adb08c..347b078f 100644 --- a/scos_actions/actions/acquire_sea_data_product.py +++ b/scos_actions/actions/acquire_sea_data_product.py @@ -121,7 +121,9 @@ # Create power detectors TD_DETECTOR = create_statistical_detector("TdMeanMaxDetector", ["max", "mean"]) -FFT_M3_DETECTOR = create_statistical_detector("FftM3Detector", ["max", "mean", "median"]) +FFT_M3_DETECTOR = create_statistical_detector( + "FftM3Detector", ["max", "mean", "median"] +) PFP_M3_DETECTOR = create_statistical_detector("PfpM3Detector", ["min", "max", "mean"]) @@ -158,7 +160,7 @@ def __init__( # Compute the amplitude shift for PSD scaling. The FFT result # is in pseudo-power log units and must be scaled to a PSD. self.fft_scale_factor = ( - - 10.0 * np.log10(impedance_ohms) # Pseudo-power to power + -10.0 * np.log10(impedance_ohms) # Pseudo-power to power + 27.0 # Watts to dBm (+30) and baseband to RF (-3) - 10.0 * np.log10(sample_rate_Hz * fft_size) # PSD scaling + 20.0 * np.log10(window_ecf) # Window energy correction @@ -178,7 +180,9 @@ def run(self, iq: ray.ObjectRef) -> np.ndarray: ) # Power in Watts fft_amplitudes = calculate_pseudo_power(fft_amplitudes) - fft_result = apply_statistical_detector(fft_amplitudes, self.detector) # (max, mean, median) + fft_result = apply_statistical_detector( + fft_amplitudes, self.detector + ) # (max, mean, median) percentile_result = np.percentile(fft_amplitudes, self.percentiles, axis=0) fft_result = np.vstack((fft_result, percentile_result)) fft_result = np.fft.fftshift(fft_result, axes=(1,)) # Shift frequencies @@ -1001,7 +1005,8 @@ def create_global_data_product_metadata(self) -> None: name="Power Spectral Density", series=[d.value for d in FFT_M3_DETECTOR] + [ - f"{int(p)}th_percentile" if p.is_integer() else f"{p}th_percentile" for p in FFT_PERCENTILES + f"{int(p)}th_percentile" if p.is_integer() else f"{p}th_percentile" + for p in FFT_PERCENTILES ], # ["max", "mean", "median", "25th_percentile", "75th_percentile", ... "99.99th_percentile"] length=int(FFT_SIZE * (5 / 7)), x_units="Hz", diff --git a/scos_actions/actions/calibrate_y_factor.py b/scos_actions/actions/calibrate_y_factor.py index bc975e65..af8fe6c6 100644 --- a/scos_actions/actions/calibrate_y_factor.py +++ b/scos_actions/actions/calibrate_y_factor.py @@ -78,7 +78,7 @@ from scos_actions import utils from scos_actions.actions.interfaces.action import Action -from scos_actions.calibration import sensor_calibration, default_sensor_calibration +from scos_actions.calibration import default_sensor_calibration, sensor_calibration from scos_actions.hardware.mocks.mock_gps import MockGPS from scos_actions.hardware.sigan_iface import SIGAN_SETTINGS_KEYS from scos_actions.settings import SENSOR_CALIBRATION_FILE diff --git a/scos_actions/signals.py b/scos_actions/signals.py index 36baaf3b..66d2a64a 100644 --- a/scos_actions/signals.py +++ b/scos_actions/signals.py @@ -13,3 +13,9 @@ # Provides argument 'action' register_action = Signal() + +# Provides argument 'signal_analyzer' +register_signal_analyzer = Signal() + +# Provides argument 'gps' +register_gps = Signal()