View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Round off problem in hedit

Philip Massey wrote on Jun 28, 2006

Hi, Mike et al---

I have an image that has astrometric parameters that were added via tfinder,
specifically numbers like:

CRVAL1 = 0.349583333333341
CRVAL2 = -15.295722222222
CRPIX1 = 1079.04400338829
CRPIX2 = 1242.12076751727
CD1_1 = 1.11412107413711E-4
CD1_2 = 8.17548433351806E-8
CD2_1 = 1.04285743207307E-7
CD2_2 = 1.11512925113402E-4

I'd like to transfer these to a different image, but when I go to hedit them
as
hedit otherimage.fits CD1_1 1.11412107413711E-4 add+ ver- show+
what I instead get is:
add test.fits,CD1_1 = 1.114121E-4

Is there someway I can add these values and keep all the digits?
Alternatively, is there some way I can add specific keywords from one
image to another?

thanks,
phil

Mike Fitzpatrick wrote on Jun 28, 2006

Hi Phil,

This has been reported before but apparently never changed. HEDIT only implements a real-valued keyword addition and not double-precision, so the roundoff is occurring. One workaround is to use the ASTHEDIT task instead, e.g.


as> asthedit pix ""
asthedit> dummy = 1.23456789012345
asthedit> quit
as> hselect pix dummy yes
1.23456789012345


This task does use double-precision, see the help page for details. You might also look at HFIX as a way to run any sort of command/host script on the header file so you could simply treat the header as a text file an update all the keywords in bulk. It might not apply directly here, but when I first read your message I was thinking the WCSCOPY task would help as well.

Cheers,
-Mike

Last post on Jun 28, 2006