IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39588 for trunk


Ignore:
Timestamp:
May 28, 2016, 5:06:23 PM (10 years ago)
Author:
eugene
Message:

add pm foreward and backward precess

Location:
trunk/Ohana/src/libdvo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/include/dvo.h

    r39531 r39588  
    205205  ID_OBJ_GOOD            = 0x02000000, // good-quality measurement in our data (eg,PS)
    206206  ID_OBJ_GOOD_ALT        = 0x04000000, // good-quality measurement in  external data (eg, 2MASS)
    207   ID_OBJ_GOOD_STACK      = 0x08000000, // good-quality object in the stack (>= 1 good stack)
     207  ID_OBJ_GOOD_STACK      = 0x08000000, // good-quality object in the stack (> 1 good stack)
    208208  ID_OBJ_BEST_STACK      = 0x10000000, // the primary stack measurement are the best measurements
    209209  ID_OBJ_SUSPECT_STACK   = 0x20000000, // suspect object in the stack (> 1 good or suspect stack, < 2 good)
     
    226226  ID_SECF_RANK_3        = 0x00000800, // average magnitude uses rank 3 values
    227227  ID_SECF_RANK_4        = 0x00001000, // average magnitude uses rank 4 values
    228   ID_SECF_OBJ_EXT_PSPS  = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits
     228  ID_SECF_OBJ_EXT_PSPS  = 0x00002000, // In PSPS ID_SECF_OBJ_EXT is moved here so it fits within 16 bits 
    229229  ID_SECF_STACK_PRIMARY = 0x00004000, // PS1 stack photometry comes from primary skycell
    230230  ID_SECF_OBJ_EXT       = 0x01000000, // extended in this band
     
    11921192// galaxy_model:
    11931193int TransformProperMotion_radians (double *uR, double *uD, double uL, double uB, double Rrad, double Drad, CoordTransform *transform);
    1194 int TransformProperMotion (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform);
     1194int TransformProperMotionForewards (double *uL, double *uB, double uR, double uD, double R, double D, CoordTransform *transform);
     1195int TransformProperMotionBackwards (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform);
    11951196int SolarMotionModel_radians (double *uL_sol, double *uB_sol, double Lrad, double Brad, double distance);
    11961197int SolarMotionModel (double *uL_sol, double *uB_sol, double L, double B, double distance);
  • trunk/Ohana/src/libdvo/src/galaxy_model.c

    r37807 r39588  
    6161}
    6262
    63 // Use the inverse transform: CELESTIAL->GALACTIC for uL,uB -> uR,uD
    64 int TransformProperMotion (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform) {
     63// Use with the forward transformation: CELESTIAL->GALACTIC for uR,uD -> uL,uB
     64int TransformProperMotionForewards (double *uL, double *uB, double uR, double uD, double R, double D, CoordTransform *transform) {
     65
     66  double Rrad = R*RAD_DEG;
     67  double Drad = D*RAD_DEG;
     68
     69  // C1, C2 are from http://arxiv.org/pdf/1306.2945v2.pdf
     70  double C1 =
     71    cos(Drad)*transform->cos_phi +
     72    sin(Drad)*cos(Rrad)*transform->sin_phi_sin_Xo -
     73    sin(Drad)*sin(Rrad)*transform->sin_phi_cos_Xo;
     74
     75  double C2 =
     76    - cos(Rrad)*transform->sin_phi_cos_Xo
     77    - sin(Rrad)*transform->sin_phi_sin_Xo;
     78
     79  double cosBinv = 1.0 / sqrt(C1*C1 + C2*C2);
     80
     81  // XXX add errors : I need to be able to choose the stars based on the error distribution
     82  *uL = cosBinv * (C1 * uR + C2 * uD);
     83  *uB = cosBinv * (C1 * uD - C2 * uR);
     84
     85  return TRUE;
     86}
     87
     88// Use with the forward transformation: CELESTIAL->GALACTIC for uL,uB -> uR,uD
     89int TransformProperMotionBackwards (double *uR, double *uD, double uL, double uB, double R, double D, CoordTransform *transform) {
    6590
    6691  double Rrad = R*RAD_DEG;
     
    85110  return TRUE;
    86111}
     112
    87113int TransformProperMotion_radians (double *uR, double *uD, double uL, double uB, double Rrad, double Drad, CoordTransform *transform) {
    88114
Note: See TracChangeset for help on using the changeset viewer.