Hi @CamDavidsonPilon,
Hope all is well with you.
We are still experiencing this issue where if the voltage is above the calibration range for OD, it maps to the min OD and if the votage is below the calibration range for OD, it maps to the max OD. This is pretty unintuitive. We think it would be more intuitive to map to the maximum OD if it’s above the maximum voltage, and to the minimum OD if it’s the minimum voltage.
We were using this calibration file:
calibration_type: od600
calibration_name: M5_YE_sept
calibrated_on_pioreactor_unit: pio01
created_at: 2025-09-23T14:34:58.629000Z
curve_data_:
- -0.003190387455580229
- 0.04003007669797895
- 0.05183324889904352
- 0.3399254157439484
x: OD600
y: Voltage
recorded_data:
x:
- 0
- 0.361
- 0.657
- 1.32
- 2.58
- 3.3
- 4.36
- 5.74
- 6.98
- 7.89
- 9.47
y:
- 0.5466
- 0.3466
- 0.5757
- 0.6696
- 0.5935
- 0.9594
- 0.9591
- 1.2046
- 1.74
- 1.6743
- 1.6807
curve_type: poly
ir_led_intensity: 50
angle: '45'
pd_channel: '1'
This is the error we got:
“Signal below suggested calibration range. Trimming signal. Calibrated for OD=[0, 9.47], V=[0.347, 1.74]. Observed 2.903V, which would map outside the allowed values.”
And the calibrated OD value returned was 0:
I asked chatGPT to try to reproduce the problem using one of our real calibrations and a real OD value. od_reading_exploration.py (4.4 KB)
chatGPT’s suggestion is amending:
except exc.SolutionBelowDomainError:
if not self.has_logged_warning:
self.logger.warning(
f"Signal below suggested calibration range. Trimming signal. Calibrated for OD=[{min_OD:0.3g}, {max_OD:0.3g}], V=[{min_voltage:0.3g}, {max_voltage:0.3g}]. Observed {observed_voltage:0.3f}V, which would map outside the allowed values."
)
self.has_logged_warning = True
return min_OD
to:
except exc.SolutionBelowDomainError:
# If the raw voltage is *above* the calibrated voltage range,
# this exception can still occur, but we should trim to max_OD.
if observed_voltage > max_voltage:
if not self.has_logged_warning:
self.logger.warning(
f"Signal above suggested calibration range. Trimming signal. "
f"Calibrated for OD=[{min_OD:0.3g}, {max_OD:0.3g}], "
f"V=[{min_voltage:0.3g}, {max_voltage:0.3g}]. "
f"Observed {observed_voltage:0.3f}V."
)
self.has_logged_warning = True
return max_OD
# Otherwise this is a true below-range voltage
if not self.has_logged_warning:
self.logger.warning(
f"Signal below suggested calibration range. Trimming signal. "
f"Calibrated for OD=[{min_OD:0.3g}, {max_OD:0.3g}], "
f"V=[{min_voltage:0.3g}, {max_voltage:0.3g}]. "
f"Observed {observed_voltage:0.3f}V."
)
self.has_logged_warning = True
return min_OD
What do you think?
Many thanks,
Vicky