Add support for scaled data in Frame files
Created by: basswinkels
At Virgo, many channels are stored as an int32, which should be scaled using floating point numbers stored inside the frames itself. This is typically done for storing environmental sensors or photodiode signals that are sampled by an ADC. I seems that gwpy is ignoring this scaling. It would be good to have a new function (or some keyword argument on an existing function that defaults to the old behavior) to scale the data when offset != 0 and gain != 1.
Relevant fields are in the FrAdcData structures in FrameL.h:
struct FrAdcData { /* hold ADC data (or image) / [...snip ...] float bias; / DC bias on channel. the step size is stored in adc->data->dx; / float slope; / ADC calibration: input units/count */ [... snip ...] };
In Matlab, the difference between downloading data without or with the scaling applied is the difference between the functions frgetvect and frgetvectN (for normalized), it might be helpful to study this code.