Struct ImageScale¶
Defined in File fitsCompression.h
Struct Documentation¶
-
struct
ImageScale
Scale to apply to image
Images are scaled to the type implied by the provided BITPIX using the provided scale and zero-point:
value in memory = BZERO + BSCALE * value in FITS
In addition to scaling, a random field of values distributed [0,1) may be added before quantisation (“fuzz”); this preserves the expectation value of the floating-point image, while increasing the variance by 1/12.
Public Functions
-
ImageScale
(int bitpix_, double bscale_, double bzero_)¶ Constructor
We make BZERO an integer multiple of BSCALE, because cfitsio notes: “This helps to ensure the same scaling will be performed if the
file undergoes multiple fpack/funpack cycles”.
The BLANK is 255 for BITPIX=8 since FITS specifies that uses unsigned char; otherwise it is set to the maximum int for the appropriate signed integer.
Convert to an array of pixel values to write to FITS
- Return
Array of pixel values, appropriately scaled.
- Parameters
[in] image
: Image to scale[in] forceNonfiniteRemoval
: Force removal of non-finite values? This is useful for lossless compression, because cfitsio doesn’t mask out non-finite values, and they end up contaminating the entire tile.[in] fuzz
: Add random values before quantising?[in] tiles
: Tile dimensions[in] seed
: Seed for random number generator
-