Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
outfile | in | FITS file name | |
Allowed: | String | ||
Default: | Input name + `.fits' | ||
velocity | in | prefer velocity (rather than frequency) as primary spectral axis? | |
Allowed: | Bool | ||
Default: | F | ||
optical | in | use the optical (rather than radio) velocity convention? | |
Allowed: | Bool | ||
Default: | T | ||
bitpix | in | Bits per pixel | |
Allowed: | -32 (floating point) or 16 (integer) | ||
Default: | -32 | ||
minpix | in | Minimum pixel value for BITPIX=16 | |
Allowed: | Float | ||
Default: | Autoscale | ||
maxpix | in | Maximum pixel value for BITPIX=16 | |
Allowed: | Float | ||
Default: | Autoscale | ||
region | in | The region of interest | |
Allowed: | Region tool | ||
Default: | Whole image | ||
mask | in | OTF mask | |
Allowed: | Boolean LEL expression or mask region | ||
Default: | None | ||
overwrite | in | Overwrite (unprompted) pre-existing output file ? | |
Allowed: | T or F | ||
Default: | F | ||
dropdeg | in | Drop degenerate axes ? | |
Allowed: | T or F | ||
Default: | F | ||
deglast | in | Put degenerate axes last in header ? | |
Allowed: | T or F | ||
Default: | F | ||
async | in | Run asynchronously? | |
Allowed: | Bool | ||
Default: | !dowait |
This function converts the image into a FITS file.
If the image has a rest frequency associated with it, it will always write velocity information into the FITS file. By default the frequency information will be primary as it is better defined than velocity information. If you select velocity=T then by default the velocity is written in the optical convention, but if optical=F it will use the radio convention instead.
The FITS definition demands equal increment pixels. Therefore, if you write velocity information as primary and use the optical velocity definition, the increment is computed at the spectral reference pixel. If the bandwidth is large, this may incur non-negligible coordinate calculation errors far from the reference pixel.
By default the image is written as a floating point FITS file (bitpix= -32). Under rare circumstances you might want to save space and write it as scaled 16 bit integers (bitpix = 16). You can have tofits calculate the scaling factors by unsetting minpix and maxpix (the default). If you set minpix and maxpix, values outside of that range will be truncated. This can be useful if all of the FITS images dynamic range is being used by a few high or low values and you are not interested in preserving those values exactly. Besides the factor of two space savings you get by using 16 instead of 32 bits, integer images usually also compress well (for example, with the standard GNU software facility gzip).
If the specified region-of-interest extends beyond the image, it is truncated.
The output mask is the combination (logical OR) of the default input pixel mask (if any) and the OTF mask.
Sometimes it is useful to drop axes of length one (degenerate axes) because not all FITS readers can handle them. Use the dropdeg argument if you want to do this.
- ok := im.tofits('MYFILE.FITS') # write FITS image file - ok := im.tofits('MYFILE2.FITS', bitpix=16) # Write as scaled 16 bit integers