Changeset 5510 for trunk/psastro/src/pmAstrom.c
- Timestamp:
- Nov 13, 2005, 1:16:22 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/pmAstrom.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/pmAstrom.c
r5495 r5510 54 54 } 55 55 56 pmAstromMatchedListFit (pmFPA *fpa, psArray *st1, psArray *st2, psArray *match, psMetadata *config) { 56 // take two matched star lists and fit a psPlaneTransform between them 57 // 58 psPlaneTransform *pmAstromMatchedListFit (psPlaneTransform *map, psArray *st1, psArray *st2, psArray *match, psMetadata *config) { 59 60 if (map == NULL) { 61 // int nX = psMetadataLookupS32 (&status, myHeader, "CHIP.NX"); 62 // int nY = psMetadataLookupS32 (&status, myHeader, "CHIP.NY"); 63 map = psPlaneTransform (2, 2); 64 } 65 66 psStats *stats = psStatsAlloc (CLIPPED_MEAN); 67 stats->nSigma = psMetadataLookupS32 (&status, myHeader, "CHIP.NITER"); 68 stats->nSigma = psMetadataLookupS32 (&status, myHeader, "CHIP.NSIGMA"); 57 69 58 70 psVector *X = psVectorAlloc (match->n); … … 62 74 63 75 // take the matched stars, first fit 64 for (i = 0; i < match->n; i++) {76 for (int i = 0; i < match->n; i++) { 65 77 66 78 pair = match->data[i]; … … 68 80 ob2 = st2->data[pair->i2]; 69 81 70 X->data.F64[i] = ob1-> P;71 Y->data.F64[i] = ob1-> Q;82 X->data.F64[i] = ob1->chip.x; 83 Y->data.F64[i] = ob1->chip.y; 72 84 73 x->data.F64[i] = ob2->P; 74 y->data.F64[i] = ob2->Q; 75 76 // use one or the other... 77 psPolynomial2D *xt = psVectorFitPolynomial2D (NULL, stats, NULL, 0, X, NULL, x, y); 78 psPolynomial2D *xt = psVectorClipFitPolynomial2D (NULL, stats, NULL, 0, X, NULL, x, y); 79 80 psPolynomial2D *yt = psVectorFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y); 81 psPolynomial2D *yt = psVectorClipFitPolynomial2D (NULL, stats, NULL, 0, Y, NULL, x, y); 85 x->data.F64[i] = ob2->FP.x; 86 y->data.F64[i] = ob2->FP.y; 82 87 } 83 88 84 // apply fitted polynomials to fpa 89 // no masking, no errors 90 psVectorClipFitPolynomial2D (map->x, stats, NULL, 0, X, NULL, x, y); 91 psVectorClipFitPolynomial2D (map->y, stats, NULL, 0, Y, NULL, x, y); 92 psFree (x); 93 psFree (y); 94 psFree (X); 95 psFree (Y); 96 psFree (stats); 97 98 return (map); 85 99 } 86 100 … … 103 117 newObj = pmAstromObjCopy (oldObj); 104 118 105 P= oldObj->FP.x - xCenter;106 Q= oldObj->FP.y - yCenter;119 X = oldObj->FP.x - xCenter; 120 Y = oldObj->FP.y - yCenter; 107 121 108 newObj->FP.x = P*cs + Q*sn;109 newObj->FP.y = Q*cs - P*sn;122 newObj->FP.x = X*cs + Y*sn; 123 newObj->FP.y = Y*cs - X*sn; 110 124 111 125 new->data[i] = newObj;
Note:
See TracChangeset
for help on using the changeset viewer.
