View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

question fxextract

Guest wrote on Nov 13, 2008

Dear madam / sir,

I have a question related to the IRAF task fxextract: 

I would like to extract an extension (e.g. extension 2) 
from a multi-extension fits file and 
pass the header (=extension 0) to the new file, 
or, at least, pass all the header information stored in extension 2 
to the new file.
Both is not working regardless of how the keyword PHU is set.

I give an example below, where one sees that the extension 2 of this
file does include e.g. the EXPTIME, MJD-OBS, etc keywords,
after extracting this extension with fxextract, the new file does not
content these keywords anymore.

I would be very grateful for any help.
Thank you.

Best regards
Viki Joergens

Dr. Viki Joergens
Max-Planck-Institute for Astronomy
Koenigstuhl 17
D-69117 Heidelberg
Germany

Phone: +49 - 6221 528 403
eMail:  viki@mpia.de ([email]viki@mpia.de[/email])

---------------------------- Example: ------------------------------------------

> imhead UVES.2008-07-09T23_02_18.756.fits[2]   l+   |  more

byte 1717UVES.2008-07-09T23_02_18.756.fits[2][1074,2048][ushort]: Cha-Ha-8
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1074,2048], length of user area 17091 s.u.
Created Thu 00:30:40 10-Jul-2008, Last modified Mon 16:01:36 10-Nov-2008
Pixel file "UVES.2008-07-09T23_02_18.756.fits" [ok]
TELESCOP= 'ESO-VLT-U2'                  / ESO Telescope Name
INSTRUME= 'UVES    '                    / Instrument used
RA      =           166.941020          / 11:07:45.8 RA (J2000) pointing
DEC     =            -77.66936          / -77:40:09.6 DEC (J2000) pointing
EQUINOX =                2000.          / Standard FK5 (years)
RADECSYS= 'FK5     '                    / Coordinate reference frame
EXPTIME =            1699.9976          / Total integration time
MJD-OBS =       54656.95993931          / MJD start (2008-07-09T23:02:18.756)
DATE-OBS= '2008-07-09T23:02:18.756'     / Date of observation
.....

> fxextract UVES.2008-07-09T23_02_18.756.fits   test   groups=2  phu=yes

>  imhead test l+  |  more

test[1074,2048][ushort]: 
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [1074,2048], length of user area 2552 s.u.
Created Thu 15:23:56 13-Nov-2008, Last modified Mon 16:01:36 10-Nov-2008
Pixel file "test4.fits" [ok]
EXTEND  =                    T / There may be extensions
BSCALE  =           1.000000E0 / REAL = TAPE*BSCALE + BZERO
BZERO   =           3.276800E4 /
IRAF-TLM= '16:01:36 (10/11/2008)' / Time of last modification
ORIGIN  = 'NOAO-IRAF FITS Image Kernel July 2003' / FITS file originator
DATE    = '2008-07-09T23:30:39.600' / Date this file was written
CTYPE1  = 'PIXEL   '                    / Pixel coordinate system
CTYPE2  = 'PIXEL   '                    / Pixel coordinate system
CRVAL1  =                  1.0          / value of ref pixel
CRVAL2  =                  1.0          / value of ref pixel
CRPIX1  =              -1073.5          / Ref. pixel of center of rotation
CRPIX2  =                  1.0          / Ref. pixel of center of rotation
CDELT1  =                  2.0          / Binning factor
CDELT2  =                  2.0          / Binning factor
...
(then there follow only a few HIERARCH entries and the DATASUM and CHECKSUM)

-------------------------------------

Post generated using Mail2Forum (http://www.mail2forum.com)

Mike Fitzpatrick wrote on Nov 13, 2008

The 'phu' parameter creates a dummy primary header, if what you want is to simply copy out the extension and preserve the PHU, try

cl> imcopy foo.fits[2,inherit+] bar.fits


or use FXEXTRACT similarly with the 'inherit' flag set. See http://iraf.net/irafdocs/fits_userguide/ for more about the FITS kernel parameters.

-Mike

Last post on Nov 13, 2008