Changeset 41892 for trunk/psModules/src/astrom/pmAstrometryWCS.c
- Timestamp:
- Nov 4, 2021, 6:05:18 PM (5 years ago)
- Location:
- trunk/psModules
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/astrom/pmAstrometryWCS.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules
-
trunk/psModules/src/astrom/pmAstrometryWCS.c
r41810 r41892 501 501 psPlaneTransform *toFPA; 502 502 503 int ExtraOrders = pmAstrometryGetExtraOrders(); 504 503 505 // create transformation with 0,0 reference pixel and units of degrees/pixel 504 506 toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2); … … 552 554 // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter 553 555 // XXX this only works if toTPA is at most a linear transformation 554 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY );556 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY, PS_POLYNOMIAL_ORD); 555 557 for (int i = 0; i <= toFPA->x->nX; i++) { 556 558 for (int j = 0; j <= toFPA->x->nY; j++) { … … 608 610 // as of r40806, psPlaneTransformInvert supplies the extra order (if non-linear) 609 611 psFree (chip->fromFPA); 610 chip->fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 100, 6);612 chip->fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50, ExtraOrders); 611 613 psFree (region); 612 614 … … 648 650 */ 649 651 652 int ExtraOrders = pmAstrometryGetExtraOrders(); 653 650 654 psFree (chip->toFPA); 651 655 if ((fabs(wcs->crpix1) > 0.01) || (fabs(wcs->crpix2) > 0.01)) { 652 656 chip->toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2); 653 657 } else { 654 chip->toFPA = psPlaneTransformAlloc(wcs->trans->x->nX, wcs->trans->x->nY );658 chip->toFPA = psPlaneTransformAlloc(wcs->trans->x->nX, wcs->trans->x->nY, PS_POLYNOMIAL_ORD); 655 659 656 660 // copy the toFPA x,y, transformations to the wcs version … … 668 672 // as of r40806, psPlaneTransformInvert supplies the extra order (if non-linear) 669 673 psFree (chip->fromFPA); 670 chip->fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 100, 6);674 chip->fromFPA = psPlaneTransformInvert(NULL, chip->toFPA, *region, 50, ExtraOrders); 671 675 psFree (region); 672 676 … … 700 704 // the region defines the FPA pixels covered by the tranformation 701 705 psFree (fpa->fromTPA); 702 int additional_orders = 4; // This is the number of orders that should be added.706 int additional_orders = pmAstrometryGetExtraOrders(); // This is the number of orders that should be added. 703 707 bool status = false; 704 708 int config_additional_orders = psMetadataLookupS32(&status,fpa->analysis, "ADDITIONAL_WCS_ORDERS"); … … 706 710 additional_orders = config_additional_orders; 707 711 } 708 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, region, 100, additional_orders);712 fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, region, 50, additional_orders); 709 713 return true; 710 714 } … … 739 743 // XXX require fpa->toTPA->nX == 1 740 744 741 psPlaneTransform *toTPA = psPlaneTransformAlloc(chip->toFPA->x->nX, chip->toFPA->x->nY );745 psPlaneTransform *toTPA = psPlaneTransformAlloc(chip->toFPA->x->nX, chip->toFPA->x->nY, PS_POLYNOMIAL_ORD); 742 746 743 747 for (int i = 0; i <= toTPA->x->nX; i++) { … … 958 962 } 959 963 960 psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1 );964 psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD); 961 965 962 966 if (!psPlaneTransformFit(newTrans, src, dst, 0, 0)) { … … 997 1001 PS_ASSERT_PTR_NON_NULL(inChip, NULL); 998 1002 1003 int ExtraOrders = pmAstrometryGetExtraOrders(); 1004 999 1005 if (outFPA == NULL) { 1000 1006 outFPA = inFPA; … … 1032 1038 1033 1039 // NOTE: the extraOrders value (4) should be ignored since outToFPA is specified to be linear 1034 psPlaneTransform *outFromFPA = psPlaneTransformInvert(NULL, outToFPA, *outputBounds, 100, 6);1040 psPlaneTransform *outFromFPA = psPlaneTransformInvert(NULL, outToFPA, *outputBounds, 50, ExtraOrders); 1035 1041 if (!outFromFPA) { 1036 1042 psFree(outToFPA); … … 1116 1122 } 1117 1123 1118 psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1 );1124 psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD); 1119 1125 newToFPA->x->coeffMask[1][1] = 1; 1120 1126 newToFPA->y->coeffMask[1][1] = 1; … … 1148 1154 psFree(dst); 1149 1155 1150 // this is a linear transformation 1156 // this is a linear transformation, no extra orders are needed 1151 1157 psPlaneTransform *newFromFPA = psPlaneTransformInvert(NULL, newToFPA, *bounds, 1, 0); 1152 1158 if (!newFromFPA) { … … 1187 1193 psMemSetDeallocator(wcs, (psFreeFunc) pmAstromWCSFree); 1188 1194 1189 wcs->trans = psPlaneTransformAlloc (nXorder, nYorder); 1195 // note: WCS transforms are always defined as chip to sky 1196 wcs->trans = psPlaneTransformAlloc (nXorder, nYorder, PS_POLYNOMIAL_ORD); 1190 1197 wcs->toSky = NULL; 1191 1198 wcs->wcsCDkeys = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
