Changeset 20192
- Timestamp:
- Oct 16, 2008, 9:19:59 AM (18 years ago)
- Location:
- trunk/Ohana/src/relphot/src
- Files:
-
- 2 edited
-
MosaicOps.c (modified) (7 diffs)
-
StarOps.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/MosaicOps.c
r19897 r20192 313 313 int setMmos (Catalog *catalog, int PoorImages) { 314 314 315 int i, j, m, c, n, N, Nmax, mark, bad ;315 int i, j, m, c, n, N, Nmax, mark, bad, Nfew, Nbad, Ncal, Nrel, Ngrid, Nsys; 316 316 float Msys, Mrel, Mcal, Mgrid; 317 317 double *list, *dlist, *Mlist, *dMlist; … … 335 335 ALLOCATE (Mlist, double, Nmax); 336 336 ALLOCATE (dMlist, double, Nmax); 337 338 Nfew = Nbad = Ncal = Nrel = Ngrid = Nsys = 0; 337 339 338 340 for (i = 0; i < Nmosaic; i++) { … … 350 352 c = clist[i][j]; 351 353 352 if (catalog[c].measure[m].dbFlags & MEAS_BAD) continue; 354 if (catalog[c].measure[m].dbFlags & MEAS_BAD) { 355 Nbad ++; 356 continue; 357 } 353 358 Mcal = getMcal (m, c); 354 if (isnan(Mcal)) continue; 359 if (isnan(Mcal)) { 360 Ncal++; 361 continue; 362 } 355 363 Mgrid = getMgrid (m, c); 356 if (isnan(Mgrid)) continue; 364 if (isnan(Mgrid)) { 365 Ngrid ++; 366 continue; 367 } 357 368 Mrel = getMrel (catalog, m, c); 358 if (isnan(Mrel)) continue; 369 if (isnan(Mrel)) { 370 Nrel ++; 371 continue; 372 } 359 373 360 374 n = catalog[c].measure[m].averef; 361 375 Msys = PhotSys (&catalog[c].measure[m], &catalog[c].average[n], &catalog[c].secfilt[n*PhotNsec]); 376 if (isnan(Msys)) { 377 Nsys++; 378 continue; 379 } 362 380 list[N] = Msys - Mrel - Mcal - Mgrid; 363 381 dlist[N] = MAX (catalog[c].measure[m].dM, MIN_ERROR); … … 375 393 fprintf (stderr, "marked image %s (%d), (%d < %d) || (%d < %f*%d)\n", image[imlist[i][0]].name, i, N, IMAGE_TOOFEW, N, IMAGE_GOOD_FRACTION, Nlist[i]); 376 394 mosaic[i].code |= ID_IMAGE_FEW; 395 Nfew ++; 377 396 } else { 378 397 mosaic[i].code &= ~ID_IMAGE_FEW; … … 389 408 free (Mlist); 390 409 free (dMlist); 410 411 fprintf (stderr, "%d mosaics marked having too few measurements (Nbad: %d, Ncal: %d, Ngrid: %d, Nrel: %d, Nsys: %d)\n", Nfew, Nbad, Ncal, Ngrid, Nrel, Nsys); 391 412 392 413 if (PoorImages) { … … 640 661 graphdata.ymin = PlotdMmin; 641 662 graphdata.ymax = PlotdMmax; 642 plot_list (&graphdata, xlist, Mlist, Nmosaic, "airmass vs Mcal", " airmass.png");663 plot_list (&graphdata, xlist, Mlist, Nmosaic, "airmass vs Mcal", "%s.airmass.png", OUTROOT); 643 664 plot_defaults (&graphdata); 644 665 graphdata.size = 1.5; 645 666 graphdata.ptype = 7; 646 plot_list (&graphdata, Mlist, dlist, Nmosaic, "Mcal vs dMcal", " MdM.png");667 plot_list (&graphdata, Mlist, dlist, Nmosaic, "Mcal vs dMcal", "%s.MdM.png", OUTROOT); 647 668 648 669 # define NBIN 200 … … 660 681 plot_defaults (&graphdata); 661 682 graphdata.style = 1; 662 plot_list (&graphdata, xlist, Mlist, NBIN, "dMcal hist", " dMcalhist.png");683 plot_list (&graphdata, xlist, Mlist, NBIN, "dMcal hist", "%s.dMcalhist.png", OUTROOT); 663 684 664 685 free (dlist); -
trunk/Ohana/src/relphot/src/StarOps.c
r17285 r20192 34 34 int setMrel (Catalog *catalog, int Ncatalog) { 35 35 36 int i, j, k, m, N ;36 int i, j, k, m, N, Nfew, Nsys, Nbad, Ncal, Nmos, Ngrid; 37 37 float Msys, Mcal, Mmos, Mgrid; 38 38 StatType stats; 39 40 Nfew = Nsys = Nbad = Ncal = Nmos = Ngrid = 0; 39 41 40 42 for (i = 0; i < Ncatalog; i++) { … … 47 49 N = 0; 48 50 for (k = 0; k < catalog[i].average[j].Nmeasure; k++, m++) { 49 if (catalog[i].measure[m].dbFlags & MEAS_BAD) continue; 51 if (catalog[i].measure[m].dbFlags & MEAS_BAD) { 52 Nbad ++; 53 continue; 54 } 50 55 // XXX allow REF stars (no Image Entry) to be included in the calculation this 51 56 // should be optionally set, and should allow for REF stars to be downweighted by … … 55 60 } else { 56 61 Mcal = getMcal (m, i); 57 if (isnan(Mcal)) continue; 62 if (isnan(Mcal)) { 63 Ncal ++; 64 continue; 65 } 58 66 Mmos = getMmos (m, i); 59 if (isnan(Mmos)) continue; 67 if (isnan(Mmos)) { 68 Nmos ++; 69 continue; 70 } 60 71 Mgrid = getMgrid (m, i); 61 if (isnan(Mgrid)) continue; 72 if (isnan(Mgrid)) { 73 Ngrid++; 74 continue; 75 } 62 76 } 63 77 64 78 Msys = PhotSys (&catalog[i].measure[m], &catalog[i].average[j], &catalog[i].secfilt[j*PhotNsec]); 79 if (isnan(Msys)) { 80 Nsys++; 81 continue; 82 } 65 83 list[N] = Msys - Mcal - Mmos - Mgrid; 66 84 dlist[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR); … … 69 87 if (N < STAR_TOOFEW) { /* too few measurements */ 70 88 catalog[i].average[j].code |= ID_STAR_FEW; 89 Nfew ++; 71 90 } else { 72 91 catalog[i].average[j].code &= ~ID_STAR_FEW; … … 80 99 } 81 100 } 101 fprintf (stderr, "%d stars marked having too few measurements (Nbad: %d, Ncal: %d, Nmos: %d, Ngrid: %d, Nsys: %d)\n", Nfew, Nbad, Ncal, Nmos, Ngrid, Nsys); 102 82 103 return (TRUE); 83 104 } … … 523 544 double *xlist, *Mlist; 524 545 Graphdata graphdata; 546 char *filename, tmp; 525 547 526 548 # define NBIN 200 … … 542 564 plot_defaults (&graphdata); 543 565 graphdata.style = 1; 544 plot_list (&graphdata, xlist, Mlist, NBIN, "dMrel hist", " dMhist.png");566 plot_list (&graphdata, xlist, Mlist, NBIN, "dMrel hist", "%s.dMhist.png", OUTROOT); 545 567 546 568 free (xlist); … … 574 596 plot_defaults (&graphdata); 575 597 graphdata.ymin = -3.0; 576 plot_list (&graphdata, xlist, ylist, N, "chisq", NULL);598 plot_list (&graphdata, xlist, ylist, N, "chisq", "%s.chisq.png", OUTROOT); 577 599 free (xlist); 578 600 free (ylist); … … 604 626 } 605 627 plot_defaults (&graphdata); 606 plot_list (&graphdata, xlist, ylist, N, "coords", NULL);628 plot_list (&graphdata, xlist, ylist, N, "coords", "%s.coords.png", OUTROOT); 607 629 608 630 free (xlist);
Note:
See TracChangeset
for help on using the changeset viewer.
