calc_mode is set to 0:
the linear position (deltaX, deltaY) at the detector location (rawX, rawY)
is derived from the distortion map stored in the extension
FILTER-FilterId (e.g. FILTER-U, FILTER-V, FILTER-GRISM1 etc.).
As the distortion map is only coarsly sampled an interpolation is required to
derive the distortion at the requested position in the same way as for
Cal_omDistortion.
calc_mode is set to 1:
the linear position (deltaX,deltaY) at the location (rawX, rawY) is
computed using an up to 7th order polynomial.
The coefficients of the polynomials are stored in the
columns XPOLYCOEF, YPOLYCOEF of the extension POLYNOM_MAP2.
The processing is identical to that of Cal_omDistortion.
Note that the offsets (deltaX, deltaY) are subtracted from the detector coordinates (rawX, rawY), because the offsets are defined as the difference between the measured and the expected (i.e. linear grid) position.