Print

Print


On Wed, 13 Sep 2006, Peter W. Draper wrote:

> there's more to this problem that Mark identified than a simple setup
> issue. It seems that some ADAM tasks are no longer able to open the same
> FITS file for on-the-fly conversion more than once.
>
> Try this out (the ngc1275.fits file is in $GAIA_DIR/demodata.tar, not that
> that matters):
>
> ---------------------------------------------------------------------------
> % icl
> ICL> kappa
> blah...
> ICL> stats ../../demodata/ngc1275.fits
> Loading /export/pwda/pdraper/starlink_cvs/build/bin/kappa/kappa_mon into kappa_mon16454 (attached)
>
>    Pixel statistics for the NDF structure
>
>    and so on...
>
> ICL> stats
> NDF - Data structure to analyse /@../../demodata/ngc1275.fits/ >
> !!   Cannot access ../../demodata/ngc1275.fits
> !    Please give a new value for parameter NDF
> !
> NDF - Data structure to analyse /@../../demodata/ngc1275.fits/ > !
> !! A null group of NDFs was given for parameter NDF.
> !  STATS: Error computing simple statistics for an NDF's pixels.
> OBEYW unexpected status returned from task "kappa_mon16454", action -
> "STATS"
> ADAMERR  %PAR, Null parameter value
>
> ----------------------------------------------------------------------------

As far as I can tell this is an HDS problem rather than ARY or NDF.
Backtracking to earlier versions of ARY/NDF does not fix it. Chasing the
bug through HDS points the finger at rec_attach_file.c. When running
STATS, it is initially called in an attempt to open the fits file
directly, and correctly fails. However, the second time STATS is called,
rec_attach_file is again called to open the fits file directly and this
time it fails to report an error, leading to all sorts of subsequent
problems. This seems to be because the file is not closed after the
first invocation of rec_attach_file discovers that it is not an HDS
file. Consequently, the second call to rec_attach_file finds the file
already open, and assumes it is a legal HDS file.

I've modified rec_attach_file so that the file is closed if it is found
not to be an HDS file. This fixes the problem.

David