Question: How do I access a second header file with ccdproc.image_collection.summary?

Currently files.summary[‘keywords’][0] is looking at the first header file, but BIASSEC, CCDSEC & DATASEC (case doesn’t matter FYI) are all on a different header file.
In DS9 I can see the header labeled ‘imagename.fits[xy00]’ and I have tried changing that trailing ‘[0]’ to ‘[1]’ and ‘[xy00]’ to no avail.

Has anyone ever dealt with this before?

This is an ImageFileCollection you have created from your files?
I think by default this will only even include the headers from the first section (HDU) of each file. Have you tried constructing it with the ext=n to load another HDU than #0?
I don’t think it is possible to combine the headers from several different HDUs though.

Thanks for the reply!! Could you show me the syntax for using ‘ext=n’?
And yes this is an ImageFileCollection from a directory of images.
It would be okay even if I didn’t combine them, I just need to access both even separately to group images and stuff.

If you have used files=ImageFileCollection(directory=mydir), just change this to
files=ImageFileCollection(directory=mydir, ext=1) (keeping any other options the same) to get the headers from all 1st extensions.

1 Like

Okay, that does work! And of course, sadly, I am now unable to have the first header’s information in the table… I guess I could make two collections and use them both to group on. I don’t immediately see a problem with that, but I’m sure it will bite me down the pipeline!

Again, I really appreciate it!