#116 closed defect (fixed)
Coordinate Transformations
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | IPP-doc |
| Cc: |
Description
The SDRS states that the functions:
psSphereTransformICRStoEcliptic(void)
psSphereTransformEcliptictoICRS(void)
psSphereTransformICRStoGalatic(void)
psSphereTransformGalatictoICRS(void)
simply create a sperical transform struct and set the appropiate values.
The ADD states that these functions shall wrap various SLALIB functions.
However, the specified SLALIB function map a specific point in one coordinate
system to a specific point in another coordinate system. They do not
provide the parameters of that coordinate transform. Can you clarify how we
are to implement the above functions using those SLALIB functions?
Section 5.3.3 of the SDRD specifies a list of "projection types". The
following projection types are not defined in the ADD:
PS_PROJ_PAR
PS_PROJ_GLS
During a previous polycon, it was decided that angles shall be in radians,
not degrees. However, the the formulas for the various projections in
section 1.2.3 of the ADD assume angles are in degrees.
Can you specify an algorithm for psSphereTransformApply()?
psSphereSetOffset() and psSphereGetOffset(): the explanation "A linear
offset is defined to be a linear offset in a tanget projection centered on
the starting coordinate with y axis aligned with the local direction or
increasing Declination" is unintelligible to me. The psuedo-code in the ADD
does not seem quite right, but I don't understand the topic well enough to
be sure. It seems to me that the offset should be added to the position,
somehow. However, I don't see that this is being done. I've implemented
the psuedo-code almost exactly. Can you verify that this is correct? Also,
what does the following mean "the given offsets must the scaled based on the
given offset units".
Can you help us with test points for these functions? Without the
astronomical background to know what the different coordinate systems are, I
can't really tell if my implementations are correct.
Attachments (1)
Change History (15)
comment:1 by , 22 years ago
| bug_group: | PSLib? → IPP-doc? |
|---|---|
| Component: | astro → PSLib SDRS |
| Keywords: | IPP-doc added; PSLib removed |
| op_sys: | Linux → All |
| Owner: | changed from to |
| product: | PSLib → IPP-doc |
| rep_platform: | PC → All |
comment:2 by , 22 years ago
| Status: | new → assigned |
|---|
comment:3 by , 22 years ago
1) I specified the coefficients for the specific tranforms, but not the generic
psSphereTransformAlloc. I will update the ADD
2) psSphereTransformApply algorithm also specified in previous post
3) ADD 1.2.3: I will correct the formulae in the ADD, but the general
substitution is to simply remove the terms of the form (180/pi) and conver the
45deg to pi/4, etc.
3) I'll get the PAR and GLS in the ADD.
4) (there is a typo in the quoted ADD bit pasted in: 'local direction OF
increasing Declination'. not that this make it crystal clear). the point here
is that the linear offset means a linear offset in some tangent-plane projection
(since linear has no meaning on the sky). So, to implement that, the
pseudo-code takes the starting position, pos, and contructs a projection with a
center coordinate corresponding to this position. The projection should have an
appropriate scale, probably Xs = Ys = 1.0 (ie, radians). Then, the offset needs
to be scaled based on the value of the entry unit (ie, if the value of unit is
PS_DEGREE, the offset values are assumed to be in units of degrees. in which
case they should be multiplied by (pi/180) to convert to radians. Setting the
coordinate of lin.x,y to the scaled offset coordinates is defining a point (x,y)
offset relative to the center of the projection, ie the starting coordinate
(pos.r,d) Performing the function psDeproject () then calculates the coordinate
in the spherical system of the point in the projected plane, which is the
coordinate you want.
comment:4 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
projection formulae corrected in SDRS; PAR added to ADD; GLS dropped from
requirements.
comment:5 by , 22 years ago
| Owner: | changed from to |
|---|
by , 22 years ago
Perl program that does coordinate conversions from RA,Dec to Galactic or Ecliptic
comment:6 by , 22 years ago
I've fleshed out the ADD some more, and in the process I wrote a little perl
script, which I will attach here. The revised section from the ADD follows.
Note that some sines and cosines have switched around.
The relevant trigonometric relationships are:
%
\begin{eqnarray}
\sin \theta = \sin \delta \cos \delta_p - \cos \delta
\sin \delta_p \sin (\alpha - \alpha_p)
\cos \theta \sin (\phi - \phi_p) = \cos \delta \cos \delta_p \sin (\alpha -
\alpha_p) + \sin \delta \sin \delta_p
\cos \theta \cos (\phi - \phi_p) = \cos \delta \cos (\alpha - \alpha_p)
\end{eqnarray}
%
and for the inverse transformations, the equivalent relationships are:
%
\begin{eqnarray}
\sin \delta & = & \sin \theta \cos \delta_p - \cos
\theta \sin \delta_p \sin (\phi - \phi_p)
\cos \delta \sin (\alpha - \alpha_p) & = & \cos \theta \cos \delta_p \sin (\phi
- \phi_p) + \sin \theta \sin \delta_p
\cos \delta \cos (\alpha - \alpha_p) & = & \cos \theta \cos (\phi - \phi_p)
\end{eqnarray}
Since $\theta$ and $\delta$ have domains of $-\pi/2, \pi/2$, the value
of these angles are found by applying the arcsin to the sine of these
angles ($\theta = \arcsin \sin \theta$) which is always single-valued
and defined. The value of $\alpha-\alpha_p$ may be found from
\code{atan2(y,x)}, where $y = \cos \delta \sin (\alpha - \alpha_p)$
and $x = \cos \delta \cos (\alpha - \alpha_p)$; and similarly for
$\phi-\phi_p$.
\paragraph{Galactic to ICRS}
The appropriate values, from the Hipparcos and Tycho Catalogues are:
\begin{eqnarray}
\alpha_p = 282.85948\circ
\delta_p = 62.87175\circ
\phi_p = 32.93192\circ
\end{eqnarray}
\paragraph{Ecliptic to ICRS}
The appropriate values, from Zombeck, are:
\begin{eqnarray}
\alpha_p = 0\circ
\delta_p = 23\circ27'8.26 - 46.845\, T - 0.0059\, T2 + 0.00181\, T3
\phi_p = 0\circ
\end{eqnarray}
where $T$ is the time in \tbr{Julian} centuries since 1900.
\paragraph{Suggested test cases}
$(\alpha,\delta) = (0\circ,0\circ)$ transforms to Galactic
coordinates $(l,b) = (96.337272\circ,-60.188553\circ)$, and Ecliptic
coordinates $(\lambda,\beta) = (0\circ,0\circ)$.
$(\alpha,\delta) = (0\circ,90\circ)$ transforms to Galactic coordinates
$(l,b) = (122.93192\circ,27.12825\circ)$, and Ecliptic coordinates
at J2000.0 (i.e., $T=1$), $(\lambda,\beta) =
(90\circ,66.560719\circ)$.
$(\alpha,\delta) = (180\circ,30\circ)$ transforms to Galactic
coordinates $(l,b) = (195.639488\circ,78.353806\circ)$, and Ecliptic
coordinates at J2100.0 (i.e., $T=2$), $(\lambda,\beta) =
(167.072470\circ,27.308813\circ)$.
comment:7 by , 22 years ago
| Keywords: | VERIFIED added |
|---|
Should be fixed in SDRS-07 and ADD-06 (7 September 2004).
comment:8 by , 22 years ago
| Keywords: | VERIFIED removed |
|---|
comment:9 by , 22 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
The psSphereTransform data structure has not been updated in SDR-08.
comment:10 by , 22 years ago
| Status: | reopened → assigned |
|---|
This was a while back. Can you remind me what about psSphereTransform needed to
be updated?
comment:11 by , 22 years ago
The data structure psSphereTransform which is defined on page 56 section 5.5.2
is not what was specified in bug entry 07/26/04.
Currently in SDR-08
typedef struct {
double sinNPlon; /< sin of North Pole longitude
double cosNPlon; /< cos of North Pole longitude
double sinNPlat; /< sin of North Pole latitude
double cosNPlat; /< cos of North Pole latitude
double sinZP; /< sin of First PT of Ares Ion
double cosZP; /< cos of First PT of Ares Ion
} psSphereTransform;
Bug entry 07/26/04
typedef struct {
double sinPhi; /< sin of North Pole lattitude
double cosPhi; /< cos of North Pole lattitude
double Xo; /< First PT of Ares lon
double xo; /< First PT of Ares equiv lon
} psSphereTransform;
Which is the desired structure?
comment:12 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
OK, so I'm blind... (;
The latter is the one we want --- I've updated the SDRS. It'll appear in SDRS-09.
Thanks for spotting this!
comment:13 by , 22 years ago
| Keywords: | VERIFIED added |
|---|
Closing subsequent to release of SDRS-08, ADD-07.
comment:14 by , 22 years ago
| Keywords: | VERIFIED removed |
|---|

it looks like it is easier just to implement the functions rather than call the
slalib functions. i'm attaching some sample code to calculate the sphere
transform with examples for the coefficients for the four specified
transformations. let's change the elements of the structure to:
typedef struct {
} psSphereTransform;
And use the defintions below. Note that the two psSphereTransform for Ecliptic
need to have a psTime argument since the value of phi is time dependent.
/* x,y input in radians, X,Y output in radians */
/*
*/
SphereTransform (double *X, double *Y, double x, double y, psTime time) {
}