Changeset 25184
- Timestamp:
- Aug 25, 2009, 11:56:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090820/psModules/src/astrom/pmAstrometryWCS.c
r24052 r25184 648 648 wcs->crval2 = fpa->toSky->D*PS_DEG_RAD; 649 649 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 650 657 // given transformation, solve for coordinates which yields output coordinates of 0,0 651 psPlane *center = psPlaneTransformGetCenter (t oTPA, tol);658 psPlane *center = psPlaneTransformGetCenter (tpa1, tol); 652 659 if (!center) { 653 660 psError(PS_ERR_UNKNOWN, false, "Unable to solve for TPA center."); … … 657 664 } 658 665 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 659 679 // create wcs transform from toFPA, resulting transformation has units of microns/pixel 660 680 // adjust wcs transform to use center as reference coordinate 661 psPlaneTransformSetCenter (wcs->trans, t oTPA, center->x, center->y);681 psPlaneTransformSetCenter (wcs->trans, tpa2, center->x, center->y); 662 682 663 683 // calculated center is crpix1,2 … … 665 685 wcs->crpix2 = center->y; 666 686 psFree (center); 687 psFree (tpa1); 688 psFree (tpa2); 667 689 668 690 // pdelt1,2 has units of degrees/micron
Note:
See TracChangeset
for help on using the changeset viewer.
