mConvert

Description:
mConvert changes the datatype of an image. When converting to floating point, no additional information is needed. However, when converting from higher precision (e.g. 64-bit floating point) to lower (e.g. 16-bit integer), scaling information is necessary. This can be given explicitly by the user or guessed by the program.
Syntax:
mConvert [-d level] [-s statusfile] [-b bitpix] [-min minval] [-max maxval] [-blank blankval] in.fits out.fits

Switches:

-d level
Turns on debugging to the specified level (1-3).
-s statusfile
mBgModel output and errors are written to statusfile instead of to stdout.
-b bitpix
BITPIX value for the output FITS file (default is -64). Possible values are:
  • 8 (character or unsigned binary integer)
  • 16 (16-bit integer)
  • 32 (32-bit integer)
  • -32 (single precision floating point)
  • -64 (double precision floating point).
-min minval
Pixel data value in the input image which should be treated as a minimum (value of 0) in the output image when converting from floating point to integer. (default for BITPIX 8: 0; BITPIX 16: -32767; BITPIX 32: -2147483647
-max maxval
Pixel data value in the input image which should be treated as a maximum (value of 255 or 32768) in the output image when converting from floating point to integer. (Default for BITPIX 8: 255; BITPIX 16: 32768; BITPIX 32: 2147483648)
-blank blankval
If converting down to an integer scale: value to be used in the output image to represent blank pixels (NaN) from the input image. Default value is minval.

Arguments:

in.fits
Input image filename
out.fits
Output image filename.
Results:
Output image with the datatype as specified by the user (BITPIX).

Examples:

Converting a single-precision image down to a 16-bit integer BITPIX, when the data is clustered between values of -0.01 and 0.1:

$ mConvert -b 16 -min -0.01 -max 0.1 -blank -32767 acs.fits acs_bitpix16.fits
[struct stat="OK"]

Return Codes:

  • [struct stat="OK"]
  • [struct stat="ERROR", msg="Usage: Convert [-d level] [-s statusfile] [-b bitpix] [-min minval] [-max maxval] [-blank blankval] in.fits out.fits"]
  • [struct stat="ERROR", msg="No status file name given"] (-s flag was used without an argument)
  • [struct stat="ERROR", msg="Cannot open status file: statusfile"]
  • [struct stat="ERROR", msg="No debug level given"] (-d flag was used without an argument)
  • [struct stat="ERROR", msg="Debug level string is invalid: 'debug-level'"]
  • [struct stat="ERROR", msg="Debug level value cannot be negative"]
  • [struct stat="ERROR", msg="No bitpix value given"] (-b flag was used without an argument)
  • [struct stat="ERROR", msg="Bitpix string is invalid: 'bitpix'"]
  • [struct stat="ERROR", msg="Bitpix must be one of (8, 16, 32, -32, -64)"]
  • [struct stat="ERROR", msg="No range min value given"] (-min flag was used without an argument)
  • [struct stat="ERROR", msg="Range min string is invalid: 'min'"]
  • [struct stat="ERROR", msg="No range max value given"] (-max flag was used without an argument)
  • [struct stat="ERROR", msg="Range max string is invalid: 'max'"]
  • [struct stat="ERROR", msg="No blank value given"] (-blank flag was used without an argument)
  • [struct stat="ERROR", msg="Blank string is invalid: 'blank'"]
  • [struct stat="ERROR", msg="Invalid input file 'in.fits'"]
  • [struct stat="ERROR", msg="Invalid output file 'out.fits'"]
  • [struct stat="ERROR", msg="general error message"]
  • [struct stat="ERROR", status="FITS error code", msg="FITS library error message"]