On 19 August 2010 11:56, Matthew Smith <[log in to unmask]> wrote:
> tim.jenness wrote:
>>
>> On Aug 18, 2010, at 9:42 AM, Matthew Smith wrote:
>>
>>
>>>
>>> Thanks for your response. I am converting to fiddle with the data in
>>> python -although I think I can do that. The problem I'm having is if I do no
>>> fiddling, so just convert an ndf to fits with ndf2fits and then straight
>>> away convert it back with fits2ndf I get the error above (ie as you put it I
>>> don't get back what I started).
>>>
>>>
>>
>> That's not meant to happen but then again we weren't really expecting it
>> to be tried. I'll put it on the list of things to investigate. I'm not
>> really sure why the .MORE.JCMTSTATE extension wouldn't come back unless of
>> course your ndf2fits command is not propagating extensions (PROEXTS
>> parameter should be true).
>>
>
> Thanks for this. With PROEXTS = true (I didn't realise the default was
> False), I'm now getting the following error,
>
> !! DAT_MAP: Error mapping an HDS primitive: 'RTS_TASKS'
> ! Application exit status DAT_DIMEN, Dimensions invalid
> ! in=last.sdf
>
> I've tried changing all the parameters in ndf2fits but haven't got round the
> problem.
>>
>> I think Tom Marsh was working on an python interface to NDF so it might be
>> easier to go that route.
>>
>>
>
> I've been looking for a module to do this, and now goggling Tom Marsh I've
> found it (so Thanks again). However the online one I found can only read in
> ndf files, so may not help in this case.
>>>
>>> I'm loading it into python as I have a lot of spectra and thought it
>>> would be easier to automatically identify and mask bad baselines that
>>> haven't been masked and spikes in the data.
>>>
>>
>> Have you tried the pipeline? When you are finished I would be extremely
>> interested in finding out how your version compares to the pipeline version.
>> The pipeline spends a lot of time working on automatic baseline subtraction.
>> If your algorithm is better would you mind telling us about it?
>>
>>
>
> I've just found it, I'll try and give a go and compare the results, from
> what I've read they do fairly similar things. If my way is better -which I
> doubt I'll let you know.
>
> Thanks for all the help,
What's happening is that fits2ndf is getting the size of the JCMTSTATE
_CHAR arrays wrong. The number of elements in each _CHAR array is
being set to the correct number times the length of the character
string. For instance, if the original NDF JCMTSTATE contains
RTS_TASKS(480) <_CHAR*80> 'RTS FE_A PTCS SMU CONTROLLER CORRTASK1...'
(i.e. an array of 480 strings each of length 80 characters), then
fits2ndf is creating:
RTS_TASKS(38400) <_CHAR*80> 'RTS FE_A PTCS SMU CONTROLLER CORRTASK1...'
i.e. an array of 38400 (=480*80) strings each of length 80 characters.
Malcolm, shall I leave this one to you?
David
|