View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Listing images in different filters via header keywords?

Don Schumacher, Jr. wrote on Mar 02, 2011

Issue:
I have photometry images (~100) of a target star taken over one night where the images were taken in either the B or V filter. The names of all the images are just objectname-###.fits Each image has full header information including object name and filter.

Now what I want to do is run phot on the data such that 1 run of phot gives me output in the B filter and a 2nd run of phot gives me output in the V filter. But, the only way I know how to run phot is with an input list or a file listing the input images. And since all my images are named only after the object I don't know how to separate them in the photometry.

Question:
How do I either run phot in such a way that it does it on [X] images ONLY in a certain filter (as designated in the image header)?
OR
How do I create an input list file containing ONLY the images in one filter of my object (again with the filter designated in the image header).
OR
How do I batch rename the images to reflect what filter they were taken in (based on their filter in the image header).

I guess there could potentially be many different solutions to this, but anything that works would be appreciated!

Mike Fitzpatrick wrote on Mar 02, 2011

You can create a list of images all with the same filter type using a command like:

cl> hselect *.fits $I "filter ?= 'B'" > blist.txt
cl> hselect *.fits $I "filter ?= 'V'" > vlist.txt


Otherwise you can process all of the images and then select by filter from the result tables.

Don Schumacher, Jr. wrote on Mar 02, 2011

Excellent!

That worked perfectly, I just had to change it to:

cl> hselect *.fits $I "filter ?= 'Bessell B'" > blist.txt
cl> hselect *.fits $I "filter ?= 'Bessell V'" > vlist.txt


since there was that repeating B on Bessell in each one.

Thanks for the quick response time too!

Last post on Mar 02, 2011