Ignore:
Timestamp:
01/06/17 11:51:27 (8 years ago)
Author:
tbretz
Message:
Updated to PAL 0.9.7 (adds mainly light deflection to abberation which was previously missing)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/pal/palMapqkz.c

    r18347 r18712  
    2525*        Star-independent mean-to-apparent parameters (see palMappa):
    2626*        (0-3)    not used
    27 *        (4-6)    not used
     27*        (4-6)    heliocentric direction of the Earth (unit vector)
    2828*        (7)      not used
    2929*        (8-10)   abv: barycentric Earth velocity in units of c
    30 *        (11)     sqrt(1-v**2) where v=modulus(abv)
     30*        (11)     sqrt(1-v^2) where v=modulus(abv)
    3131*        (12-20)  precession/nutation (3,3) matrix
    3232*     ra = double * (Returned)
     
    5050*     The corresponding function for the case of non-zero parallax
    5151*     and proper motion is palMapqk.
    52 *
    53 *     The reference systems and timescales used are IAU 2006.
    54 *
    55 *     Strictly speaking, the function is not valid for solar-system
    56 *     sources, though the error will usually be extremely small.
     52
     53*  Notes:
     54*     - The reference systems and timescales used are IAU 2006.
     55*     - The mean place rm, dm and the vectors amprms[1-3] and amprms[4-6]
     56*       are referred to the mean equinox and equator of the epoch
     57*       specified when generating the precession/nutation matrix
     58*       amprms[12-20].  In the call to palMappa (q.v.) normally used
     59*       to populate amprms, this epoch is the first argument (eq).
     60*     - The vector amprms(4-6) is referred to the mean equinox and
     61*       equator of epoch eq.
     62*     - Strictly speaking, the routine is not valid for solar-system
     63*       sources, though the error will usually be extremely small.
     64*       However, to prevent gross errors in the case where the
     65*       position of the Sun is specified, the gravitational
     66*       deflection term is restrained within about 920 arcsec of the
     67*       centre of the Sun's disc.  The term has a maximum value of
     68*       about 1.85 arcsec at this radius, and decreases to zero as
     69*       the centre of the disc is approached.
    5770
    5871*  Authors:
     
    100113/* Local Variables: */
    101114   int i;
    102    double ab1, abv[3], p[3], w, p1dv, p1dvp1, p2[3], p3[3];
     115   double ab1, abv[3], p[3], w, p1dv, p2[3], p3[3];
     116   double gr2e, pde, pdep1, ehn[3], p1[3];
    103117
    104118/* Unpack scalar and vector parameters. */
    105119   ab1 = amprms[11];
     120   gr2e = amprms[7];
    106121   for( i = 0; i < 3; i++ ) {
    107122      abv[i] = amprms[i+8];
     123      ehn[i] = amprms[i+4];
    108124   }
    109125
     
    111127   eraS2c( rm, dm, p );
    112128
     129/* Light deflection (restrained within the Sun's disc) */
     130   pde = eraPdp( p, ehn );
     131   pdep1 = pde + 1.0;
     132   w = gr2e / ( pdep1 > 1.0e-5 ? pdep1 : 1.0e-5 );
     133   for( i = 0; i < 3; i++) {
     134      p1[i] = p[i] + w * ( ehn[i] - pde * p[i] );
     135   }
     136
    113137/* Aberration. */
    114    p1dv = eraPdp( p, abv );
    115    p1dvp1 = p1dv + 1.0;
     138   p1dv = eraPdp( p1, abv );
    116139   w = 1.0 + p1dv / ( ab1 + 1.0 );
    117140   for( i = 0; i < 3; i++ ) {
    118       p2[i] = ( ( ab1 * p[i] ) + ( w * abv[i] ) ) / p1dvp1;
     141      p2[i] = ( ( ab1 * p1[i] ) + ( w * abv[i] ) );
    119142   }
    120143
Note: See TracChangeset for help on using the changeset viewer.