View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

how to access a specific aperture inside an image extension?

Paula R. T. Coelho wrote on May 10, 2006

hello,

i'm using cfitsio library to write a fits file: it contains an empty primary array (only header, no pixel) plus many image extensions. each image extension is an equispec spectrum with 4 apertures. by now i managed to write the file and everything looks ok. what is puzzling me is that if i type:

onedspec> splot yale[2]
Image line/aperture to plot (0:) (1): 3

it shows properly the 3rd aperture of the 2nd extension. but, if i try directly

onedspec> splot yale[2][*,3]

it's not necesseraly the 3rd aperture that is shown, and actually the last aperture that was answered in the previous example.

am i trying to access the aperture in the wrong way? or did i do something wrong when writing the fits?

for ploting this is not really a problem, but it concerns me when i start to execute operations with the apertures inside scripts or so.

thanks a lot
paula

Francisco Valdes wrote on May 10, 2006

Hi Paula,

The behavior you are seeing has nothing to do with data being in extensions. To access them you do exactly what you are doing; e.g.

cl> splot yale[2]

The behavior is that SPLOT is trying to be smart about what it does with an image section. It is supposed to see you want line 3 but it will also read the image without the image section so that you can through the spectrum. There is a bug, noted below, where knowledge of the last aperture from a previous execution overrides the requested image section. As indicated you can force the section to be read by first doing a flpr. This problem is specific to SPLOT and should not affect things you do in other tasks. However, there may be some more problems with using image section. In general you should try not and do this and instead use the "aperture" parameter in tasks.

As a warning, there may also be small problems with the '[]' characters from the extension specification. Most of these situation should be handled correctly but I only offer this as a possiblity. The GEMINI data formats make use of extensions in the same way as you are doing but I'm not sure if the GEMINI data reduction scripts have to do special things to handle situations where the ONEDSPEC tasks treat the [] specially.

Yours,
Frank Valdes

NUMBER: 553
MODULE: splot
SYSTEM: -V2.12.3
DATE: Tue May 16 11:08:14 MST 2006
FROM: valdes

BUG: If SPLOT is run more than once without flushing the process (flpr)
then the default aperture will be that from the last execution.
The consequence is that use of an image section to select an
aperture in a multiaperture file may not display the intended
spectrum. The workaround is to use the command "flpr" before
using an image section.

STATUS: Fixed for the next release.

Last post on May 10, 2006