IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 30, 2021, 3:01:24 PM (5 years ago)
Author:
eugene
Message:

add z component option to parallax factor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.astro/astrom_ops.c

    r39610 r41748  
    4141}
    4242
     43/* given RA, DEC, Time, calculate the parallax factor */
     44// RA,DEC are decimal degrees
     45// Time is MJD
     46int ParFactor_3d (double *pR, double *pD, double *pZ, double RA, double DEC, double Time) {
     47
     48  double lambda, beta, epsilon, Radius;
     49
     50  // Time must be mjd
     51  sun_ecliptic (Time, &lambda, &beta, &epsilon, &Radius);
     52
     53  double lambda_rad = lambda*RAD_DEG;
     54  double epsilon_rad = epsilon*RAD_DEG;
     55  double RA_rad = RA*RAD_DEG;
     56  double DEC_rad = DEC*RAD_DEG;
     57
     58  double x = Radius*cos(lambda_rad);
     59  double y = Radius*cos(epsilon_rad)*sin(lambda_rad);
     60  double z = Radius*sin(epsilon_rad)*sin(lambda_rad);
     61
     62  *pR = +(y*cos(RA_rad) - x*sin(RA_rad));
     63  *pD = -(y*sin(RA_rad) + x*cos(RA_rad))*sin(DEC_rad) + z*cos(DEC_rad);
     64  *pZ = -(y*sin(RA_rad) + x*cos(RA_rad))*cos(DEC_rad) + z*sin(DEC_rad);
     65
     66  return TRUE;
     67}
     68
    4369// allocate arrays but not the container
    4470int PlxFitDataAlloc (PlxFitData *data, int N) {
Note: See TracChangeset for help on using the changeset viewer.