Hi Peter.
Thanks for the response. The command works in the direction that I can
already do, but doesn't give the right answer in the reverse direction
asttrann this=a20080301_00042_01_0001 forward=t posin='"1993,1,2008.2"'
10.1966515399 1 0.34544201875006
index 1993 corresponds to 10.19 kms-1, but if I try the reverse (the
one I am looking for)
asttrann this=a20080301_00042_01_0001 forward=t posin='"10.19665,1,2008.2"'
120.34833752056 1 0.34544201875006
I don't get back the 1993 index (it is presumably doing the same
transformation again), Changing the forward flag to false causes an
error which looks like the error that wcstran was fond of giving
asttrann this=a20080301_00042_01_0001 forward=f posin='"10.19665,1,2008.2"'
!! AST: Error in routine AST_TRANN.
! astTranN(FrameSet): An inverse coordinate transformation is not defined by
! the FrameSet supplied.
! Error transforming a set of N-dimensional positions.
! Application exit status AST__TRNND, coordinate transformation not defined
! this=a20080301_00042_01_0001 forward=f posin="10.19665,1,2008.2"
Is there any way to persuade the routine to work in reverse?
Cheers
Dave
On Thu, Mar 26, 2009 at 2:20 PM, Peter W. Draper
<[log in to unmask]> wrote:
> On Thu, 26 Mar 2009, David Nutter wrote:
>
>> I am trying to use wcstran to find the index of a 3D data cube that
>> corresponds to a particular velocity/frequency. I can do this in
>> reverse, and convert the array index (in this case 2185) to a velocity
>> (VRAD) using:
>>
>> wcstran a20080301_00042_01_0001 framein=axis posin=\"2185,5,5\"
>> frameout=DSBSPECTRUM-SPACEINDEX-TIME
>>
>> a1 = 2185.0 a2 = 5.0 a3 = 5.0 --> VRAD = -0.4973992 x2 = 5.5
>> MJD = 2008-03-01 07:41:24
>>
>> However, I cannot get the grammar quite right for the other way. e.g.
>>
>> wcstran a20080301_00042_01_0001 framein=DSBSPECTRUM-SPACEINDEX-TIME
>> frameout=pixel posin=\"-0.4973992,5.5,2008-03-01 07:41:24\"
>>
>> !! Extra characters ' 07:41:24' found at end of date/time value supplied
>> for
>> ! parameter POSIN - '-0.4973992 5.5 2008-03-01 07:41:24'.
>> Please supply a new DSBSPECTRUM-SPACEINDEX-TIME Domain position for
>> parameter POSIN.
>> POSIN - Position to be transformed /'-0.4973992,5.5,2008-03-01 07:41:24'/
>> >
>>
>> The error seems to revolve around the format of the TIME coord (which
>> is especially annoying, because I don't care what the time was, it
>> makes no difference)
>>
>> If anyone could tell me how to resolve this, or suggest an alternative
>> way of getting the index of a given velocity/frequency, I would be V.
>> grateful for the info.
>
> Hi Dave,
>
> you'll have more success if you use a decimal number for the years, but for
> a timeseries cube I couldn't get that to work either (the error message
> claimed the inverse transformation wasn't defined). Try:
>
> % atools
> % asttrann this=a20080301_00042_01_0001 forward=t \
> posin='"-0.4973992,5.5,2008.25"'
>
> (2008.25 is just a guesstimate) instead. That did work for me.
>
> Peter.
>
|