Changeset 38433
- Timestamp:
- Jun 11, 2015, 4:42:16 AM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150419/Ohana/src/relphot/src
- Files:
-
- 4 edited
-
args.c (modified) (2 diffs)
-
reload_catalogs.c (modified) (1 diff)
-
setMrelCatalog.c (modified) (13 diffs)
-
setMrelFinal.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150419/Ohana/src/relphot/src/args.c
r38317 r38433 375 375 } 376 376 377 // if -synthphot _zpts is supplied, the map of corrections needed for the synthetic photometry is supplied377 // if -synthphot-zpts is supplied, the map of corrections needed for the synthetic photometry is supplied 378 378 // and used to tie down the synthetic magnitudes 379 // NOTE: SYNTH_ZERO_POINTS is used for the same file in both -synthphot _zpts and -synthphot_means379 // NOTE: SYNTH_ZERO_POINTS is used for the same file in both -synthphot-zpts and -synthphot_means 380 380 SYNTH_ZERO_POINTS = NULL; 381 if ((N = get_argument (argc, argv, "-synthphot _zpts"))) {382 remove_argument (N, &argc, argv); 383 myAssert (N < argc, "missing argument to -synthphot _zpts");381 if ((N = get_argument (argc, argv, "-synthphot-zpts"))) { 382 remove_argument (N, &argc, argv); 383 myAssert (N < argc, "missing argument to -synthphot-zpts"); 384 384 SYNTH_ZERO_POINTS = strcreate (argv[N]); 385 385 remove_argument (N, &argc, argv); … … 495 495 } 496 496 SYNTH_ZERO_POINTS = NULL; 497 if ((N = get_argument (argc, argv, "-synthphot _zpts"))) {498 remove_argument (N, &argc, argv); 499 myAssert (N < argc, "missing argument to -synthphot _zpts");497 if ((N = get_argument (argc, argv, "-synthphot-zpts"))) { 498 remove_argument (N, &argc, argv); 499 myAssert (N < argc, "missing argument to -synthphot-zpts"); 500 500 SYNTH_ZERO_POINTS = strcreate (argv[N]); 501 501 remove_argument (N, &argc, argv); -
branches/eam_branches/ipp-20150419/Ohana/src/relphot/src/reload_catalogs.c
r38317 r38433 65 65 66 66 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 67 fprintf (stderr, "ERROR: failure reading catalog %s\n", catalog.filename); 68 exit (1); 67 fprintf (stderr, "ERROR: failure reading catalog %s, skipping\n", catalog.filename); 68 continue; 69 // exit (1); 69 70 } 70 71 if (VERBOSE && (catalog.Naves_disk == 0)) { -
branches/eam_branches/ipp-20150419/Ohana/src/relphot/src/setMrelCatalog.c
r38432 r38433 12 12 continue; } 13 13 14 # define CHECK_VALID_MAG(MAG ) (!isnan(MAG) && (MAG > -5.0) && (MAG < 30.0))15 # define CHECK_VALID_FLUX(FLUX ) (!isnan(FLUX))14 # define CHECK_VALID_MAG(MAG,D_MAG) (isfinite(MAG) && isfinite(D_MAG) && (MAG > -5.0) && (MAG < 30.0)) 15 # define CHECK_VALID_FLUX(FLUX,D_FLUX) (isfinite(FLUX) && isfinite(D_FLUX)) 16 16 17 17 static float MagToFlux (float Mag) { … … 126 126 // assign measurements to the photcode lists 127 127 for (k = 0; k < averageT[0].Nmeasure; k++) { 128 129 // these bits should not be set unless we use them in this pass 130 measure[k].dbFlags &= ~(ID_MEAS_PHOTOM_PSF | ID_MEAS_PHOTOM_APER | ID_MEAS_PHOTOM_KRON); 128 131 129 132 // skip measurements that do not have a valid photcode (raise exception?) … … 214 217 Map = PhotCat (&measure[k], MAG_CLASS_APER); 215 218 dMap = MAX (hypot(measure[k].dMap, code->photomErrSys), MIN_ERROR); 216 if (CHECK_VALID_MAG(Map )) {219 if (CHECK_VALID_MAG(Map, dMap)) { 217 220 int Nap = results->aperData[Nsec].Nlist; 218 221 results->aperData[Nsec].flxlist[Nap] = Map - Mcal - Mmos - Mgrid; … … 229 232 Mkron = PhotCat (&measure[k], MAG_CLASS_KRON); 230 233 dMkron = MAX (hypot(measure[k].dMkron, code->photomErrSys), MIN_ERROR); 231 if (CHECK_VALID_MAG(Mkron )) {234 if (CHECK_VALID_MAG(Mkron, dMkron)) { 232 235 int Nkron = results->kronData[Nsec].Nlist; 233 236 results->kronData[Nsec].flxlist[Nkron] = Mkron - Mcal - Mmos - Mgrid; … … 242 245 float Mpsf = PhotSysTiny (&measureT[k], &averageT[0], &secfilt[0], MAG_CLASS_PSF); 243 246 float dMpsf = MAX (hypot(measureT[k].dM, code->photomErrSys), MIN_ERROR); 244 if (CHECK_VALID_MAG(Mpsf )) {247 if (CHECK_VALID_MAG(Mpsf, dMpsf)) { 245 248 int Npsf = results->psfData[Nsec].Nlist; 246 249 results->psfData[Nsec].flxlist[Npsf] = Mpsf - Mcal - Mmos - Mgrid; … … 338 341 339 342 if (isSetMrelFinal) { 340 if ( (average->objID == 0x1) && (average->catID)) {343 if (FALSE && (average->objID == 0x1) && (average->catID)) { 341 344 fprintf (stderr, "test obj\n"); 342 345 } … … 555 558 if (isnan(Finst)) SKIP_THIS_MEAS_STACK(Ninst); 556 559 560 // choose the best psfQFperf value for the BEST measurement 557 561 if (measure[k].psfQFperf > psfQFbest) { 558 562 psfQFbest = measure[k].psfQFperf; 563 stackBestMeasure = k; 564 } 565 // ... UNLESS psfQFperf > 0.98 for the primary, in which case just use the primary. 566 if ((measure[k].dbFlags & ID_MEAS_STACK_PRIMARY) && (measure[k].psfQFperf > 0.98)) { 559 567 stackBestMeasure = k; 560 568 } … … 678 686 float Mcal = 0; 679 687 688 SetMrelInfoResetObject (results); // reset the per-object arrays 689 680 690 // option for a test print 681 if ( (average[0].objID == 0xd6e) && (average[0].catID == 0x4984)) {691 if (FALSE && (average[0].objID == 0x0000020d) && (average[0].catID == 0x000049e1)) { 682 692 fprintf (stderr, "test obj\n"); 683 693 print_measure_set_alt (average, secfilt, measure); … … 704 714 off_t meas = measureOffset + k; 705 715 716 measure[k].dbFlags &= ~ID_MEAS_WARP_USED; // this should not be set unless we use it in this pass 717 706 718 // skip measurements that do not have a valid photcode (raise exception?) 707 719 PhotCode *code = GetPhotcodebyCode (measure[k].photcode); … … 717 729 results->Nmeas[Nsec] ++; 718 730 if (measure[k].psfQFperf > 0.85) results->NmeasGood[Nsec] ++; 719 720 measure[k].dbFlags &= ~ID_MEAS_WARP_USED;721 731 722 732 // use primary skycell for DIFF, stack skycell for WARP … … 749 759 float Fpsf = PhotFluxCat (&measure[k], MAG_CLASS_PSF); 750 760 float dFpsf = PhotFluxCatErr (&measure[k], MAG_CLASS_PSF); 751 if (CHECK_VALID_FLUX(Fpsf)) { 761 if (CHECK_VALID_FLUX(Fpsf, dFpsf)) { 762 dFpsf = MAX (hypot(dFpsf, code->photomErrSys*Fpsf), MIN_ERROR*Fpsf); // bump up the error by a systematic floor 752 763 int Npsf = results->psfData[Nsec].Nlist; 753 764 results->psfData[Nsec].flxlist[Npsf] = Fpsf * Fcal; … … 761 772 float Fap = PhotFluxCat (&measure[k], MAG_CLASS_APER); 762 773 float dFap = PhotFluxCatErr (&measure[k], MAG_CLASS_APER); 763 if (CHECK_VALID_FLUX(Fap)) { 774 if (CHECK_VALID_FLUX(Fap, dFap)) { 775 dFap = MAX (hypot(dFap, code->photomErrSys*Fap), MIN_ERROR*Fap); // bump up the error by a systematic floor 764 776 int Naper = results->aperData[Nsec].Nlist; 765 777 results->aperData[Nsec].flxlist[Naper] = Fap * Fcal; … … 773 785 float Fkron = PhotFluxCat (&measure[k], MAG_CLASS_KRON); 774 786 float dFkron = PhotFluxCatErr (&measure[k], MAG_CLASS_KRON); 775 if (CHECK_VALID_FLUX(Fkron)) { 787 if (CHECK_VALID_FLUX(Fkron, dFkron)) { 788 dFkron = MAX (hypot(dFkron, code->photomErrSys*Fkron), MIN_ERROR*Fkron); // bump up the error by a systematic floor 776 789 int Nkron = results->kronData[Nsec].Nlist; 777 790 results->kronData[Nsec].flxlist[Nkron] = Fkron * Fcal; -
branches/eam_branches/ipp-20150419/Ohana/src/relphot/src/setMrelFinal.c
r38317 r38433 329 329 330 330 // RANK 2 : psfQF value 331 if ( measure[i].psfQF < 0.85){ measureRank[i] = 4; continue; }331 if (!isfinite(measure[i].psfQF) || measure[i].psfQF < 0.85) { measureRank[i] = 4; continue; } 332 332 333 333 // RANK 1 : POOR photFlags … … 338 338 339 339 // RANK 1 : psfQFperfect value 340 if ( measure[i].psfQFperf < 0.85){ measureRank[i] = 1; continue; }340 if (!isfinite(measure[i].psfQFperf) || measure[i].psfQFperf < 0.85) { measureRank[i] = 1; continue; } 341 341 342 342 // RANK 0 : perfect measurement:
Note:
See TracChangeset
for help on using the changeset viewer.
