View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

headers fix

iraf_user wrote on Mar 20, 2007

Hello,

I am trying to read some headers and the problem is that for some reason
the header information has been stored in an agle.
When I use imhead, it looks something like this:
----------------------------------------------------------------------
imhead obj160.fits l+
obj160.fits[2216,2046][ushort]
No bad pixels, min=0., max=0. (old)
Line storage mode, physdim [2216,2046], length of user area 3523 s.u.
Created Tue 14:16:44 20-Mar-2007, Last modified Wed 05:11:39 25-Jan-2006
Pixel file "obj160.fits" [ok]
EXTEND = F / File may contain extensions B
XSTART = '1 ' / start roi in X
DSEC11 = '[1:1044,1:1023]' / Image area in raw frame for Amp11
21 BSEC22 = '[1109:1162,1024:2046]' / Bias section definition for Amp2
left GTGAIN12= 3.000 / (e-/ADU) predicted gain, lower
HA = '5:25:45.4' / hour angle (H:M:S)
ST = '19:22:26.4' / sidereal time A
EXPTIME = 60.000 / Exposure time in secs D
TELFOCUS= 19050 / Telescope focus
WEATDATE= 'Jan 25 05:24:02 2006' / Date and time of last update W

When I use the more command to see what the headers look like it looks like this:

more *fits

SIMPLE = T / Fits standard BITPIX = 16 / Bits per pixel NAXIS =
2 / Number of axes NAXIS1 =
2216 / Axis length NAXIS2 =
2046 / Axis length EXTEND = F / File may contain extensions BSCALE = 1.000000E0 / REAL = TAPE*BSCALE + BZERO BZERO = 3.276800E4 /
.............................................

so the headers seem to be in an angle, so when iraf tries to read it it reads only
the left side so it misses most of the information. I am not sure why this was caused, the file was a *gz file and I just used the gzip -d command. It seems
that I need to find a way to 'straighten' the header file. Does anyone know a command in iraf to do that?

Thank you.

Mike Fitzpatrick wrote on Mar 20, 2007

It may be that the original FITS file was corrupted, decompressing the file wouldn't normally corrupt the file. The header should be a series of 80-char 'cards' padded with blanks, it looks as though your header might be padded with NULL or else terminated early.

There's no task to fix this specifically, however see the HFIX task for a way to execute an arbitrary command on the header file. Assuming you can write and awk/sed/perl/whatever script that puts each keyword on a line you can use this task to apply it to the header. If you have only one image to edit, the default HFIX command will simply put you into the editor and you can change it manually, otherwise check for problems in the original FITS writing software.

-Mike

Last post on Mar 20, 2007