Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: imagefromforeign - Constructor Up: image - Tool Previous: imagefromascii - Constructor


imagefromfits - Constructor



Package general
Module images
Tool image


Construct an AIPS++ image by conversion from a FITS image file


Synopsis
imagefromfits(outfile, infile, whichrep, whichhdu, zeroblanks, overwrite, old)


Arguments

outfile in Output image file name
    Allowed: String
    Default: unset
infile in Input FITS disk file name
    Allowed: String
whichrep in If this FITS file contains multiple coordinate representations, which one should we read
    Allowed: positive integer
    Default: 1
whichhdu in If this FITS file contains multiple images, which one should we read
    Allowed: positive integer
    Default: 1
zeroblanks in If there are blanked pixels, set them to zero instead of NaN
    Allowed: T or F
    Default: F
overwrite in Overwrite (unprompted) pre-existing output file ?
    Allowed: T or F
    Default: F
old in Use old non-WCS based FITS parser?
    Allowed: T or F
    Default: F


Returns
Image tool or fail


Description

This constructor is used to convert a FITS disk image file (Float, Double, Short, Long are supported) to an AIPS++ image file. If outfile is given, the image is written to the specified disk file. If outfile is unset, the Image tool is associated with a temporary image. This temporary image may be in memory or on disk, depending on its size. When you destroy the Image tool (with the done function) this temporary image is deleted.

This constructor reads from the FITS primary array (when the image is at the beginning of the FITS file; whichhdu=1), or an image extension (when the image is elsewhere in the FITS file, whichhdu > 1).

By default, any blanked pixels will be converted to a mask value which is false, and a pixel value that is NaN. If you set zeroblanks=T then the pixel value will be zero rather than NaN. The mask will still be set to false. See the function replacemaskedpixels if you need to replace masked pixel values after you have created the image.



Example
- im := imagefromfits('data/myimage', 'fits/MYIMAGE.FITS')
- mi := im.miscinfo()
print 'fields=', field_names(mi)

The FITS image is converted to an AIPS++ image file and access is provided via the image tool called im. Any FITS header keywords which were not recognized or used are put in the miscellaneous information bucket accessible with the miscinfo function. In the example we list the names of the fields in this record.





next up previous contents index
Next: imagefromforeign - Constructor Up: image - Tool Previous: imagefromascii - Constructor   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01