On Nov 28, 2010, at 10:25 PM, David Berry wrote:
> On 26 November 2010 21:22, Tim Jenness <[log in to unmask]> wrote:
>> On Nov 25, 2010, at 10:21 PM, David Berry wrote:
>>
>>
>>
>>>> think this question is different to whether mapping to a bigger type should
>>>> translate bad values since you don't get a bad status then.
>>>>
>>>> I assume that ARY maps in the native format regardless and then does the
>>>> conversion itself so ARY won't care what HDS does when mapping with a
>>>> different type. I assume this is the case because neither ARY nor NDF trap
>>>> DAT__CONER.
>>>>
>>>> Sounds like everyone wants me to trap DAT__CONER in SMURF and assume that
>>>> the error is from a bad value shrinkage.
>>>
>>> Or map with the native type and then use VEC to do the conversion?
>>>
>>
>> Yes. But that's real work in sc2store.c
>
> I'm probably not following things, but is it not just a case of
> calling datType to get the native type and then calling a suitable
> VEC_ function to convert to the type you want?
>
1. VEC doesn't have a C wrapper
2. Mapping of JCMTSTATE is all done in nice macros
3. I've got it working by trapping DAT__CONER.
> (this is all happening because I shrunk the JCMTState struct integer
> entries but I still need to read old data and SOME of that old data
> used bad values when the SMU is inactive). I know in sc2store.c that
> SMU_JIG_INDEX is never going to go out of range unless it's a
> VAL__BADI.
>>
>>> I suppose another option would be to add a new attribute to each HDS
>>> primitive saying whether to check for bad values or not, but this
>>> sounds like a lot of work.
>>
>> Since this is only an issue during data conversion the easiest would be to have a tuning parameter to indicate whether bad values should be retained on conversion.
>
> It's up to you. The only thing I would say is to be careful not to
> affect the way HDS handles data that uses the VAL__BADx value as a
> literal numerical value rather than as a magic value.
Remember that on shrinkage (eg DOUBLE to REAL or INTEGER to WORD) the output variable has already been set to the bad value so the issue was whether to set error state or not.
--
Tim Jenness
Joint Astronomy Centre
|