Changeset 20187
- Timestamp:
- Oct 16, 2008, 9:16:28 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/relphot/src/ImageOps.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/ImageOps.c
r19897 r20187 187 187 if (strncmp (pname, base, strlen (base))) continue; 188 188 p = pname + strlen(base); 189 190 /* p is pointing at the DETECTOR ID part of the photcode: CAMERA.FILTER.DETECTOR 191 for now, we will let this be of the form SSSSnn where SSS is an arbitrary string 192 and nn is an integer -> ccdnum */ 193 194 while (!isdigit(*p) && *p) p++; 189 195 if (*p == 0) continue; 190 196 ccdnum = atoi (p); 191 /* some ambiguity here between seq number and id number */ 192 197 198 /* ccdnum is an integer, but not necessarily a sequence number. when the camera layout is 199 constructed, there will be null values for undefined ccdnums */ 200 201 # if (0) 193 202 /* add this measurement to the grid cell for this chip */ 194 203 ave = measure[0].averef; … … 198 207 /* X,Y always positive-definite in range 0,0 - dX, dY */ 199 208 RD_to_XY (&X, &Y, ra, dec, &image[i].coords); 209 # endif 210 211 // XXX we can now use these values (but need to be careful about old formats) 212 X = measure[0].Xccd; 213 Y = measure[0].Yccd; 200 214 setGridMeasure (meas, cat, X, Y, ccdnum); 201 215 } … … 251 265 void setMcal (Catalog *catalog, int PoorImages) { 252 266 253 int i, j, m, c, n, N, Nmax, mark, bad ;267 int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys; 254 268 float Msys, Mrel, Mmos, Mgrid; 255 269 double *list, *dlist; … … 268 282 ALLOCATE (list, double, Nmax); 269 283 ALLOCATE (dlist, double, Nmax); 284 285 Nfew = Nbad = Nmos = Ngrid = Nrel = Nsys = 0; 270 286 271 287 for (i = 0; i < Nimage; i++) { … … 283 299 c = clist[i][j]; 284 300 285 if (catalog[c].measure[m].dbFlags & MEAS_BAD) continue; 301 if (catalog[c].measure[m].dbFlags & MEAS_BAD) { 302 Nbad++; 303 continue; 304 } 286 305 Mmos = getMmos (m, c); 287 if (isnan(Mmos)) continue; 306 if (isnan(Mmos)) { 307 Nmos ++; 308 continue; 309 } 288 310 Mgrid = getMgrid (m, c); 289 if (isnan(Mgrid)) continue; 311 if (isnan(Mgrid)) { 312 Ngrid++; 313 continue; 314 } 290 315 Mrel = getMrel (catalog, m, c); 291 if (isnan(Mrel)) continue; 316 if (isnan(Mrel)) { 317 Nrel ++; 318 continue; 319 } 292 320 293 321 n = catalog[c].measure[m].averef; 294 322 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 323 if (isnan(Msys)) { 324 Nsys++; 325 continue; 326 } 295 327 list[N] = Msys - Mrel - Mmos - Mgrid; 296 328 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); … … 304 336 if (mark) { 305 337 image[i].code |= ID_IMAGE_FEW; 338 Nfew ++; 306 339 } else { 307 340 image[i].code &= ~ID_IMAGE_FEW; … … 316 349 free (list); 317 350 free (dlist); 351 352 fprintf (stderr, "%d images marked having too few measurements (Nbad: %d, Nmos: %d, Ngrid: %d, Nrel: %d, Nsys: %d)\n", Nfew, Nbad, Nmos, Ngrid, Nrel, Nsys); 353 318 354 if (PoorImages) { 319 355 IMAGE_BAD = ID_IMAGE_POOR | ID_IMAGE_FEW | ID_IMAGE_SKIP; … … 397 433 graphdata.ymin = PlotdMmin; 398 434 graphdata.ymax = PlotdMmax; 399 plot_list (&graphdata, xlist, Mlist, Nimage, "airmass vs Mcal", " airmass.png");435 plot_list (&graphdata, xlist, Mlist, Nimage, "airmass vs Mcal", "%s.airmass.png", OUTROOT); 400 436 plot_defaults (&graphdata); 401 plot_list (&graphdata, Mlist, dlist, Nimage, "Mcal vs dMcal", NULL);437 plot_list (&graphdata, Mlist, dlist, Nimage, "Mcal vs dMcal", "%s.Mcal.dMcal.png", OUTROOT); 402 438 403 439 # define NBIN 200 … … 416 452 plot_defaults (&graphdata); 417 453 graphdata.style = 1; 418 plot_list (&graphdata, xlist, Mlist, NBIN, "dMcal hist", " dMcalhist.png");454 plot_list (&graphdata, xlist, Mlist, NBIN, "dMcal hist", "%s.dMcalhist.png", OUTROOT); 419 455 420 456 free (dlist);
Note:
See TracChangeset
for help on using the changeset viewer.
