#567 closed defect (fixed)
psAberration - unclear formula
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib ADD | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
the formula for the scalar value, a, in 3.5.3.2 of the ADD for psAberration
seems unclear to me. A scalar value is divided by a vector and should result in
a scalar. Now perhaps my vector analysis might be rusty, but I'm under the
impression this would result in a vector?
Change History (12)
comment:1 by , 21 years ago
| Cc: | added |
|---|---|
| Status: | new → assigned |
comment:2 by , 21 years ago
The formula for a comes from saying the magnitude of a unit vector (r hat prime)
is one. The prallel component is mu prime, and the perpendicular component is
r perp prime. So that should be the r perp prime squared in the denominator.
comment:3 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
OK, in terms of LaTeX, it is:
a = \sqrt{(1-\mu'2)/\vec{r}_\perp2}
So it's the square of the modulus, then.
Fixed the document.
comment:4 by , 21 years ago
ok. just to verify the formulas leading to the scalar, a, i've got:
rp->r = actual->r - mu * direction->r;
rp->d = actual->d - mu * direction->d;
mu_p = mu + speed * ((mu * mu - 1.0) / (1.0 - speed * mu));
psCube* rpVector = psSphereToCube(rp);
a = sqrt( (1.0 - mu_p * mu_p) /
(sqrt(rpVector->x*rpVector->x
+ rpVector->y*rpVector->y
+ rpVector->z*rpVector->z)) );
if this is wrong, please advise. Do I need to use the cubic coordinates of
direction to calculate rp?
comment:5 by , 21 years ago
Sorry, I don't think this is correct. You want to drop the second sqrt.
You should be dividing by the square of the magnitude of the vector.
The idea is you've found the parallel component of the unit vector (mu),
and you're deriving the perpendicular component using the pythagorean theorum.
comment:6 by , 21 years ago
| Cc: | added |
|---|
Ok. So I'm dropping the second square root. How about the formula for r-perp
(rp in my code)? Can I calculate it like I did, or do I need to convert r & r-
perp to cartesian coordinates (x,y,z) before doing this calculation? I'm now
thinking that is probably the case...
comment:7 by , 21 years ago
I don't know what ->r and ->d are, but I can't think of what they might be that
would make your rp calculation correct. If you do it in Cartesian coordinates
you are safe.
comment:8 by , 21 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
I'm still having a problem in calculating a.
a = sqrt( (1 - mu_prime2) / modulus(r-perp) )
the numerator comes back negative for certain values and this obviously leads
to a problem when trying to take the square root. It seems to happen for
significantly large differences in input angles. ie, actual RA,Dec = 45,30 and
direction RA,Dec = -156, 20. I wouldn't be surprised if these cases aren't of
physical relevance to Aberration calculations, but if this is indeed the case,
the functions should explicitly limit the allowed difference between input
coordinates (I don't know what that limit would be).
comment:9 by , 21 years ago
mu prime = r hat prime dot beta hat
Both "r hat prime" and "beta hat" should be unit vectors, so that dotting them
should produce a value less than one, so that 1 - (mu prime)2 should always be
positive.
comment:10 by , 21 years ago
Not according to the ADD. At least not in reference to this question. mu-
prime must be calculated using equation (129) in the ADD because mu-prime is
used to calculate r(hat)-prime. Afterall, calculating r(hat)-prime is the goal
of this particular function.
comment:11 by , 21 years ago
I just grabbed the current CVS version of psEarthOrientation.c and looked at
psAberration. You have:
mu = acos(directionVector->x*actualVector->x +
directionVector->y*actualVector->y +
directionVector->z*actualVector->z);
The acos shouldn't be there. If v1 = (x1,y1,z1) and v2 = (x2,y2,z2), then v1
dot v2 = x1*x2 + y1*y2 + z1*z2. (Note that this is a dot product, not "*" as is
in the comments.)
That should help. Let me know if that doesn't fix everything.
comment:12 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Removing the acos seems to work. That part had been coded previously and I
didn't catch it, but that is the correct formula now. Thanks.

I expect the intention is to divide by the modulus of the vector. Ed, can you
confirm this?