View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

running a task in multiple directories?

Arp wrote on Oct 19, 2009

Hi!

I've got about several hundred fits files, and I'd like to extract a specific value from their headers. But those files are in different folders, so I tried hedit -r ... but that does not work. Is there a way I can tell iraf, or in this case hedit to look in all (sub)directories and analyse all fits files?

(and how can I put those results into a text file?)
Thx.

Mike Fitzpatrick wrote on Oct 19, 2009

The FILES or SECTIONS tasks you would normally use to create lists of images don't support descending subdirectories (although that would be an interesting new feature to add). Instead you can create the file list using the host 'find' command, e.g.


cl> find . -name \*.fits -print > flist
cl> hedit @flist foo yes


The 'find' task is declared as foreign in your login.cl and so doesn't need to be escaped. Also, are you sure you didn't mean you wanted to use the HSELECT task to get the value, or by 'extract' do you mean delete?

-Mike

Arp wrote on Oct 19, 2009

Hi!

Thank you.

Im not sure what HSELECT does, but I read that HEDIT can be used to to show the values of specific header fields. Thats all I want to do, read the value of a specific field, in this case the GAIN Value of around 2000 files in around 400 directories :)

Last post on Oct 19, 2009