Tim,
> > Now just need to be able to write it back to the fits natively... :-)
If you've not discarded the FITS airlock or modified BITPIX, BSCALE, and
BZERO headers therein you can set bitpix=-1 to regenerate the FITS file.
If you've done some processing on the array it won't be in the same
scaled form, as scaled arrays are `read-only'. Provided you've not
messed with the BITPIX value in the FITS airlock, setting NDF2FITS
parameter bitpix=-1 will create a FITS file in the native data type.
The BSCALE and BZERO values may change.
While I've determined the error in the revised code that accesses the
scaled form and its scaling parameters, rather than using the airlock
values, the special case does complicate the code somewhat. What else
do you want over that provided by bitpix=-1---retention of the original
scaling factors, definite native type? The read-only aspect means that
I can't access (without peering behind the scenes) the data or variance
array in its native data type. NDF2FITS will map in the unscaled type
and convert to the scaled/native type.
Malcolm
|