View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

gethead

cosmologist wrote on Apr 01, 2009

I am trying to use gethead command in my xgterm , but it always give me an error message: "task gethead not found"! :cry:
Any idea why?

Mike Fitzpatrick wrote on Apr 01, 2009

'Gethead' is a task in the WCSTOOLS package of host commands. IF you're trying to use this within IRAF you need to declare it as a foreign command and have it installed on your machine, the command you may be looking for instead in the IMHEADER task.

-Mike

cosmologist wrote on Apr 01, 2009

Does that apply to "sethead" as well? :(

Mike Fitzpatrick wrote on Apr 01, 2009

Yup. HEDIT is the equivalent task, but if you're going to be using the wcstools tasks you don't even need to be in IRAF.

cosmologist wrote on Apr 01, 2009

But how can I check if I have it on my machine? (or I guess because of the error messages, I should assume that i don't have it) right?

Mike Fitzpatrick wrote on Apr 01, 2009

At the unix prompt you can say e.g. "which sethead". A 'command not found' message may simply mean your path doesn't include the directory where the commands were installed, but if you didn't explicitly install wcstools yourself, and you don't have a sysadmin who would've done it for you, then most likely it isn't installed.

cosmologist wrote on Apr 01, 2009

In this thread you told me that IMHEAD can take the place of GETHEAD ...
I am trying to "translate" the following GETHEAD command into an INHEAD one, but it doesn't work... what am I doing wrong?

- gethead d*ms.fits OBJECT EXPTIME AIRMASS | grep eg274

I used: imhead d*ms.fits OBJECT EXPTIME AIRMASS | grep eg274

but I can error! :cry: :cry: Any idea why?

cosmologist wrote on Apr 01, 2009

Does my question make sense? Please let me know if you need more explanation.

Thanks

Mike Fitzpatrick wrote on Apr 01, 2009

I think the command you are looking for is

cl> hselect d*ms.fits OBJECT,EXPTIME,AIRMASS "object ?= 'eg274'"


The IMHEAD task dumps the entire header with the 'long' option, but HSELECT is used to print only certain header fields. In this case we give it a list of images to search, the keywords to print out, and a conditional expression that must be true to print the value (in this case only print when the OBJECT keyword is 'eg274', the "?=' is a string-comparison operator). See the help page for HSELECT (and HEDIT) for additional details.

-Mike

cosmologist wrote on Apr 01, 2009

fitz

I think the command you are looking for is

cl> hselect d*ms.fits OBJECT,EXPTIME,AIRMASS "object ?= 'eg274'"


The IMHEAD task dumps the entire header with the 'long' option, but HSELECT is used to print only certain header fields. In this case we give it a list of images to search, the keywords to print out, and a conditional expression that must be true to print the value (in this case only print when the OBJECT keyword is 'eg274', the "?=' is a string-comparison operator). See the help page for HSELECT (and HEDIT) for additional details.

-Mike


Thanks for your reply, I used the command you suggested but I didn't get any output. Does that mean that I have no object with keyword eg274? :shock:

Mike Fitzpatrick wrote on Apr 01, 2009

Could be. You can check using a command like

cl> hselect *.fits $I,OBJECT yes


This will print out the image name and OBJECT keyword value for all FITS images in the current directory. Perhaps the object name is capitalized or has a space?

-Mike

Last post on Apr 01, 2009