Skip to content

Commit 8c405f7

Browse files
committed
format
1 parent 6707e77 commit 8c405f7

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

scos_actions/actions/acquire_sea_data_product.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@
121121

122122
# Create power detectors
123123
TD_DETECTOR = create_statistical_detector("TdMeanMaxDetector", ["max", "mean"])
124-
FFT_M3_DETECTOR = create_statistical_detector("FftM3Detector", ["max", "mean", "median"])
124+
FFT_M3_DETECTOR = create_statistical_detector(
125+
"FftM3Detector", ["max", "mean", "median"]
126+
)
125127
PFP_M3_DETECTOR = create_statistical_detector("PfpM3Detector", ["min", "max", "mean"])
126128

127129

@@ -158,7 +160,7 @@ def __init__(
158160
# Compute the amplitude shift for PSD scaling. The FFT result
159161
# is in pseudo-power log units and must be scaled to a PSD.
160162
self.fft_scale_factor = (
161-
- 10.0 * np.log10(impedance_ohms) # Pseudo-power to power
163+
-10.0 * np.log10(impedance_ohms) # Pseudo-power to power
162164
+ 27.0 # Watts to dBm (+30) and baseband to RF (-3)
163165
- 10.0 * np.log10(sample_rate_Hz * fft_size) # PSD scaling
164166
+ 20.0 * np.log10(window_ecf) # Window energy correction
@@ -178,7 +180,9 @@ def run(self, iq: ray.ObjectRef) -> np.ndarray:
178180
)
179181
# Power in Watts
180182
fft_amplitudes = calculate_pseudo_power(fft_amplitudes)
181-
fft_result = apply_statistical_detector(fft_amplitudes, self.detector) # (max, mean, median)
183+
fft_result = apply_statistical_detector(
184+
fft_amplitudes, self.detector
185+
) # (max, mean, median)
182186
percentile_result = np.percentile(fft_amplitudes, self.percentiles, axis=0)
183187
fft_result = np.vstack((fft_result, percentile_result))
184188
fft_result = np.fft.fftshift(fft_result, axes=(1,)) # Shift frequencies
@@ -1001,7 +1005,8 @@ def create_global_data_product_metadata(self) -> None:
10011005
name="Power Spectral Density",
10021006
series=[d.value for d in FFT_M3_DETECTOR]
10031007
+ [
1004-
f"{int(p)}th_percentile" if p.is_integer() else f"{p}th_percentile" for p in FFT_PERCENTILES
1008+
f"{int(p)}th_percentile" if p.is_integer() else f"{p}th_percentile"
1009+
for p in FFT_PERCENTILES
10051010
], # ["max", "mean", "median", "25th_percentile", "75th_percentile", ... "99.99th_percentile"]
10061011
length=int(FFT_SIZE * (5 / 7)),
10071012
x_units="Hz",

scos_actions/actions/calibrate_y_factor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
from scos_actions import utils
8080
from scos_actions.actions.interfaces.action import Action
81-
from scos_actions.calibration import sensor_calibration, default_sensor_calibration
81+
from scos_actions.calibration import default_sensor_calibration, sensor_calibration
8282
from scos_actions.hardware.mocks.mock_gps import MockGPS
8383
from scos_actions.hardware.sigan_iface import SIGAN_SETTINGS_KEYS
8484
from scos_actions.settings import SENSOR_CALIBRATION_FILE

0 commit comments

Comments
 (0)