IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12070


Ignore:
Timestamp:
Feb 26, 2007, 5:14:29 PM (19 years ago)
Author:
eugene
Message:

moved code to coordops.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dvo-mods-2007-02/Ohana/src/libdvo/src/coordops.update.c

    r12008 r12070  
    8686      case PROJ_ZEA:
    8787      case PROJ_ZPL:
     88        if (R > 2*DEG_RAD) {
     89          *ra = L;
     90          *dec = M;
     91          return (FALSE);
     92        }
    8893        stht = 1 - 0.5*SQ(R*RAD_DEG);
    8994        ctht = sqrt (1 - stht*stht);
     
    110115 
    111116  /**** Other Conventional Projections ****/
    112   if (mode == PROJ_MODE_ZENITHAL) {
     117  if (mode == PROJ_MODE_PSEUDOCLY) {
    113118    switch (proj) {
    114119      case PROJ_AIT:
     
    119124      delta = DEG_RAD * asin (RAD_DEG*M*Z);
    120125      break;
    121 
     126     
    122127      case PROJ_GLS:
    123128        /* L,M in degrees, alpha,delta in degrees */
     
    213218
    214219  /**** Other Standard Projections ****/
    215   if (PseudoCyl) {
    216     if (!strcmp(type, "-AIT")) {
    217       phi = RAD_DEG*(ra - coords[0].crval1);
    218       theta = RAD_DEG*(dec - coords[0].crval2);
    219       P = 1.0 + cos (theta) * cos (0.5*phi);
    220       if (P != 0.0) {
    221         A =  DEG_RAD * sqrt (2.0 / P);
    222         L =  2.0 * A * cos (theta) * sin (0.5*phi);
    223         M =  A * sin (theta);
    224       } else {
    225         L =  0.0;
    226         M =  0.0;
    227       }
    228     }
    229     if (!strcmp(type, "-GLS")) {
    230       phi = ra - coords[0].crval1;
    231       theta = dec - coords[0].crval2;
    232       L = phi * cos(RAD_DEG * theta);
    233       M = theta;
    234     }
    235     if (!strcmp(type, "-PAR")) {
    236       phi = ra - coords[0].crval1;
    237       theta = dec - coords[0].crval2;
    238       L = phi * (2.0*cos(2*RAD_DEG*theta/3.0) - 1);
    239       M = 180.0 * sin (RAD_DEG*theta/3.0);
     220  if (mode == PROJ_MODE_PSEUDOCYL) {
     221    switch (proj) {
     222      case PROJ_AIT:
     223        phi = RAD_DEG*(ra - coords[0].crval1);
     224        theta = RAD_DEG*(dec - coords[0].crval2);
     225        P = 1.0 + cos (theta) * cos (0.5*phi);
     226        if (P != 0.0) {
     227          A =  DEG_RAD * sqrt (2.0 / P);
     228          L =  2.0 * A * cos (theta) * sin (0.5*phi);
     229          M =  A * sin (theta);
     230        } else {
     231          L =  0.0;
     232          M =  0.0;
     233        }       
     234        break;
     235      case PROJ_GLS:
     236        phi = ra - coords[0].crval1;
     237        theta = dec - coords[0].crval2;
     238        L = phi * cos(RAD_DEG * theta);
     239        M = theta;
     240        break;
     241      case PROJ_PAR:
     242        phi = ra - coords[0].crval1;
     243        theta = dec - coords[0].crval2;
     244        L = phi * (2.0*cos(2*RAD_DEG*theta/3.0) - 1);
     245        M = 180.0 * sin (RAD_DEG*theta/3.0);
     246        break;
    240247    }
    241248  }
     
    261268      dL = (L - Lo);
    262269      dM = (M - Mo);
    263       // fprintf (stderr, "%d: %f,%f : %f,%f : %f,%f : %f,%f\n", i, L, M, X, Y, Lo, Mo, dL, dM);
    264270
    265271      X += determ * (coords[0].pc2_2*dL - coords[0].pc1_2*dM);
     
    273279
    274280  return (status);
    275  
    276281}
    277282
     
    651656    case PROJ_GLS:
    652657    case PROJ_PAR:
    653       return PROJ_MODEEUDOCLY;
     658      return PROJ_MODE_PSEUDOCLY;
    654659  }
    655660  return PROJ_MODE_NONE;
Note: See TracChangeset for help on using the changeset viewer.