Struct ImageWriteOptions

Struct Documentation

struct ImageWriteOptions

Options for writing an image to FITS

An image being written to FITS may be scaled (quantised) and/or compressed. This struct is a container for options controlling each of those separately.

Public Functions

template<typename T>
ImageWriteOptions(image::Image<T> const &image)

Construct with default options for images.

template<typename T>
ImageWriteOptions(image::Mask<T> const &mask)

Construct with default options for masks.

ImageWriteOptions(ImageCompressionOptions const &compression_ = ImageCompressionOptions(ImageCompressionOptions::NONE), ImageScalingOptions const &scaling_ = ImageScalingOptions())

Construct with specific compression and scaling options.

ImageWriteOptions(ImageScalingOptions const &scaling_)

Construct with specific scaling options.

ImageWriteOptions(daf::base::PropertySet const &config)

Construct from a PropertySet

The PropertySet should include the following elements:

  • compression.scheme (string): compression algorithm to use

  • compression.columns (int): number of columns per tile (0 = entire dimension)

  • compression.rows (int): number of rows per tile (0 = 1 row; that’s what cfitsio does)

  • compression.quantizeLevel (float): cfitsio quantization level

  • scaling.scheme (string): scaling algorithm to use

  • scaling.bitpix (int): bits per pixel (0, 8,16,32,64,-32,-64)

  • scaling.fuzz (bool): fuzz the values when quantising floating-point values?

  • scaling.seed (long): seed for random number generator when fuzzing

  • scaling.maskPlanes (list of string): mask planes to ignore when doing statistics

  • scaling.quantizeLevel: divisor of the standard deviation for STDEV_* scaling

  • scaling.quantizePad: number of stdev to allow on the low side (for STDEV_POSITIVE/NEGATIVE)

  • scaling.bscale: manually specified BSCALE (for MANUAL scaling)

  • scaling.bzero: manually specified BSCALE (for MANUAL scaling)

Use the ‘validate’ method to set default values for the above.

‘scaling.maskPlanes’ is the only entry that is allowed to be missing (because PropertySet can’t represent an empty array); when it is missing, it is interpreted as an empty array.

Parameters
  • [in] config: Configuration of image write options

Public Members

ImageCompressionOptions compression

Options controlling compression.

ImageScalingOptions scaling

Options controlling scaling.

Public Static Functions

static std::shared_ptr<daf::base::PropertySet> validate(daf::base::PropertySet const &config)

Validate a PropertySet

Returns a validated PropertySet with default values added, suitable for use with the constructor.

For details on what elements may be included in the input, see ImageWriteOptions::ImageWriteOptions(daf::base::PropertySet const&).

Return

validated configuration

Parameters
  • [in] config: Configuration of image write options

Exceptions
  • lsst::pex::exceptions::RuntimeError: if entry is not recognized.