Changeset 28720
- Timestamp:
- Jul 27, 2010, 3:12:18 PM (16 years ago)
- Location:
- branches/eam_branches/ipp-20100621/Ohana/src/relastro
- Files:
-
- 16 edited
-
include/relastro.h (modified) (5 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/FitChip.c (modified) (10 diffs)
-
src/FitMosaic.c (modified) (1 diff)
-
src/FitSimple.c (modified) (1 diff)
-
src/ImageOps.c (modified) (4 diffs)
-
src/StarMaps.c (modified) (8 diffs)
-
src/UpdateChips.c (modified) (2 diffs)
-
src/UpdateMeasures.c (modified) (2 diffs)
-
src/bcatalog.c (modified) (2 diffs)
-
src/fitpoly.c (modified) (5 diffs)
-
src/initialize.c (modified) (1 diff)
-
src/load_images.c (modified) (2 diffs)
-
src/mkpolyterm.c (modified) (1 diff)
-
src/relastro.c (modified) (2 diffs)
-
src/select_images.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/Ohana/src/relastro/include/relastro.h
r28703 r28720 3 3 # include <kapa.h> 4 4 # include <signal.h> 5 # include <assert.h> 5 6 6 7 typedef enum { … … 76 77 int Nmeas; 77 78 } StatType; 79 80 # define MARKTIME(MSG,...) { \ 81 float dtime; \ 82 gettimeofday (&stop, (void *) NULL); \ 83 dtime = DTIME (stop, start); \ 84 fprintf (stderr, MSG, __VA_ARGS__); } 78 85 79 86 /* global variables set in parameter file */ … … 150 157 int NY_MAP; 151 158 double DPOS_MAX; 159 double ADDSTAR_RADIUS; 152 160 153 161 /*** relphot prototypes ***/ … … 212 220 void create_image_db (FITS_DB *db); 213 221 void save_catalogs (Catalog *catalog, int Ncatalog); 222 223 int reload_images (FITS_DB *db); 214 224 215 225 int main PROTO((int argc, char **argv)); … … 272 282 double **poly2d_copy (double **poly, int Nx, int Ny); 273 283 double poly2d_eval (double **poly, int Nx, int Ny, double x, double y); 274 int fit_apply_coords (CoordFit *fit, Coords *coords );284 int fit_apply_coords (CoordFit *fit, Coords *coords, int keepRef); 275 285 int CoordsGetCenter (CoordFit *fit, double tol, double *xo, double *yo); 276 286 CoordFit *CoordsSetCenter (CoordFit *input, double Xo, double Yo); 277 int FitChip (StarData *raw, StarData *ref, int Nmatch, Coords *coords);287 int FitChip (StarData *raw, StarData *ref, int Nmatch, Image *image); 278 288 void FitMosaic (StarData *raw, StarData *ref, int Nmatch, Coords *coords); 279 289 void FitSimple (StarData *raw, StarData *ref, int Nmatch, Coords *coords); -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/ConfigInit.c
r28703 r28720 36 36 GetConfig (config, "RELASTRO_MAP_NY", "%d", 0, &NY_MAP); 37 37 GetConfig (config, "RELASTRO_DPOS_MAX", "%lf", 0, &DPOS_MAX); 38 GetConfig (config, "ADDSTAR_RADIUS", "%lf", 0, &ADDSTAR_RADIUS); 38 39 39 40 GetConfig (config, "GSCFILE", "%s", 0, GSCFILE); -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/FitChip.c
r27581 r28720 3 3 4 4 // XXX make these user parameters 5 # define FIT_CHIP_MAX_ERROR 0.056 5 # define FIT_CHIP_NITER 3 7 6 # define FIT_CHIP_NSIGMA 3.0 8 9 10 // XXX we should test if the fit is sufficiently constrained across the chip, or if the11 // new positions deviate too much from the old positions12 13 // XXX add visualization tools: per chip residual plots14 7 15 8 // XXX save the fit[0].Npts value in the image table? … … 17 10 // XXX save measurements of the fit quality (scatter, chisq) in the image table 18 11 19 int FitChip (StarData *raw, StarData *ref, int Nmatch, Coords *coords) {12 int FitChip (StarData *raw, StarData *ref, int Nmatch, Image *image) { 20 13 21 14 int i, Nscatter, Niter, skip; … … 29 22 for (i = Nscatter = 0; i < Nmatch; i++) { 30 23 if (raw[i].mask) continue; 31 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) continue;24 if (isnan(raw[i].dMag) || raw[i].dMag > SIGMA_LIM) continue; 32 25 33 26 dL = raw[i].L - ref[i].L; … … 39 32 } 40 33 41 // for a 2D Gaussian, 40% of the points are within 1 sigma; dRmax is ~ 3 sigma 42 dsort (values, Nscatter); 43 dRmax = FIT_CHIP_NSIGMA*values[(int)(0.40*Nscatter)]; 44 relastroVisualPlotScatter(values, dRmax, Nscatter); 45 relastroVisualPlotRawRef(raw, ref, dRmax, Nmatch); 34 if (Nscatter > 5) { 35 // for a 2D Gaussian, 40% of the points are within 1 sigma; dRmax is ~ 3 sigma 36 // XXX this test is not sensible for Nscatter < XXX (5?) 37 dsort (values, Nscatter); 38 dRmax = FIT_CHIP_NSIGMA*values[(int)(0.40*Nscatter)]; 39 relastroVisualPlotScatter(values, dRmax, Nscatter); 40 relastroVisualPlotRawRef(raw, ref, dRmax, Nmatch); 41 } else { 42 dRmax = 0; 43 } 46 44 47 45 // fit the requested order polynomial 48 46 if (CHIPORDER > 0) { 49 coords[0].Npolyterms = CHIPORDER;47 image[0].coords.Npolyterms = CHIPORDER; 50 48 } 51 fit = fit_init ( coords[0].Npolyterms);49 fit = fit_init (image[0].coords.Npolyterms); 52 50 53 51 // generate the fit matches … … 56 54 continue; 57 55 } 58 if (isnan(raw[i].dMag) || raw[i].dMag > FIT_CHIP_MAX_ERROR) {56 if (isnan(raw[i].dMag) || raw[i].dMag > SIGMA_LIM) { 59 57 continue; 60 58 } … … 64 62 dM = raw[i].M - ref[i].M; 65 63 dR = hypot (dL, dM); 66 if (dR > dRmax) continue; 64 65 // fprintf (stderr, "fit %f %f -> %f %f : %f %f (%f vs %f) wt: %f\n", raw[i].X, raw[i].Y, ref[i].L, ref[i].M, raw[i].L, raw[i].M, dR, dRmax, raw[i].dPos); 66 67 if ((dRmax > 0.0) && (dR > dRmax)) continue; 67 68 68 69 fit_add (fit, raw[i].X, raw[i].Y, ref[i].L, ref[i].M, raw[i].dPos); … … 71 72 // check if the fit has enough data points for the polynomial order 72 73 skip = FALSE; 73 switch ( coords[0].Npolyterms) {74 switch (image[0].coords.Npolyterms) { 74 75 case 0: 75 76 case 1: … … 83 84 break; 84 85 default: 85 fprintf (stderr, "invalid chip order %d\n", coords[0].Npolyterms);86 fprintf (stderr, "invalid chip order %d\n", image[0].coords.Npolyterms); 86 87 skip = TRUE; 87 88 } 88 89 if (skip) { 89 fprintf (stderr, "insufficient measurements (%d) for requested order (%d)\n", fit[0].Npts, coords[0].Npolyterms);90 if (VERBOSE) fprintf (stderr, "insufficient measurements (%d) for requested order (%d)\n", fit[0].Npts, image[0].coords.Npolyterms); 90 91 fit_free (fit); 91 92 free (values); 93 image[0].flags |= ID_IMAGE_ASTROM_FEW; 92 94 return FALSE; 93 95 } … … 98 100 if (!fit_eval (fit)) { 99 101 fprintf (stderr, "failed to fit new model\n"); 102 image[0].flags |= ID_IMAGE_ASTROM_FAIL; 100 103 return FALSE; 101 104 } 102 105 103 if (!fit_apply_coords (fit, coords)) {106 if (!fit_apply_coords (fit, &image[0].coords, FALSE)) { 104 107 fprintf (stderr, "failed to fit new model\n"); 108 image[0].flags |= ID_IMAGE_ASTROM_FAIL; 105 109 return FALSE; 106 110 } … … 109 113 110 114 for (i = 0; i < Nmatch; i++) { 111 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, coords);115 XY_to_LM (&raw[i].L, &raw[i].M, raw[i].X, raw[i].Y, &image[0].coords); 112 116 } 113 117 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/FitMosaic.c
r16810 r28720 26 26 } 27 27 fit_eval (fit); 28 fit_apply_coords (fit, coords );28 fit_apply_coords (fit, coords, TRUE); 29 29 fit_free (fit); 30 30 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/FitSimple.c
r27435 r28720 26 26 } 27 27 fit_eval (fit); 28 fit_apply_coords (fit, coords );28 fit_apply_coords (fit, coords, TRUE); 29 29 fit_free (fit); 30 30 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/ImageOps.c
r28695 r28720 319 319 } 320 320 321 void dump_measures(Average *average, Measure *measure) { 322 323 off_t j, off; 324 325 for (j = 0; j < average[0].Nmeasure; j++) { 326 off = average[0].measureOffset + j; 327 fprintf (stderr, "%f, %f\n", measure[off].dR, measure[off].dD); 328 } 329 return; 330 } 331 321 332 // return StarData values for detections in the specified image, converting coordinates from the 322 333 // chip positions: X,Y -> L,M -> P,Q -> R,D … … 325 336 off_t i, m, c, n, nPos; 326 337 double X, Y, L, M, P, Q, R, D, dR, dD; 327 double dPos ;338 double dPos, DPOS_MAX_ASEC; 328 339 329 340 Mosaic *mosaic; … … 341 352 } 342 353 imcoords = &image[im].coords; 354 355 if (moscoords) { 356 DPOS_MAX_ASEC = 3600.0*DPOS_MAX*hypot(moscoords[0].cdelt1, moscoords[0].cdelt2); 357 } else { 358 DPOS_MAX_ASEC = 3600.0*DPOS_MAX*hypot(imcoords[0].cdelt1, imcoords[0].cdelt2); 359 } 343 360 344 361 // accumulate the rms position offsets. if this value, or any specific entry, is too … … 372 389 373 390 // complain if the new location is far from the average location 374 // XXX warning or error here??375 if (fabs(dR) > 2.0) {376 fprintf (stderr, " !");377 setBadCoords (im); // report a failure for this image378 return;379 } 380 if (fabs(dD) > 2.0) {381 fprintf (stderr, " *");382 setBadCoords (im); // report a failure for this image383 return;391 // NOTE: This should never happen, or our StarMap tests are not working 392 if (fabs(dR) > 1.5*ADDSTAR_RADIUS) { 393 fprintf (stderr, "measurement is far from average location (R): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD); 394 dump_measures (&catalog[c].average[n], catalog[c].measure); 395 abort (); 396 } 397 if (fabs(dD) > 1.5*ADDSTAR_RADIUS) { 398 fprintf (stderr, "measurement is far from average location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD); 399 dump_measures (&catalog[c].average[n], catalog[c].measure); 400 abort (); 384 401 } 385 402 386 403 // complain if the new location is far from the old location 387 if (fabs(catalog[c].measure[m].dR - dR) > 2.0) {388 fprintf (stderr, " @");389 setBadCoords (im); // report a failure for this image390 return;391 } 392 if (fabs(catalog[c].measure[m].dD - dD) > 2.0) {393 fprintf (stderr, " #");394 setBadCoords (im); // report a failure for this image395 return;404 if (fabs(catalog[c].measure[m].dR - dR) > DPOS_MAX_ASEC) { 405 fprintf (stderr, "measurement is far from original location (R): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD); 406 dump_measures (&catalog[c].average[n], catalog[c].measure); 407 abort(); 408 } 409 if (fabs(catalog[c].measure[m].dD - dD) > DPOS_MAX_ASEC) { 410 fprintf (stderr, "measurement is far from original location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD); 411 dump_measures (&catalog[c].average[n], catalog[c].measure); 412 abort(); 396 413 } 397 414 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/StarMaps.c
r28703 r28720 20 20 int Nx; 21 21 int Ny; 22 int *stars; 23 StarMapPoint *points; 22 int *stars; // arrays to count the number of stars in each map bin 23 StarMapPoint *points; // test points generated based on map 24 24 int Npoints; 25 25 } StarMap; … … 45 45 46 46 for (i = 0; i < Nimages; i++) { 47 starmap[i].Npoints = 0; 48 starmap[i].points = NULL; 47 49 starmap[i].Nx = images[i].NX / NX_MAP; 48 50 starmap[i].Ny = images[i].NY / NY_MAP; … … 58 60 off_t i, N, Nimages; 59 61 int xbin, ybin; 62 struct timeval start, stop; 63 64 gettimeofday (&start, (void *) NULL); 60 65 61 66 images = getimages(&Nimages); … … 74 79 starmap[N].stars[ybin*NX_MAP + xbin] ++; 75 80 } 81 MARKTIME("assign stars to starmap bins: %f sec\n", dtime); 76 82 77 83 return (TRUE); … … 88 94 for (i = 0; i < Nimages; i++) { 89 95 96 assert (!starmap[i].points); 97 90 98 ALLOCATE (starmap[i].points, StarMapPoint, NX_MAP*NY_MAP); 91 99 starmap[i].Npoints = 0; … … 98 106 99 107 // set the pixel coordinates 100 point[0].X = ix * NX_MAP; // XXX fix 0.5 pixel offset101 point[0].Y = iy * NY_MAP; // XXX fix 0.5 pixel offset108 point[0].X = ix * starmap[i].Nx; // XXX fix 0.5 pixel offset 109 point[0].Y = iy * starmap[i].Nx; // XXX fix 0.5 pixel offset 102 110 103 111 // set the transformed coordinates … … 108 116 } 109 117 } 118 119 if (VERBOSE) fprintf (stderr, "starmap: %d points for image %s\n", starmap[i].Npoints, images[i].name); 110 120 } 111 121 … … 131 141 starmap[N].points[i].dM = starmap[N].points[i].M - M; 132 142 133 dLmax = MAX( starmap[N].points[i].dL, dLmax);134 dMmax = MAX( starmap[N].points[i].dM, dMmax);143 dLmax = MAX(fabs(starmap[N].points[i].dL), dLmax); 144 dMmax = MAX(fabs(starmap[N].points[i].dM), dMmax); 135 145 } 136 146 137 // XXX these need to be set somehow 147 if (VERBOSE) fprintf (stderr, "max deviations for %s using %d pts : %f, %f\n", images[N].name, starmap[N].Npoints, dLmax, dMmax); 148 138 149 if (dLmax > DPOS_MAX) return (FALSE); 139 150 if (dMmax > DPOS_MAX) return (FALSE); -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/UpdateChips.c
r28695 r28720 31 31 // FitChip does iterative, clipped fitting 32 32 // fprintf (stderr, "image "OFF_T_FMT" : Nstars: "OFF_T_FMT"\n", i, Nraw); 33 if (!FitChip (raw, ref, Nraw, &image[i] .coords)) {34 fprintf (stderr, "reject fit for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name, i, Nraw);33 if (!FitChip (raw, ref, Nraw, &image[i])) { 34 if (VERBOSE) fprintf (stderr, "reject fit for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name, i, Nraw); 35 35 oldCoords = getCoords (i); 36 36 memcpy (&image[i].coords, oldCoords, sizeof(Coords)); 37 // XXX need to set some flag to note failure here38 37 free (raw); 39 38 free (ref); … … 42 41 43 42 if (!checkStarMap (i)) { 44 fprintf (stderr, "fit diverges too much for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name, i, Nraw);43 if (VERBOSE) fprintf (stderr, "fit diverges too much for image %s ("OFF_T_FMT") : Nstars: "OFF_T_FMT"\n", image[i].name, i, Nraw); 45 44 oldCoords = getCoords (i); 46 45 memcpy (&image[i].coords, oldCoords, sizeof(Coords)); 47 // XXX need to set some flag to note failure here46 image[i].flags |= ID_IMAGE_ASTROM_POOR; 48 47 } 49 48 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/UpdateMeasures.c
r28695 r28720 5 5 off_t i, Nimage; 6 6 Image *image; 7 8 int badImage = 9 ID_IMAGE_ASTROM_NOCAL | 10 ID_IMAGE_ASTROM_POOR | 11 ID_IMAGE_ASTROM_FAIL | 12 ID_IMAGE_ASTROM_SKIP | 13 ID_IMAGE_ASTROM_FEW; 7 14 8 15 image = getimages (&Nimage); … … 14 21 15 22 // skip images that have failed solutions (divergent or otherwise) 23 if (image[i].flags & badImage) continue; 16 24 17 25 /* convert measure coordinates to raw entries */ -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/bcatalog.c
r28241 r28720 45 45 offset = catalog[0].average[i].measureOffset + j; 46 46 47 // filter objects based on user supplied criteria47 // filter objects based on user supplied criteria 48 48 if (!MeasFilterTest(&catalog[0].measure[offset])) { 49 49 catalog[0].measure[offset].dbFlags &= ~ID_MEAS_USED_CHIP; … … 51 51 } 52 52 53 // filter out outliers53 // filter out outliers 54 54 if (FlagOutlier && (catalog[0].measure[offset].dbFlags & ID_MEAS_POOR_ASTROM)) { 55 55 catalog[0].measure[offset].dbFlags &= ~ID_MEAS_USED_CHIP; -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/fitpoly.c
r27581 r28720 110 110 if (fit[0].Npts == 0) { 111 111 fprintf (stderr, "warning: no valid pts\n"); 112 return (FALSE); 112 113 } 113 114 … … 140 141 } 141 142 142 for (i = 0; i < fit[0].Nelems; i++) {143 for (i = 0; FALSE && (i < fit[0].Nelems); i++) { 143 144 ix = i % fit[0].Nterms; 144 145 iy = i / fit[0].Nterms; 145 //fprintf (stderr, "x2 : x^%dy^%d: %10.4g y2 : x^%dy^%d: %10.4g \n",146 //ix, iy, vector[i][0], ix, iy, vector[i][1]);146 fprintf (stderr, "x2 : x^%dy^%d: %10.4g y2 : x^%dy^%d: %10.4g \n", 147 ix, iy, vector[i][0], ix, iy, vector[i][1]); 147 148 } 148 149 … … 151 152 } 152 153 153 for (i = 0; i < fit[0].Nelems; i++) {154 for (i = 0; FALSE && i < fit[0].Nelems; i++) { 154 155 ix = i % fit[0].Nterms; 155 156 iy = i / fit[0].Nterms; 156 //fprintf (stderr, "x2 : x^%dy^%d: %10.4g y2 : x^%dy^%d: %10.4g \n",157 //ix, iy, vector[i][0], ix, iy, vector[i][1]);157 fprintf (stderr, "x2 : x^%dy^%d: %10.4g y2 : x^%dy^%d: %10.4g \n", 158 ix, iy, vector[i][0], ix, iy, vector[i][1]); 158 159 } 159 160 … … 274 275 /* this should only apply to the polynomial, not the projection terms */ 275 276 /* compare with psastro supporting code */ 276 int fit_apply_coords (CoordFit *fit, Coords *coords ) {277 int fit_apply_coords (CoordFit *fit, Coords *coords, int keepRef) { 277 278 278 279 double Xo, Yo, R1, R2; 279 280 CoordFit *modfit; 280 281 281 /* I have L,M = fit(X,Y). set corresponding terms for coords */ 282 283 // L = a[0][0] + a[1][0]x^1 y^0 + a[0][1] x^0 y^1 + ... 284 // L = pc1_1*cd1*(x - cp1) + pc1_2*cd2*(y - cp2) + ... 285 286 if (!CoordsGetCenter (fit, 0.001, &Xo, &Yo)) { 287 fprintf (stderr, "failed to modify model\n"); 288 return (FALSE); 289 } 290 coords[0].crpix1 = Xo; 291 coords[0].crpix2 = Yo; 292 293 // resulting fit should have zero constant terms 294 modfit = CoordsSetCenter (fit, Xo, Yo); 295 296 /* we do not modify crval1,2: these are kept at the default values */ 282 if (keepRef) { 283 // adjust crpix1,2 as needed: 284 // L = a[0][0] + a[1][0]x^1 y^0 + a[0][1] x^0 y^1 + ... 285 // L = pc1_1*cd1*(x - cp1) + pc1_2*cd2*(y - cp2) + ... 286 287 if (!CoordsGetCenter (fit, 0.001, &Xo, &Yo)) { 288 fprintf (stderr, "failed to modify model\n"); 289 return (FALSE); 290 } 291 coords[0].crpix1 = Xo; 292 coords[0].crpix2 = Yo; 293 /* we do not modify crval1,2: these are kept at the default values */ 294 295 // resulting fit should have zero constant terms 296 modfit = CoordsSetCenter (fit, Xo, Yo); 297 } else { 298 // L = a[0][0] + a[1][0]x^1 y^0 + a[0][1] x^0 y^1 + ... 299 // P = cd1*x, Q = cd2*y 300 // L = pc1_1*P + pc1_2*Q + ... 301 302 /* modify crval1,2: these are kept at the default values */ 303 304 coords[0].crpix1 = 0.0; 305 coords[0].crpix2 = 0.0; 306 modfit = fit; 307 } 297 308 298 309 // set cdelt1, cdelt2 … … 331 342 coords[0].polyterms[6][1] = modfit[0].yfit[0][3]*R2*R2*R2; 332 343 } 333 334 fit_free (modfit); 344 345 if (keepRef) { 346 fit_free (modfit); 347 } else { 348 fit_apply (fit, &coords[0].crval1, &coords[0].crval2, coords[0].crpix1, coords[0].crpix2); 349 } 335 350 /* keep the order and type from initial values */ 336 351 -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/initialize.c
r28184 r28720 100 100 initstats (STATMODE); 101 101 102 // IMAGE_BAD = ID_IMAGE_ POOR | ID_IMAGE_FEW | ID_IMAGE_SKIP;102 // IMAGE_BAD = ID_IMAGE_ASTROM_POOR | ID_IMAGE_ASTROM_FEW | ID_IMAGE_ASTROM_SKIP; 103 103 // STAR_BAD = ID_STAR_POOR | ID_STAR_FEW; 104 104 // MEAS_BAD = ID_MEAS_NOCAL | ID_MEAS_POOR_ASTROM | ID_MEAS_SKIP_ASTROM | ID_MEAS_AREA; -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/load_images.c
r27581 r28720 33 33 // convert database table to internal structure 34 34 image = gfits_table_get_Image (&db[0].ftable, &Nimage, &db[0].swapped); 35 if (!image) { 36 fprintf (stderr, "ERROR: failed to read images\n"); 37 exit (2); 38 } 39 35 40 MARKTIME(" convert image table: %f sec\n", dtime); 36 41 … … 52 57 return (skylist); 53 58 } 59 60 int reload_images (FITS_DB *db) { 61 62 Image *image; 63 off_t Nimage, Nx, i; 64 VTable *vtable; 65 66 image = getimages (&Nimage); 67 68 vtable = &db[0].vtable; 69 70 gfits_scan (vtable[0].header, "NAXIS1", OFF_T_FMT, 1, &Nx); 71 for (i = 0; i < Nimage; i++) { 72 memcpy (vtable[0].buffer[i], &image[i], Nx); 73 } 74 return (TRUE); 75 } -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/mkpolyterm.c
r27581 r28720 66 66 Xo -= beta[0][0]; 67 67 Yo -= beta[1][0]; 68 68 69 dPos = hypot(beta[0][0], beta[1][0]); 69 70 if (i == 0) { -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/relastro.c
r28695 r28720 1 1 # include "relastro.h" 2 3 # define MARKTIME(MSG,...) { \4 float dtime; \5 gettimeofday (&stop, (void *) NULL); \6 dtime = DTIME (stop, start); \7 fprintf (stderr, MSG, __VA_ARGS__); }8 2 9 3 int main (int argc, char **argv) { … … 103 97 freeImageBins (1); 104 98 99 reload_images (&db); 100 105 101 // iterate over catalogs to make detection coordinates consistant 106 102 UpdateObjectOffsets (skylist); -
branches/eam_branches/ipp-20100621/Ohana/src/relastro/src/select_images.c
r28241 r28720 28 28 double *RmaxSky; 29 29 off_t *index; 30 31 int badImage = 32 ID_IMAGE_ASTROM_POOR | 33 ID_IMAGE_ASTROM_FAIL | 34 ID_IMAGE_ASTROM_FEW; 30 35 31 36 if (skylist[0].Nregions < 1) { … … 171 176 image[nimage] = timage[i]; 172 177 /* always allow 'few' images to succeed, if possible */ 173 if (image[nimage].flags & ID_IMAGE_ FEW) {174 image[nimage].flags &= ~ (ID_IMAGE_FEW | ID_IMAGE_POOR);178 if (image[nimage].flags & ID_IMAGE_ASTROM_FEW) { 179 image[nimage].flags &= ~ID_IMAGE_ASTROM_FEW; 175 180 } 176 181 if (RESET) { … … 178 183 assignMcal (&image[nimage], (double *) NULL, -1); 179 184 image[nimage].dMcal = NAN; 180 image[nimage].flags &= ~ ID_IMAGE_POOR;185 image[nimage].flags &= ~badImage; 181 186 } 182 187 line_number[nimage] = i;
Note:
See TracChangeset
for help on using the changeset viewer.
