safeguard copy with None check
@@ -386,9 +386,11 @@ class IO:
else:
# If solving the inverse problem, the measurment is the radiance
# We apply the calibration correciton here for simplicity.
- meas = data['measured_radiance_file'].copy()
+ meas = data['measured_radiance_file']
+ if meas is not None:
+ meas = meas.copy()
if data["radiometry_correction_file"] is not None:
- meas = meas * data['radiometry_correction_file']
+ meas *= data['radiometry_correction_file']
# We build the geometry object for this spectrum. For files not
# specified in the input configuration block, the associated entries
