Changeset 27488
- Timestamp:
- Mar 26, 2010, 4:43:50 PM (16 years ago)
- Location:
- branches/eam_branches/relastro.20100326/src
- Files:
-
- 2 added
- 7 edited
-
CoordOps.c (added)
-
FitChip.c (modified) (4 diffs)
-
FixProblemImages.c (added)
-
ImageOps.c (modified) (4 diffs)
-
UpdateChips.c (modified) (2 diffs)
-
UpdateObjectOffsets.c (modified) (1 diff)
-
fitpoly.c (modified) (6 diffs)
-
mkpolyterm.c (modified) (1 diff)
-
relastro.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relastro.20100326/src/FitChip.c
r24308 r27488 22 22 CoordFit *fit; 23 23 double dL, dM, dR, dRmax, *values; 24 Coords oldCoords; 24 25 25 26 ALLOCATE (values, double, Nmatch); … … 84 85 default: 85 86 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms); 86 abort ();87 skip = TRUE; 87 88 } 88 89 if (skip) { … … 96 97 97 98 // measure the fit, update the coords & object coordinates 98 fit_eval (fit); 99 fit_apply_coords (fit, coords); 99 if (!fit_eval (fit)) { 100 fprintf (stderr, "failed to fit new model\n"); 101 return FALSE; 102 } 103 104 if (!fit_apply_coords (fit, coords)) { 105 fprintf (stderr, "failed to fit new model\n"); 106 return FALSE; 107 } 108 100 109 fit_free (fit); 101 110 … … 107 116 108 117 free (values); 109 return ;118 return TRUE; 110 119 } 111 120 -
branches/eam_branches/relastro.20100326/src/ImageOps.c
r27478 r27488 286 286 Coords *moscoords, *imcoords; 287 287 288 // check if this image is bad and should be skipped 289 if (badCoords(im)) return; 290 288 291 moscoords = NULL; 289 292 mosaic = getMosaicForImage (im); … … 292 295 } 293 296 imcoords = &image[im].coords; 297 298 // accumulate the rms position offsets. if this value, or any specific entry, is too 299 // large, we will reset the image to the original coords at the end of the analysis 300 301 dPos = 0.0; 302 nPos = 0; 294 303 295 304 for (i = 0; i < Nlist[im]; i++) { … … 317 326 318 327 if (fabs(catalog[c].measure[m].dR - dR) > 10.0) { 319 // XXXXX running into this still for last megacam exposure: wrong mosaic?320 // ???? inconsistently hitting this????321 328 fprintf (stderr, "!"); 322 // abort (); 329 setBadCoords (im); // report a failure for this image 330 return; 323 331 } 324 332 if (fabs(catalog[c].measure[m].dD - dD) > 10.0) { 325 333 fprintf (stderr, "*"); 326 // abort (); 327 } 334 setBadCoords (im); // report a failure for this image 335 return; 336 } 337 338 dPos += SQ(catalog[c].measure[m].dR - dR) + SQ(catalog[c].measure[m].dD - dD); 339 nPos ++; 328 340 329 341 catalog[c].measure[m].dR = dR; … … 341 353 } 342 354 } 355 356 saveOffsets (dPos, nPos, im); 357 343 358 return; 344 359 } -
branches/eam_branches/relastro.20100326/src/UpdateChips.c
r27435 r27488 7 7 Image *image; 8 8 StarData *raw, *ref; 9 Coords *oldCoords; 9 10 10 11 image = getimages (&Nimage); … … 24 25 assert (Nraw == Nref); 25 26 27 saveCoords (&image[i].coords, i); 28 26 29 // FitChip does iterative, clipped fitting 27 30 fprintf (stderr, "image %lld : Nstars: %lld\n", (long long) i, (long long) Nraw); 28 FitChip (raw, ref, Nraw, &image[i].coords); 31 if (!FitChip (raw, ref, Nraw, &image[i].coords)) { 32 oldCoords = getCoords (i); 33 memcpy (&image[i].coords, oldCoords, sizeof(Coords)); 34 } 29 35 30 36 free (raw); -
branches/eam_branches/relastro.20100326/src/UpdateObjectOffsets.c
r17243 r27488 1 1 # include "relastro.h" 2 3 // We run through each DVO catalog, updating the measures that come from the modified images 4 // We need to watch for failures: 5 // * in UpdateMeasures, in fixImageRaw, we track the cumulative offset for each image 6 // * after all updates are done, we can check for any bad images and reset them to the 7 // original coordinates 2 8 3 9 int UpdateObjectOffsets (SkyList *skylist) { -
branches/eam_branches/relastro.20100326/src/fitpoly.c
r17419 r27488 103 103 104 104 /* convert the xsum,ysum,sum terms into vector,matrix and solve */ 105 voidfit_eval (CoordFit *fit) {105 int fit_eval (CoordFit *fit) { 106 106 107 107 int i, j, ix, iy, jx, jy; … … 147 147 } 148 148 149 dgaussjordan (matrix, vector, fit[0].Nelems, 2); 149 status = dgaussjordan (matrix, vector, fit[0].Nelems, 2); 150 if (!status) { 151 return (FALSE); 152 } 150 153 151 154 for (i = 0; i < fit[0].Nelems; i++) { … … 166 169 array_free (matrix, fit[0].Nelems); 167 170 array_free (vector, fit[0].Nelems); 171 return (TRUE); 168 172 } 169 173 … … 271 275 /* this should only apply to the polynomial, not the projection terms */ 272 276 /* compare with psastro supporting code */ 273 CoordFit *fit_apply_coords (CoordFit *fit, Coords *coords) {277 int fit_apply_coords (CoordFit *fit, Coords *coords) { 274 278 275 279 double Xo, Yo, R1, R2; … … 281 285 // L = pc1_1*cd1*(x - cp1) + pc1_2*cd2*(y - cp2) + ... 282 286 283 CoordsGetCenter (fit, 0.001, &Xo, &Yo); 287 if (!CoordsGetCenter (fit, 0.001, &Xo, &Yo)) { 288 fprintf (stderr, "failed to modify model\n"); 289 return (FALSE); 290 } 284 291 coords[0].crpix1 = Xo; 285 292 coords[0].crpix2 = Yo; … … 329 336 /* keep the order and type from initial values */ 330 337 331 // XXX if desired in the future, return modfit (and free above) 332 return (NULL); 333 } 334 338 return (TRUE); 339 } 340 -
branches/eam_branches/relastro.20100326/src/mkpolyterm.c
r16810 r27488 73 73 if (dPos > dPosRef) { 74 74 fprintf (stderr, "*** warning : non-convergence in model conversion (mkpolyterm.c;73) *** \n"); 75 return FALSE; 75 76 } 76 77 array_free (alpha, 2); -
branches/eam_branches/relastro.20100326/src/relastro.c
r27478 r27488 39 39 skylist = load_images (&db, &UserPatch); 40 40 MARKTIME("load images: %f sec\n", dtime); 41 42 initCoords(); 41 43 42 44 /* load catalog data from region files : subselect high-quality measurements */ … … 83 85 UpdateObjectOffsets (skylist); 84 86 87 // iterate over catalogs to make detection coordinates consistant 88 FixProblemImages (); 89 85 90 // save the updated image parameters 86 91 dvo_image_update (&db, VERBOSE);
Note:
See TracChangeset
for help on using the changeset viewer.
