IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8242


Ignore:
Timestamp:
Aug 8, 2006, 3:51:28 PM (20 years ago)
Author:
eugene
Message:

added the ZPL type (ZEA + polynomial)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libdvo/src/coordops.c

    r8127 r8242  
    2020  type = &coords[0].ctype[4];
    2121 
    22   /* DIS is equiv to TAN with higher order terms
    23      PLY is cartesian with higher order terms
     22  /* PLY is equiv to LIN with higher order terms
     23     ZPL is equiv to ZEA with higher order terms
     24     DIS is equiv to TAN with higher order terms
    2425     WRP is equiv to PLY, with implied mosaic */
    2526
    26   Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP");
     27  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP") || !strcmp(type, "-ZPL");
    2728  Cartesian  = !strcmp(type, "-LIN") || !strcmp(type, "-PLY") || !strcmp(type, "-WRP") || !strcmp(&coords[0].ctype[0], "GENE");
    2829  PseudoCyl  = !strcmp(type, "-AIT") || !strcmp(type, "-GLS") || !strcmp(type, "-PAR");
    2930  Zenith1    = !strcmp(type, "-DIS") || !strcmp(type, "-TAN") || !strcmp(type, "-STG");
    3031  Zenith2    = !strcmp(type, "-SIN") || !strcmp(&coords[0].ctype[0], "MM");
    31   Zenithal   = !strcmp(type, "-ZEA") || Zenith1 || Zenith2;
     32  Zenithal   = !strcmp(type, "-ZEA") || !strcmp(type, "-ZPL") || Zenith1 || Zenith2;
    3233  if (!Zenithal && !Cartesian && !PseudoCyl) return (FALSE);
    3334
     
    9091      stht = sqrt (1 - ctht*ctht);
    9192    }
    92     if (!strcmp(type, "-ZEA")) {
     93    if (!strcmp(type, "-ZEA") || !strcmp(type, "-ZPL")) {
    9394      stht = 1 - 0.5*SQ(R*RAD_DEG);
    9495      ctht = sqrt (1 - stht*stht);
     
    166167  L = M = 0;
    167168
    168   Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP");
     169  Polynomial = !strcmp(type, "-PLY") || !strcmp(type, "-DIS") || !strcmp(type, "-WRP") || !strcmp(type, "-ZPL");
    169170  Cartesian  = !strcmp(type, "-LIN") || !strcmp(type, "-PLY") || !strcmp(type, "-WRP") || !strcmp(&coords[0].ctype[0], "GENE");
    170171  PseudoCyl  = !strcmp(type, "-AIT") || !strcmp(type, "-GLS") || !strcmp(type, "-PAR");
    171172  Zenith1    = !strcmp(type, "-DIS") || !strcmp(type, "-TAN") || !strcmp(type, "-STG");
    172173  Zenith2    = !strcmp(type, "-SIN") || !strcmp(&coords[0].ctype[0], "MM");
    173   Zenithal   = !strcmp(type, "-ZEA") || Zenith1 || Zenith2;
     174  Zenithal   = !strcmp(type, "-ZEA") || !strcmp(type, "-ZPL") || Zenith1 || Zenith2;
    174175  if (!Zenithal && !Cartesian && !PseudoCyl) return (FALSE);
    175176
     
    209210      M = -DEG_RAD * cphi;
    210211    }
    211     if (!strcmp(type, "-ZEA")) {
     212    if (!strcmp(type, "-ZEA") || !strcmp(type, "-ZPL")) {
    212213      Rc = DEG_RAD * M_SQRT2 / sqrt (1 + stht);
    213214      L =  Rc * sphi;
     
    253254  /** extra polynomial terms **/
    254255  if (Polynomial) {
    255     for (i = 0; i < 3; i++) {
     256    for (i = 0; i < 10; i++) {
    256257      Lo = (X*coords[0].pc1_1 + Y*coords[0].pc1_2);
    257258      Mo = (X*coords[0].pc2_1 + Y*coords[0].pc2_2);
     
    266267      dL = (L - Lo);
    267268      dM = (M - Mo);
     269      // fprintf (stderr, "%d: %f,%f : %f,%f : %f,%f : %f,%f\n", i, L, M, X, Y, Lo, Mo, dL, dM);
    268270
    269271      X += determ * (coords[0].pc2_2*dL - coords[0].pc1_2*dM);
    270       Y += determ * (coords[0].pc1_1*dM - coords[0].pc2_1*dL);
     272      Y += determ * (coords[0].pc1_1*dM - coords[0].pc2_1*dM);
    271273    }
    272274  }
Note: See TracChangeset for help on using the changeset viewer.