calibrationdata

This module is responsible for storage and application of calibration data.

class runmacs.spec.calibration.calibrationdata.CalibrationData[source]

Representation of specMACS calibration data.

This class supports calibration data with arbitrary analytic nonlineary correction rules.

apply

Applies the calibration data to given raw data.

This property can be used as a function, to calibrate from S0 and tint to radiance units:

>>> caldata = CalibrationData.fromFile('cal...')
>>> calibrated = caldata.apply(signal - dark_signal, tint)

Alternatively, apply can be sliced, if only a part of the sensor needs to be calibrated:

>>> part_calibrated = caldata.apply[7,10:20](signal0[7,10:20], tint)
convertUnit(targetUnit, ureg=None)[source]

Create new calibration data for another radiance unit.

Parameters:
  • targetUnit – desired radiance unit
  • uregpint unit registry, if None, a temporary one is created
Returns:

new CalibrationData with given radiance unit

classmethod fromFile(filename)[source]

Create CalibrationData from a given filename.

Parameters:filename – Name of the calibration file (ENVI format, without file suffix)
genBinning(spatial=1, spectral=1)[source]

Create new calibration data for given binnings

Parameters:
  • spatial – spatial binning factor
  • spectral – spectral binning factor
Returns:

new CalibrationData with given binning

getBadPixelFixer(strategy=None)[source]

Get a BadPixelFixer from the bad pixels given in the calibration data.

Parameters:strategy – Fixing strategy, gets passed to the BadPixelFixer.
rawEnviHeader

The raw ENVI header which describes the current calibration data.

toFile(filename)[source]

Saves the calibration data to a file with the given filename.

Parameters:filename – Name of the calibration file (ENVI format, without file suffix)