[daip] Absolute to offset coordinates

Eric Greisen egreisen at nrao.edu
Wed Oct 22 17:34:59 EDT 2014


On 10/22/2014 02:03 PM, Andy Biggs wrote:
> Hi Eric. I have a question about the calculation of the r.a. difference
> between two source positions. For this one needs to know the
> declination, but which one to use has always confused me. I always
> follow the AIPS convention and use the declination of the position that
> one is shifting from. However, I have also seen people take the average
> of the two declinations.
>
> Is there a hard and fast rule about how to do this? I ask as the ALMA
> Observing Tool is doing the absolute to offset (from a reference
> position) coordinate conversion incorrectly. I want to clear this
> declination uncertainty up before I tell them what to do.
>
> Cheers,
>
> Andy
>

I don't understand what the situation is so I do not know how to answer.

If you have 2 pixel positions in an image and want to know the RA 
difference you really have to convert the pixel coordinates into proper 
RA,Dec values using the full coordinate projection information.  Thus 
pixel size, projection type, reference coordinates, rotation, etc all 
enter into the computation.

If someone is saying source 1 is at RA,Dec such and so and source 2 is x 
arc minutes away, the computation is also messy.  The inverse - given 2 
Ra,Dec coords what is the difference (verb IMDIST) the code looks like

C                                       small angles (< 0.1 asec)
       IF ((ABS(RA1-RA2).LT.5.D-7) .AND. (ABS(DEC1-DEC2).LT.5D-7)) THEN
          DD = SQRT (((RA1-RA2)*COS(DEC1))**2 + (DEC1-DEC2)**2)
       ELSE
          DD = SIN(DEC1)*SIN(DEC2) + COS(DEC1)*COS(DEC2)*COS(RA1-RA2)
          DD = MAX (-1.0D0, MIN (1.0D0, DD))
          DD = ACOS (DD)
          END IF
and the angle is
       ST = 0.0D0
       IF (DD.NE.0.0D0) THEN
          ST = SIN (RA2-RA1) * COS (DEC2) / SIN (DD)
          ST = MAX (-1.0D0, MIN (1.0D0, ST))
          CT = (SIN(DEC2)*COS(DEC1) - COS(DEC2)*SIN(DEC1)*COS(RA2-RA1))
      *       / SIN(DD)
C         ST = RAD2DG * ASIN (ST)
          ST = RAD2DG * ATAN2 (ST, CT)
          END IF

A full spherical trig computation.

For UV data, we use RASHIFT referenced to the reference declination at 
all times (not any other dec in the field) but the center RA,Dec of each 
facet is still computed by messier formulae...

Cheers

Eric



More information about the Daip mailing list