Changeset 35341
- Timestamp:
- Apr 2, 2013, 1:53:46 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307
- Files:
-
- 3 edited
-
psModules/src/astrom/pmAstrometryUtils.c (modified) (4 diffs)
-
psastro/src/psastroChipAstrom.c (modified) (1 diff)
-
psastro/src/psastroChooseRefstars.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/psModules/src/astrom/pmAstrometryUtils.c
r24096 r35341 23 23 #include "pmAstrometryUtils.h" 24 24 25 // this is used by the test output block 26 static int Nout = 0; 27 25 28 // given a 2D transformation -- L(x,y),M(x,y) -- find the coordinates x,y 26 29 // for which L,M = 0,0. tol is the allowed error on x,y. … … 33 36 double Xo = (trans->y->coeff[0][0]*trans->x->coeff[0][1] - trans->x->coeff[0][0]*trans->y->coeff[0][1])/R; 34 37 double Yo = (trans->x->coeff[0][0]*trans->y->coeff[1][0] - trans->y->coeff[0][0]*trans->x->coeff[1][0])/R; 38 39 if (0) { 40 // this is a test output block, not used in normal operations 41 char filename[64]; 42 snprintf (filename, 64, "trans.%03d.md", Nout); 43 FILE *f = fopen (filename, "w"); 44 45 psMetadata *md = psMetadataAlloc(); 46 47 psPolynomial2DtoMetadata (md, trans->x, "X"); 48 psPolynomial2DtoMetadata (md, trans->y, "Y"); 49 psMetadataConfigPrint (f, md); 50 psFree (md); 51 fclose (f); 52 Nout ++; 53 } 35 54 36 55 // iterate to actual solution: requires small non-linear terms … … 53 72 // NOTE: order for Alpha is: [y][x] 54 73 Alpha->data.F32[0][0] = psPolynomial2DEval (XdX, Xo, Yo); 55 Alpha->data.F32[ 1][0] = psPolynomial2DEval (XdY, Xo, Yo);56 Alpha->data.F32[ 0][1] = psPolynomial2DEval (YdX, Xo, Yo);74 Alpha->data.F32[0][1] = psPolynomial2DEval (XdY, Xo, Yo); 75 Alpha->data.F32[1][0] = psPolynomial2DEval (YdX, Xo, Yo); 57 76 Alpha->data.F32[1][1] = psPolynomial2DEval (YdY, Xo, Yo); 58 77 59 Beta->data.F32[0] = psPolynomial2DEval (trans->x, Xo, Yo);60 Beta->data.F32[1] = psPolynomial2DEval (trans->y, Xo, Yo);78 Beta->data.F32[0] = -1.0 * psPolynomial2DEval (trans->x, Xo, Yo); 79 Beta->data.F32[1] = -1.0 * psPolynomial2DEval (trans->y, Xo, Yo); 61 80 62 81 if (!psMatrixGJSolve (Alpha, Beta)) { … … 71 90 } 72 91 73 Xo -= Beta->data.F32[0];74 Yo -= Beta->data.F32[1];92 Xo += Beta->data.F32[0]; 93 Yo += Beta->data.F32[1]; 75 94 dPos = hypot(Beta->data.F32[0], Beta->data.F32[1]); 76 95 psTrace ("psastro", 5, "i: %d, Xo,Yo : %f %f dX, dY: %f %f dPos: %f\n", i, Xo, Yo, Beta->data.F32[0], Beta->data.F32[1], dPos); 77 96 } 78 97 psFree (Alpha); -
branches/eam_branches/ipp-20130307/psastro/src/psastroChipAstrom.c
r31333 r35341 75 75 if (refstars == NULL) { continue; } 76 76 77 # if (0) 78 static int Nchip = 0; 79 if (1) { 80 // XXX test 81 char filename[64]; 82 snprintf (filename, 64, "refstars.%02d.dat", Nchip); 83 FILE *outfile = fopen (filename, "w"); 84 assert (outfile); 85 for (int nn = 0; nn < refstars->n; nn++) { 86 pmAstromObj *ref = refstars->data[nn]; 87 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf\n", 88 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 89 ref->TP->x, ref->TP->y, 90 ref->FP->x, ref->FP->y, 91 ref->chip->x, ref->chip->y); 92 } 93 fclose (outfile); 94 } 95 if (1) { 96 // XXX test 97 char filename[64]; 98 snprintf (filename, 64, "rawstars.%02d.dat", Nchip); 99 FILE *outfile = fopen (filename, "w"); 100 assert (outfile); 101 for (int nn = 0; nn < gridrawstars->n; nn++) { 102 pmAstromObj *ref = gridrawstars->data[nn]; 103 fprintf (outfile, "%lf %lf %lf %lf %lf %lf %lf %lf\n", 104 ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, 105 ref->TP->x, ref->TP->y, 106 ref->FP->x, ref->FP->y, 107 ref->chip->x, ref->chip->y); 108 } 109 fclose (outfile); 110 Nchip ++; 111 } 112 # endif 113 77 114 // the absolute minimum number of stars is 4 (for order = 1) 78 115 if ((rawstars->n < 4) || (refstars->n < 4)) { -
branches/eam_branches/ipp-20130307/psastro/src/psastroChooseRefstars.c
r35050 r35341 107 107 108 108 if (ref->Mag < clampMagMin) { 109 psWarning("Skipping refstar with abusrd magni ntude %f ra: %f dec: %f\n",109 psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n", 110 110 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 111 111 goto skip; … … 131 131 132 132 # if (0) 133 // XXX test 134 FILE *outfile = fopen ("refstars.dat", "w"); 135 assert (outfile); 136 for (int nn = 0; nn < refstars->n; nn++) { 137 pmAstromObj *ref = refstars->data[nn]; 138 fprintf (outfile, "%lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD); 133 if (1) { 134 // test output block, not used in normal ops 135 char filename[64]; 136 snprintf (filename, 64, "refstars.%02d.dat", Nchip); 137 FILE *outfile = fopen (filename, "w"); 138 assert (outfile); 139 for (int nn = 0; nn < refstars->n; nn++) { 140 pmAstromObj *ref = refstars->data[nn]; 141 fprintf (outfile, "%lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD); 142 } 143 fclose (outfile); 139 144 } 140 fclose (outfile); 145 if (1) { 146 // test output block, not used in normal ops 147 char filename[64]; 148 snprintf (filename, 64, "refstars.%02d.dat", Nchip); 149 FILE *outfile = fopen (filename, "w"); 150 assert (outfile); 151 for (int nn = 0; nn < refstars->n; nn++) { 152 pmAstromObj *ref = refstars->data[nn]; 153 fprintf (outfile, "%lf %lf %lf %lf %lf %lf\n", ref->sky->r*PS_DEG_RAD, ref->sky->d*PS_DEG_RAD, ); 154 } 155 fclose (outfile); 156 } 141 157 # endif 142 158
Note:
See TracChangeset
for help on using the changeset viewer.
