View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Getting selective information from header files

rohit wrote on Jun 18, 2007

I have 130 files and I need to create and print a list of selective information from their header file. When I do the following:

ls *.fits > list

I get the names of every file. Instead I also would like to have the "Object name" and the "comment" for all files. They would be printed in column. How do I do that? I tried :

ls *.fits 'OBJECT', 'COMMENT' > object

but that ONLY prints the filename but not the OBJECT and COMMENT.

Thanks!

Emilliano Gregori wrote on Jun 18, 2007

hello Trillian,
maybe the task "hselect" could be useful. From its manual page:


NAME
hselect - select a subset of images satisfying a boolean expression

USAGE
hselect images fields expr


it prints the required header keywords (field) only for the images for which the expression is true. Here is an example from the manual:


cl> hselect n1.* $I,naxis[12],title 'naxis == 2'
n1.0001 512 512 quartz
n1.0002 512 512 "dome flat"
n1.0005 384 800 "ngc 3127 at 45 degrees"
cl>


Cheers,
Emiliano.

rohit wrote on Jun 18, 2007

Thanks for your help. I tried working on it but it does not work. I am not choosing some of the files which have certain names, but I want certain information from the header files and print it. Suppose I have three files:

24nos0012
24nos0013
24nos0014

Each header file has RA, DEC, OBJECT, COMMENT...

Suppose of all this information, I would like to choose OBJECT and COMMENT only and print out in a tabular form like:

24nos0012 neon arclamp
24nos0013 HD8720 bright object
......

How do I do this?

rohit wrote on Jun 18, 2007

Sorry for my previous post. It works!

Here is how I did it: (for others to see)

hselect 24* $I, OBJECT, COMMENT > info

This will print ONLY the object and comment information onto a file I called 'info'.

Molto Grazie Emiliano!! :-)

Last post on Jun 18, 2007