On 25 November 2010 02:30, Tim Jenness <[log in to unmask]> wrote:
> On Nov 23, 2010, at 10:21 PM, David Berry wrote:
>
>> Do all conversions (e.g. _double -> _integer, etc) handle bad values
>> incorrectly, or is it just _integer -> _word ?
>>
>
> Confirmed. Well, it depends on the size. For example, reading a VAL__BADD into an integer fails because of the size test regardless so this is only an issue when you map something into a larger size.
>
> Mapping a _REAL into _DOUBLE ends up with all the VAL__BADRs coming out in the double array as VAL__BADR and not VAL__BADD. This seems like a bug to me. Surely the point of the bad value and the automatic type conversion is that badness will be converted?
You'd have thought so. NDF does not rely on HDS to do bad value
conversion. In ARY1_GT1x it says
* If type conversion is required, then map the data without type
* conversion, perform the type conversion explicitly and unmap the
* data.
ELSE
CALL DAT_MAP( LOC, TYPE, 'READ', 1, DIM, PNTR, STATUS )
CALL ARY1_CVT<T>( BAD, EL, TYPE, PNTR, RESULT, DCE, STATUS )
CALL ARY1_HUNMP( LOC, STATUS )
END IF
The ARY1_CVT<T> routine uses VEC_xTOy to do the conversion. So I'm
wondering why RFWS chose to use VEC_ routines rather than change
HDS...
David
> I'll fix it on Friday unless Brian stops me.
>
> --
> Tim Jenness
> Joint Astronomy Centre
>
|