Changeset 41832 for branches/eam_branches/ipp-dev-20210817/psModules
- Timestamp:
- Oct 11, 2021, 11:35:13 AM (5 years ago)
- Location:
- branches/eam_branches/ipp-dev-20210817/psModules/src/astrom
- Files:
-
- 3 edited
-
pmAstrometryModel.c (modified) (2 diffs)
-
pmAstrometryUtils.c (modified) (4 diffs)
-
pmAstrometryWCS.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryModel.c
r41826 r41832 500 500 int nY = psMetadataLookupS32(&status, row, "NYORDER"); REQUIRE (status, "missing NYORDER"); 501 501 if (chip->toFPA == NULL) { 502 chip->toFPA = psPlaneTransformAlloc(nX, nY); 502 chip->toFPA = psPlaneTransformAlloc(nX, nY, PS_POLYNOMIAL_ORD); // chip->fpa uses ordinary poly 503 503 } else { 504 504 REQUIRE (chip->toFPA->x->nX == nX, "mismatch in chip order"); … … 569 569 if (file->fpa->toTPA == NULL) { 570 570 // allocate the new transformation 571 file->fpa->toTPA = psPlaneTransformAlloc(nX, nY );571 file->fpa->toTPA = psPlaneTransformAlloc(nX, nY, PS_POLYNOMIAL_ORD); // fpa->tpa uses ORD 572 572 } else { 573 573 REQUIRE (file->fpa->toTPA->x->nX == nX, "mismatch in chip order"); -
branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryUtils.c
r41826 r41832 131 131 132 132 // convert a transformation L(x,y) to L'(x-xo,y-yo) 133 // is this used for an upward (e.g., chip->fpa) or a downward (fpa->chip) transform? 133 134 psPlaneTransform *psPlaneTransformSetCenter (psPlaneTransform *output, psPlaneTransform *input, double Xo, double Yo) 134 135 { 135 136 136 // validate fit order 137 // validate fit type: 138 // polynomial in input transforms must match type -- and for now be ORD 139 psAssert (input->x->type == PS_POLYNOMIAL_ORD, "fix for CHEB"); 140 psAssert (input->y->type == PS_POLYNOMIAL_ORD, "fix for CHEB"); 137 141 138 142 if (output == NULL) { 139 output = psPlaneTransformAlloc(input->x->nX, input->x->nY );143 output = psPlaneTransformAlloc(input->x->nX, input->x->nY, PS_POLYNOMIAL_ORD); 140 144 } 141 145 … … 180 184 181 185 // rotate a transformation L(x,y) by theta 182 psPlaneTransform *psPlaneTransformRotate (psPlaneTransform *output, psPlaneTransform *input, double theta)186 psPlaneTransform *psPlaneTransformRotate (psPlaneTransform *output, psPlaneTransform *input, double theta) 183 187 { 184 188 /* given the polynomial transformations: … … 192 196 193 197 if (output == NULL) { 194 output = psPlaneTransformAlloc(input->x->nX, input->x->nY); 198 // generate a new transform using the same order and type as the input 199 output = psPlaneTransformAlloc(input->x->nX, input->x->nY, input->x->type); 195 200 } 196 201 … … 227 232 228 233 // all coeffs and masks initially set to 0 229 transform = psPlaneTransformAlloc (order, order );234 transform = psPlaneTransformAlloc (order, order, PS_POLYNOMIAL_ORD); 230 235 231 236 for (int i = 0; i <= order; i++) { -
branches/eam_branches/ipp-dev-20210817/psModules/src/astrom/pmAstrometryWCS.c
r41826 r41832 554 554 // apply the exiting fromTPA transformation to make the new toFPA consistent with the toTPA layter 555 555 // XXX this only works if toTPA is at most a linear transformation 556 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY );556 psPlaneTransform *toFPAnew = psPlaneTransformAlloc(toFPA->x->nX, toFPA->x->nY, PS_POLYNOMIAL_ORD); 557 557 for (int i = 0; i <= toFPA->x->nX; i++) { 558 558 for (int j = 0; j <= toFPA->x->nY; j++) { … … 656 656 chip->toFPA = psPlaneTransformSetCenter (NULL, wcs->trans, -wcs->crpix1, -wcs->crpix2); 657 657 } else { 658 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); 659 659 660 660 // copy the toFPA x,y, transformations to the wcs version … … 743 743 // XXX require fpa->toTPA->nX == 1 744 744 745 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); 746 746 747 747 for (int i = 0; i <= toTPA->x->nX; i++) { … … 962 962 } 963 963 964 psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1 );964 psPlaneTransform *newTrans = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD); 965 965 966 966 if (!psPlaneTransformFit(newTrans, src, dst, 0, 0)) { … … 1122 1122 } 1123 1123 1124 psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1 );1124 psPlaneTransform *newToFPA = psPlaneTransformAlloc(1, 1, PS_POLYNOMIAL_ORD); 1125 1125 newToFPA->x->coeffMask[1][1] = 1; 1126 1126 newToFPA->y->coeffMask[1][1] = 1; … … 1193 1193 psMemSetDeallocator(wcs, (psFreeFunc) pmAstromWCSFree); 1194 1194 1195 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); 1196 1197 wcs->toSky = NULL; 1197 1198 wcs->wcsCDkeys = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
