2009/4/23 tim.jenness <[log in to unmask]>:
> On Apr 22, 2009, at 12:35 PM, Chris Tinney wrote:
>
>> Hi Tim,
>>
>> it would appear that the problem arises when the ATOOLS monolith is
>> called in the IRIS2/_APPLY_DISTORTION_TRANSFORMATION_ primitives to use
>> various functions (most notably astcmpmap but almost certainly anything
>> that tries to read a text file will have a problem). I'd guess the same
>> problem would arise if anyone tried to use the very similar ISAAC
>> primitives.
>>
>> These primitives read and write text files that define AST astrometric
>> transformations with the extension .txt. However the ATOOLS routines
>> appear
>> to be able to read these AST definitions in either text OR NDF format
>> (though
>> in this case the NDF format that is relevant is simply the hierarchical
>> definition of a bunch of numbers ... not an actual image).
>>
>> I am assuming they read these files using some standard HDS calls, which
>> in
>> recent versions have been 'upgraded' to try and 'auto-magically' convert
>> to NDF
>> on the fly if required. In this case, this 'convenience' is a problem. If
>> the file
>> is text it needs to be read as plain text. If its NDF it needs to be read
>> as NDF.
>> It can't be converted, because the conversion specifically ONLY works on
>> the image
>> portion of a text file, and the AST routine NDF files HAVE no image
>> portion - only
>> a hierarchical 'header'
>>
>
> It all hinges on the behaviour of the NDF_EXIST call in KPG1_GTOBJ.
> NDF_EXIST was modified explicitly to attempt to convert files automatically
> to NDF:
>
> * 13-OCT-1993 (RFWS):
> * Changed to allow conversion of foreign format files on input.
>
> so I'm surprised that people have not come across this interaction of ATOOLS
> and CONVERT earlier (or not, depending on how popular you believe ATOOLS to
> be). Interestingly, ATL_GTGRP (called by KPG1_GTOBJ is NDF_EXIST fails)
> supposedly recognizes fits files but I assume that will also fail if CONVERT
> has been initialised. Some reworking of KPG1_GTOBJ to look for text or fits
> before NDF might work.
>
>> Possible solutions would be.
>>
>> 1. Is there a way to turn off this automagic conversion? If so, do so
>> within ORACDR.
>
> ORAC-DR could delete the relevant environment variable at startup if that
> was the only way to handle it.
>
>> 2. Change the files the recipes/primtives read/write to have an extension
>> (say .lis or .tmp or .anything) that does NOT try to get automagically
>> converted.
>
> that would also seem to work. The opening lines of
> _DEFINE_DISTORTION_TRANSFORMATION_ do use a .lis suffix.
>
>> 3. Have a version of the HDS call that specifically does NOT allow
>> automagic
>> conversion, and have the ATOOLS routines call that. Because an
>> automagically
>> converted version of the text file will NEVER be a legitimate AST NDF.
>
>
> NDF_EXIST has to be able to respond in the same way as NDF_ASSOC so the
> conversion behaviour can't be modified. A new routine would be needed.
Except that you can programatically disable foreign format conversion
by setting the NDF tuning parameter "DOCVT" before calling NDF_EXIST
(always remembering to reset it again afterwards). I've modified
KPG1_GTOBJ to do this.
David
> There is an option #4 which is what we should be using now:
>
> 4. Do all the frameset manipulation natively in the primitive using the
> Starlink::AST perl module.
>
> This has the advantage of being less complicated and significantly more
> efficient than the atools version. All new primitives do all the frameset
> creation this way.
>
> --
> Tim Jenness
>
|