IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 18, 2009, 10:44:35 AM (17 years ago)
Author:
eugene
Message:

for single chips, need to force fpa-to-tpa tranformation to have no rotation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryWCS.c

    r25324 r25876  
    670670    wcs->crval2 = fpa->toSky->D*PS_DEG_RAD;
    671671
     672    // generate a transform that has 0.0 rotation:
     673    // get the current posangle of the ref chip
     674    // XXX average angles for x and y...
     675    float angle = atan2 (toTPA->y->coeff[1][0], toTPA->x->coeff[1][0]);
     676    // fprintf (stderr, "angle: %f\n", angle*PS_DEG_RAD);
     677    psPlaneTransform *tpa1 = psPlaneTransformRotate (NULL, toTPA, angle);
     678
    672679    // given transformation, solve for coordinates which yields output coordinates of 0,0
    673     psPlane *center = psPlaneTransformGetCenter (toTPA, tol);
     680    psPlane *center = psPlaneTransformGetCenter (tpa1, tol);
    674681    if (!center) {
    675682        psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center.");
     
    679686    }
    680687
     688    // generate transform with the original orientation (does this rotate about 'center'?)
     689    psPlaneTransform *tpa2 = psPlaneTransformRotate (NULL, tpa1, -1.0*angle);
     690
     691    // prove that the center coordinates give 0,0:
     692    // float Xo = psPolynomial2DEval (tpa1->x, center->x, center->y);
     693    // float Yo = psPolynomial2DEval (tpa1->x, center->x, center->y);
     694    // fprintf (stderr, "tpa1: Xo, Yo: %f, %f\n", Xo, Yo);
     695
     696    // prove that the center coordinates give 0,0:
     697    // Xo = psPolynomial2DEval (tpa2->x, center->x, center->y);
     698    // Yo = psPolynomial2DEval (tpa2->x, center->x, center->y);
     699    // fprintf (stderr, "tpa2: Xo, Yo: %f, %f\n", Xo, Yo);
     700
    681701    // create wcs transform from toFPA, resulting transformation has units of microns/pixel
    682702    // adjust wcs transform to use center as reference coordinate
    683     psPlaneTransformSetCenter (wcs->trans, toTPA, center->x, center->y);
     703    psPlaneTransformSetCenter (wcs->trans, tpa2, center->x, center->y);
    684704
    685705    // calculated center is crpix1,2
     
    687707    wcs->crpix2 = center->y;
    688708    psFree (center);
     709    psFree (tpa1);
     710    psFree (tpa2);
    689711
    690712    // pdelt1,2 has units of degrees/micron
Note: See TracChangeset for help on using the changeset viewer.