IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25184


Ignore:
Timestamp:
Aug 25, 2009, 11:56:25 AM (17 years ago)
Author:
eugene
Message:

for single-level astrometry, we need to de-rotate before solving for the transform center

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090820/psModules/src/astrom/pmAstrometryWCS.c

    r24052 r25184  
    648648    wcs->crval2 = fpa->toSky->D*PS_DEG_RAD;
    649649
     650    // generate a transform that has 0.0 rotation:
     651    // get the current posangle of the ref chip
     652    // XXX average angles for x and y...
     653    float angle = atan2 (toTPA->y->coeff[1][0], toTPA->x->coeff[1][0]);
     654    // fprintf (stderr, "angle: %f\n", angle*PS_DEG_RAD);
     655    psPlaneTransform *tpa1 = psPlaneTransformRotate (NULL, toTPA, angle);
     656
    650657    // given transformation, solve for coordinates which yields output coordinates of 0,0
    651     psPlane *center = psPlaneTransformGetCenter (toTPA, tol);
     658    psPlane *center = psPlaneTransformGetCenter (tpa1, tol);
    652659    if (!center) {
    653660        psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center.");
     
    657664    }
    658665
     666    // generate transform with the original orientation (does this rotate about 'center'?)
     667    psPlaneTransform *tpa2 = psPlaneTransformRotate (NULL, tpa1, -1.0*angle);
     668
     669    // prove that the center coordinates give 0,0:
     670    // float Xo = psPolynomial2DEval (tpa1->x, center->x, center->y);
     671    // float Yo = psPolynomial2DEval (tpa1->x, center->x, center->y);
     672    // fprintf (stderr, "tpa1: Xo, Yo: %f, %f\n", Xo, Yo);
     673
     674    // prove that the center coordinates give 0,0:
     675    // Xo = psPolynomial2DEval (tpa2->x, center->x, center->y);
     676    // Yo = psPolynomial2DEval (tpa2->x, center->x, center->y);
     677    // fprintf (stderr, "tpa2: Xo, Yo: %f, %f\n", Xo, Yo);
     678
    659679    // create wcs transform from toFPA, resulting transformation has units of microns/pixel
    660680    // adjust wcs transform to use center as reference coordinate
    661     psPlaneTransformSetCenter (wcs->trans, toTPA, center->x, center->y);
     681    psPlaneTransformSetCenter (wcs->trans, tpa2, center->x, center->y);
    662682
    663683    // calculated center is crpix1,2
     
    665685    wcs->crpix2 = center->y;
    666686    psFree (center);
     687    psFree (tpa1);
     688    psFree (tpa2);
    667689
    668690    // pdelt1,2 has units of degrees/micron
Note: See TracChangeset for help on using the changeset viewer.