Changeset 30554
- Timestamp:
- Feb 10, 2011, 10:39:48 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101205/Ohana/src/relphot
- Files:
-
- 6 edited
-
include/relphot.h (modified) (3 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/ImageOps.c (modified) (5 diffs)
-
src/MosaicOps.c (modified) (3 diffs)
-
src/args.c (modified) (1 diff)
-
src/select_images.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/Ohana/src/relphot/include/relphot.h
r30443 r30554 13 13 float Mcal; 14 14 float dMcal; 15 float dMsys; 16 short nFitPhotom; 15 17 short Xm; 16 18 float secz; … … 50 52 double STAR_CHISQ; 51 53 double MIN_ERROR; 54 double IMFIT_SYS_SIGMA_LIM; 52 55 53 56 int VERBOSE; … … 103 106 SkyRegion UserPatch; 104 107 int UserPatchSelect; 108 109 int USE_BASIC_CHECK; 105 110 106 111 # ifdef GRID_V1 -
branches/eam_branches/ipp-20101205/Ohana/src/relphot/src/ConfigInit.c
r25757 r30554 20 20 GetConfig (config, "MAG_LIM", "%lf", 0, &MAG_LIM); 21 21 GetConfig (config, "SIGMA_LIM", "%lf", 0, &SIGMA_LIM); 22 23 if (!ScanConfig (config, "RELPHOT_IMFIT_SYS_SIGMA_LIM", "%lf", 0, &IMFIT_SYS_SIGMA_LIM)) IMFIT_SYS_SIGMA_LIM = 0.01; 24 22 25 GetConfig (config, "STAR_SCATTER", "%lf", 0, &STAR_SCATTER); 23 26 GetConfig (config, "IMAGE_SCATTER", "%lf", 0, &IMAGE_SCATTER); -
branches/eam_branches/ipp-20101205/Ohana/src/relphot/src/ImageOps.c
r29001 r30554 124 124 free (clist); 125 125 free (mlist); 126 free (Nlist); 127 free (NLIST); 126 128 } 127 129 … … 299 301 300 302 off_t i, j, m, c, n, N, Nmax, mark, bad; 301 int Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys ;302 float Msys, Mrel, Mmos, Mgrid ;303 int Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys, Nbright; 304 float Msys, Mrel, Mmos, Mgrid, McalBright, McalBright2; 303 305 double *list, *dlist; 304 306 StatType stats; … … 318 320 319 321 Nfew = Nbad = Nmos = Ngrid = Nrel = Nsys = 0; 322 323 // counters to measure the bright-end scatter 324 McalBright = McalBright2 = 0.0; 325 Nbright = 0; 320 326 321 327 for (i = 0; i < Nimage; i++) { … … 361 367 list[N] = Msys - Mrel - Mmos - Mgrid; 362 368 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); 369 if (catalog[c].measure[m].dM < IMFIT_SYS_SIGMA_LIM) { 370 McalBright += list[N]; 371 McalBright2 += SQ(list[N]); 372 Nbright ++; 373 } 363 374 N++; 364 375 } … … 378 389 liststats (list, dlist, N, &stats); 379 390 image[i].Mcal = stats.mean; 380 image[i].dMcal = stats.sigma; 391 image[i].dMcal = stats.error; 392 image[i].dMagSys = stats.sigma; 393 image[i].nFitPhotom = N; 381 394 image[i].Xm = 100.0*log10(stats.chisq); 382 395 } -
branches/eam_branches/ipp-20101205/Ohana/src/relphot/src/MosaicOps.c
r30443 r30554 73 73 mosaic[Nmosaic].Mcal = 0.0; 74 74 mosaic[Nmosaic].dMcal = 0.0; 75 mosaic[Nmosaic].dMsys = 0.0; 75 76 mosaic[Nmosaic].Xm = 0.0; 76 77 mosaic[Nmosaic].flags = image[i].flags; … … 189 190 image[im].dMcal = mosaic[i].dMcal; 190 191 image[im].Xm = mosaic[i].Xm; 192 image[im].dMagSys = mosaic[i].dMsys; 193 image[im].nFitPhotom = mosaic[i].nFitPhotom; 191 194 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_FEW); 192 195 image[im].flags |= (mosaic[i].flags & ID_IMAGE_PHOTOM_POOR); … … 410 413 if (PoorImages) fprintf (stderr, "Mmos: %f %f %d "OFF_T_FMT"\n", stats.mean, stats.sigma, stats.Nmeas, N); 411 414 mosaic[i].Mcal = stats.mean; 412 mosaic[i].dMcal = stats.sigma; 415 mosaic[i].dMcal = stats.error; 416 mosaic[i].dMsys = stats.sigma; 417 mosaic[i].nFitPhotom = N; 413 418 mosaic[i].Xm = 100.0*log10(stats.chisq); 414 419 } -
branches/eam_branches/ipp-20101205/Ohana/src/relphot/src/args.c
r30443 r30554 52 52 } 53 53 54 USE_BASIC_CHECK = FALSE; 55 if ((N = get_argument (argc, argv, "-basic-image-search"))) { 56 remove_argument (N, &argc, argv); 57 USE_BASIC_CHECK = TRUE; 58 } 59 54 60 VERBOSE = VERBOSE2 = FALSE; 55 61 if ((N = get_argument (argc, argv, "-v"))) { -
branches/eam_branches/ipp-20101205/Ohana/src/relphot/src/select_images.c
r30503 r30554 33 33 struct timeval start, stop; 34 34 35 double RmaxSkyRegion, RminSkyRegion, DminSkyRegion, DmaxSkyRegion ;35 double RmaxSkyRegion, RminSkyRegion, DminSkyRegion, DmaxSkyRegion, RmidSkyRegion; 36 36 37 37 double *RmaxSky; … … 97 97 DmaxSkyRegion = MAX(DmaxSkyRegion, skylist[0].regions[i][0].Dmax); 98 98 } 99 RmidSkyRegion = 0.5*(RminSkyRegion + RmaxSkyRegion); 99 100 MARKTIME("create sky region coords: %f sec\n", dtime); 100 101 … … 145 146 for (j = 0; j < 5; j++) { 146 147 XY_to_RD (&Ri[j], &Di[j], Xi[j], Yi[j], &timage[i].coords); 148 Ri[j] = ohana_normalize_angle_to_midpoint (Ri[j], RmidSkyRegion); 149 147 150 RminImage = MIN(RminImage, Ri[j]); 148 151 RmaxImage = MAX(RmaxImage, Ri[j]); … … 164 167 if (RmaxImage < RminSkyRegion) continue; 165 168 169 // image overlaps region, keep it 170 if (USE_BASIC_CHECK) goto found_it; 171 166 172 // RA(nStart) is guaranteed to be < RminImage: -- costs 0.5sec for 3M images 167 173 nStart = getRegionStartByRA (RminImage, RmaxSky, skylist[0].Nregions); … … 186 192 for (j = 0; (j < 4) && !found; j++) { 187 193 found = corner_check (&Xi[j], &Yi[j], &skycoords[m].Xc[0], &skycoords[m].Yc[0]); 194 if (found) goto found_it; 188 195 } 189 196 /* check if catalog corner inside image */ 190 197 for (j = 0; (j < 4) && !found; j++) { 191 198 found = corner_check (&skycoords[m].Xc[j], &skycoords[m].Yc[j], &Xi[0], &Yi[0]); 199 if (found) goto found_it; 192 200 } 193 201 /* check if edges cross */ … … 195 203 for (k = 0; (k < 4) && !found; k++) { 196 204 found = edge_check (&Xi[j], &Yi[j], &skycoords[m].Xc[k], &skycoords[m].Yc[k]); 205 if (found) goto found_it; 197 206 } 198 207 } 199 if (!found) continue; 200 201 image[nimage] = timage[i]; 202 /* always allow 'few' images to succeed, if possible */ 203 if (image[nimage].flags & ID_IMAGE_PHOTOM_FEW) { 204 image[nimage].flags &= ~(ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_POOR); 205 } 206 if (RESET) { 207 // XXX assignMcal (&image[nimage], (double *) NULL, -1); 208 // XXX this needs to be thought through a bit more 209 image[nimage].Mcal = 0.0; 210 image[nimage].dMcal = NAN; 211 image[nimage].flags &= ~ID_IMAGE_PHOTOM_POOR; 212 } 213 line_number[nimage] = i; 214 nimage ++; 215 if (nimage == NIMAGE) { 216 NIMAGE += 100; 217 REALLOCATE (image, Image, NIMAGE); 218 REALLOCATE (line_number, off_t, NIMAGE); 219 } 208 } 209 if (!found) continue; 210 211 found_it: 212 image[nimage] = timage[i]; 213 /* always allow 'few' images to succeed, if possible */ 214 if (image[nimage].flags & ID_IMAGE_PHOTOM_FEW) { 215 image[nimage].flags &= ~(ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_POOR); 216 } 217 if (RESET) { 218 // XXX assignMcal (&image[nimage], (double *) NULL, -1); 219 // XXX this needs to be thought through a bit more 220 image[nimage].Mcal = 0.0; 221 image[nimage].dMcal = NAN; 222 image[nimage].flags &= ~ID_IMAGE_PHOTOM_POOR; 223 } 224 line_number[nimage] = i; 225 nimage ++; 226 if (nimage == NIMAGE) { 227 NIMAGE += 100; 228 REALLOCATE (image, Image, NIMAGE); 229 REALLOCATE (line_number, off_t, NIMAGE); 220 230 } 221 231 }
Note:
See TracChangeset
for help on using the changeset viewer.
