Skip to content

Commit

Permalink
simplify parameterization of get_calibration
Browse files Browse the repository at this point in the history
No longer make this function arbitrarily distinguish between "onboard" and "sensor" calibrations
  • Loading branch information
aromanielloNTIA committed Mar 28, 2024
1 parent 6da59db commit 2419998
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_calibration(
Load calibration data from file.
:param cal_file_path: Path to the JSON calibration file.
:param cal_type: Calibration type to load: "onboard", "sensor" or "differential"
:param cal_type: Calibration type to load: "sensor" or "differential"
:return: The ``Calibration`` object, if loaded, or ``None`` if loading failed.
"""
try:
Expand All @@ -131,7 +131,8 @@ def get_calibration(
except Exception:
cal = None
logger.exception(
f"Unable to load {cal_type} calibration file, reverting to none"
f"Unable to load {cal_type} calibration file from {cal_file_path}."
+ " Reverting to none"
)
finally:
return cal
Expand Down Expand Up @@ -181,7 +182,7 @@ def get_calibration(
# Calibration loading
if not settings.RUNNING_TESTS:
# Load the onboard cal file as the sensor calibration, if it exists
onboard_cal = get_calibration(settings.ONBOARD_CALIBRATION_FILE, "onboard")
onboard_cal = get_calibration(settings.ONBOARD_CALIBRATION_FILE, "sensor")
if onboard_cal is not None:
sensor_loader.sensor.sensor_calibration = onboard_cal
else:
Expand Down

0 comments on commit 2419998

Please sign in to comment.