Skip to content

Commit

Permalink
Don't update calibration if NAN for gain or noise figure.
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 15, 2024
1 parent 23761e7 commit 5a010ac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scos_actions/actions/calibrate_y_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,13 @@ def calibrate(self, params: dict):
pwr_on_watts, pwr_off_watts, enr_linear, enbw_hz, temp_k
)

# Update sensor calibration with results
self.sensor.sensor_calibration.update(
sigan_params, utils.get_datetime_str_now(), gain, noise_figure, temp_c
)

if not np.isnan(gain) and not np.isnan(noise_figure):
# Update sensor calibration with results
self.sensor.sensor_calibration.update(
sigan_params, utils.get_datetime_str_now(), gain, noise_figure, temp_c
)
else:
logger.warn(f"Not updating calibration. NF: {noise_figure}, Gain: {gain}")
# Debugging
noise_floor_dBm = convert_watts_to_dBm(Boltzmann * temp_k * enbw_hz)
logger.debug(f"Noise floor: {noise_floor_dBm:.2f} dBm")
Expand Down

0 comments on commit 5a010ac

Please sign in to comment.