Dataformat, Noise and QBITS

The dataformat is quite easy. For raw frames bot axes describe the detector pixels. For cubes the first axis is the wavelength axis, the second and third the spatial axes (e.g. 1665 by 64 by 19 array). All OSIRIS data (raw or processed) consist of three "layers". The first "layer" contains the data (as float). The second "layer" contains the noise values (as float). The third "layer" contains the quality bits. In a quality byte the status of this pixel is bit-encoded. The first bit (so to say value 1B) is 0 if the pixel is not valid and shall be ignored, 1 otherwise.
The second bit (so to say value 2B) is 0 if the pixel has not been interpolated, 1 otherwise.
The third bit (so to say value 4B) is 0 if the pixel has not well been interpolated, 1 otherwise.
The fourth bit (so to say value 8B) is 0 if the pixel is outside (not part of a real spectrum), 1 otherwise. E.g. in a rectangular cube not all pixels have a spectrum (remember the funny FoV of the instrument)
The higher bits (in more recent versions) encode the number of healthy pixels that have been used to calculate the value of a pixel in the mosiacing process.
Some bit combinations should never occur like Bit1=1 and Bit4=0 (a pixel should not be valid but outside) or Bit2=0 and Bit3=1. You can read and set the quality bits with the extbit and setbit functions.