If a structure is empty, then it would seem to me that the appropriate
thing to do would be for DAT_NCOMP to return zero without error.
However, since the existing behaviour is presumably of great antiquity,
there may be an argument for leaving it as it is in case there is code out
there which depends on the current bahaviour.
The safer though less pleasing solution would be to modify IRA_FIND
to annul the DAT__OBJIN error returned by DAT_NCOMP, and skip the
structure.
David
On Fri, 4 Nov 2005, Tim Jenness wrote:
> I'm having trouble running kappa tasks on SCUBA-2 simulation files.
>
> eg:
>
> $ stats SA00001
> !! DAT_NCOMP: Error enquiring the number of components in an HDS
> structure.
> ! IRA_FIND: Unable to locate astrometry information within
> ! /Users/timj/work/scuba2/jac/soft/smurf/SA00001
> ! STATS: Error computing simple statistics for an NDF's pixels.
> ! Application exit status DAT__OBJIN, Object invalid
> ! SA00001
>
> The problem is with this part of the NDF:
>
> MORE
> SCUBA2(600) <SCUBA2_RTS_ARR> {array of structures}
>
> Contents of SCUBA2(1)
> {structure is empty}
>
>
> The problem is that ira_find notices that .SCUBA2 is a structure
> component and then calls DAT_NCOMP to see how many components there are in
> it. DAT_NCOMP throws up its hands in horror and causes IRA_FIND to give up
> looking for astrometry information.
>
> The real question is whether DAT_NCOMP really should set status to bad or
> whether IRA_FIND should be a bit cleverer before calling DAT_NCOMP.
>
> In reality this extension will be either defined or absent but it seems to
> be a bug that KAPPA fails to work because an unrelated structure is not
> defined.
>
> --
> Tim Jenness
> JAC software
> http://www.jach.hawaii.edu/~timj
>
|