Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions study_lyte/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,12 @@ def force(self):
calibrated force and depth as a pandas dataframe cropped to the snow surface and the stop of motion
"""
if self._force is None:
if 'Sensor1' in self.calibration.keys():
force = apply_calibration(self.raw['Sensor1'].values, self.calibration['Sensor1'], minimum=0, maximum=15000)
force = force - np.nanmean(force[0:20])
else:
force = self.raw['Sensor1'].values
# Default to raw data
force = self.raw['Sensor1'].values
if self.calibration is not None:
if 'Sensor1' in self.calibration.keys():
force = apply_calibration(self.raw['Sensor1'].values, self.calibration['Sensor1'], minimum=0, maximum=15000)
force = force - np.nanmean(force[0:20])

self._force = pd.DataFrame({'force': force, 'depth': self.depth.values})
# prefer a ground index if available
Expand Down Expand Up @@ -409,7 +410,7 @@ def depth(self):
error=self.error.index)

if depth.min() < -230 and self.accelerometer.depth.min() > -230:
LOG.warning('Fused depth result produced a profile > 250 cm. Defaulting to accelerometer')
LOG.warning('Fused depth result produced a profile > 230 cm. Defaulting to accelerometer')
self._depth = self.accelerometer.depth

elif depth.min() < -230 and self.barometer.depth.min() > -230:
Expand Down