Ed,
On Fri, 6 Jan 2006, Edward Chapin wrote:
> I'm not sure if this is related, but I noticed that RA was coming up as a
> negative number as well (the correct number as in this case, just not on
> the interval 0-24 hr) when I was modifying the scuba2 data simulator code.
>
> To summarize how I got it to happen: I have a centre RA, Dec for the
> simulated telescope pointing, and a series of tangent plane offsets from
> that pointing centre. If you recall I was writing code to take those
> offsets and do the tanplane -> spherical coordinate transformation. I
> first created a frameset (fs) to do the transformation by specifying WCS
> fits channels and using astRead. I used astTran2 to get the spherical
> coordinates from the offsets:
>
> astTran2( fs, 1, &xi, &eta, 1, &this_ra, &this_dec );
>
> The spherical coordinates of the tangent point used to make fs are in the
> normal domain (positive values), and xi/eta are both positive and negative
> (small) offsets. this_ra came up as negative (but as I mentioned it was
> the correct value).
>
> cheers,
> Ed
In general, there is no guarantee that astTran... will produce RA and Dec
values in the usual ranges. There are many situations where it is not
necessary to do this extra normalisation, and so AST leaves it up to the
caller to decide whether it is necessary or not. The astNorm method
should be called after astTran... if you want to ensure that the values
are normalised.
astNorm is a method on the Frame class, but since FrameSet inherits from
Frame you can also use it on a FrameSet (in which case the behaviour is as
if you had called astNorm on the current Frame in the FrameSet).
David
|