[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Waldhäuser Str. 64, D-72076 Tübingen, Germany
[Uni logo]


HEXTRACT Source code in hextract.pro

HEXTRACT

Name
       HEXTRACT
Purpose
       Extract a subimage from an array and update astrometry in FITS header
Explanation
       Extract a subimage from an array and create a new FITS header with
       updated astrometry for the subarray
Calling Sequence
       HEXTRACT, Oldim, Oldhd, [ Newim, Newhd, x0, x1, y0, y1, /SILENT ]
               or
       HEXTRACT, Oldim, Oldhd, [x0, x1, y0, y1, /SILENT, ERRMSG =  ]
Input Parameters
       Oldim - the original image array
       Oldhd - the original image header
Optional Input Parameters
       x0, x1, y0, y1 - respectively, first and last X pixel, and first and
       last Y pixel to be extracted from the original image, integer scalars.
       If omitted,  HEXTRACT will prompt for these parameters
Optional Output
       Newim - the new subarray extracted from the original image
       Newhd - header for newim containing updated astrometry info
               If output parameters are not supplied or set equal to
               -1, then the HEXTRACT will modify the input parameters
               OLDIM and OLDHD to contain the subarray and updated header.
Keyword Parameters
       /SILENT - If set and non-zero, then a message describing the extraction
               is not printed at the terminal.   This message can also be
               suppressed by setting !QUIET.
Optional Keyword Output
       ERRMSG - If this keyword is supplied, then any error mesasges will be
               returned to the user in this parameter rather than depending on
               on the MESSAGE routine in IDL.   If no errors are encountered
               then a null string is returned.
Procedure
       The FITS header parameters NAXIS1, NAXIS2, CRPIX1, and CRPIX2 are
       updated for the extracted image.
Example
       Read an image from a FITS file 'IMAGE', extract a 512 x 512 subimage
       with the same origin, and write to a new FITS file 'IMAGENEW'
       IDL> im = READFITS( 'IMAGE', hdr )      ;Read FITS files into IDL arrays
       IDL> hextract, im, h, 0, 511, 0, 511    ;Extract 512 x 512 subimage
       IDL> writefits, 'IMAGENEW', im ,h       ;Write subimage to a FITS file
Procedures Used
       CHECK_FITS, STRN(), SXPAR(), SXADDPAR, SXADDHIST
Revision History
       Written, Aug. 1986 W. Landsman, STX Corp.
       Use astrometry structure,   W. Landsman      Jan, 1994
       Minor fix if bad Y range supplied   W. Landsman    Feb, 1996
       Added /SILENT keyword              W. Landsman     March, 1997
       Converted to IDL V5.0   W. Landsman   September 1997
       Added ERRMSG keyword    W. Landsman   May 2000

Last modified by pro2html on 2001 April 26 at 03:11 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically