Changeset 42821 for trunk/Ohana/src/relphot
- Timestamp:
- May 8, 2025, 4:29:52 PM (14 months ago)
- Location:
- trunk/Ohana
- Files:
-
- 14 edited
-
. (modified) (1 prop)
-
src/relphot (modified) (1 prop)
-
src/relphot/include/relphot.h (modified) (3 diffs)
-
src/relphot/src/ConfigInit.c (modified) (1 diff)
-
src/relphot/src/ImageOps.c (modified) (3 diffs)
-
src/relphot/src/StarOps.c (modified) (14 diffs)
-
src/relphot/src/args.c (modified) (4 diffs)
-
src/relphot/src/bcatalog.c (modified) (12 diffs)
-
src/relphot/src/extra.c (modified) (3 diffs)
-
src/relphot/src/fit1d_irls.c (modified) (2 diffs)
-
src/relphot/src/initialize.c (modified) (1 diff)
-
src/relphot/src/load_catalogs.c (modified) (2 diffs)
-
src/relphot/src/reload_catalogs.c (modified) (1 diff)
-
src/relphot/src/relphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20230313/Ohana/src/relphot merged: 42568,42696,42705,42708,42740,42761,42818
- Property svn:mergeinfo changed
-
trunk/Ohana/src/relphot/include/relphot.h
r42788 r42821 417 417 int IS_DIFF_DB; 418 418 419 double MAG_MIN; 419 420 double MAG_LIM; 420 421 double SIGMA_LIM; 422 423 double STAR_MAX_PSF_KRON; 424 double PSF_QF_MIN; 425 421 426 double IMAGE_SCATTER; 422 427 double IMAGE_OFFSET; … … 471 476 int RESET_FLATCORR; 472 477 int REPAIR_WARPS; 478 int USE_REF_EQUIV; 473 479 int PRESERVE_PS1; 474 480 int REQUIRE_PSFFIT; … … 486 492 double IMAGE_GOOD_FRACTION; 487 493 int CALIBRATE_STACKS_AND_WARPS; 494 int CALIBRATE_WARPS_LIKE_CHIPS; 495 int CALIBRATE_STACKS_LIKE_CHIPS; 488 496 489 497 int KEEP_UBERCAL; -
trunk/Ohana/src/relphot/src/ConfigInit.c
r41647 r42821 23 23 if (VERBOSE) fprintf (stderr, "loaded config file: %s\n", file); 24 24 25 GetConfig (config, "MAG_LIM", "%lf", 0, &MAG_LIM); 26 GetConfig (config, "SIGMA_LIM", "%lf", 0, &SIGMA_LIM); 25 // the following cuts are limit the objects used to calculate the image zero points. 26 // These are used in bcatalog.c and apply to Mcat (nominal measurement magnitude) 27 GetConfig (config, "SIGMA_LIM", "%lf", 0, &SIGMA_LIM); 28 GetConfig (config, "MAG_LIM", "%lf", 0, &MAG_LIM); 29 30 DefConfig ("MAG_MIN", "%lf", 15.0, MAG_MIN); 31 DefConfig ("STAR_MAX_PSF_KRON", "%lf", 0.2, STAR_MAX_PSF_KRON); 32 DefConfig ("PSF_QF_MIN", "%lf", 0.95, PSF_QF_MIN); 27 33 28 34 DefConfig ("STAR_SCATTER", "%lf", 0.1, STAR_SCATTER); -
trunk/Ohana/src/relphot/src/ImageOps.c
r41664 r42821 531 531 532 532 // until the analysis has converged a bit, do not use the IRLS analysis 533 // default is MaxIterations = 10 534 if (UseStandardOLS(ZPT_IMAGES)) { 533 // default is MaxIterations = 10. 534 535 // However, for stack and warp calibration, we are not iteratively solving for the 536 // zero points. In this case, use IRLS in a single pass 537 if (!CALIBRATE_STACKS_AND_WARPS && UseStandardOLS(ZPT_IMAGES)) { 535 538 brightStars.MaxIterations = 0; 536 539 kronStars.MaxIterations = 0; … … 672 675 673 676 if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) { 674 fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f %6.3f %6.3f %6.3f %6.3f : %6.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysKron, MrelKron, Mmos, Mgrid, Mflat, kronStars.alldata->yVector[Nkron]);677 fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f %6.3f | %6.3f %6.3f | %6.3f %6.3f %6.3f %6.3f | %5.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysPSF, MrelPSF, MsysKron, MrelKron, Mmos, Mgrid, Mflat, Moff, psfStars.alldata->dyVector[Nref]); 675 678 } 676 679 … … 702 705 if (mark) continue; 703 706 704 // use liststats to find the 20-pct, median, 80-pct points 705 StatType stats; 706 liststats_setmode (&stats, "MEDIAN"); 707 liststats (psfStars.alldata->yVector, NULL, NULL, Nref, &stats); 708 double altSigma = (stats.Upper80 - stats.Lower20) / 1.6; // 20% to 80% encompasses 60% of the values, corresponds to the range (-0.85 sigma : +0.85 sigma) 709 710 // soften the individual errors with 10% of the scatter above 711 for (j = 0; j < Nref; j++) { 712 double newSigma = hypot(psfStars.alldata->dyVector[j], 0.1*altSigma); 713 psfStars.alldata->dyVector[j] = newSigma; 714 } 715 716 // soften the errors based on the scatter 707 // soften the errors based on the core scatter 717 708 FitDataSetSoften (&psfStars, Nref); 718 709 -
trunk/Ohana/src/relphot/src/StarOps.c
r41647 r42821 34 34 } 35 35 36 // 36 // Nsecfilt is a property of the photcode table. we only need to retrieve it once. 37 static int Nsecfilt = -1; 38 39 // return the average photometry for this measurement 37 40 float getMrel (Catalog *catalog, off_t meas, int cat, dvoMagClassType class, dvoMagSourceType source) { 38 41 … … 41 44 42 45 int ecode = GetPhotcodeEquivCodebyCode (photcode); 46 if (USE_REF_EQUIV) { 47 // tie this photometry to an alternative refernce 48 // (e.g., tie UDR4.i to PV3.i) 49 int refcode = GetPhotcodeEquivCodebyCode (ecode); 50 if (refcode < 0) return NAN; 51 ecode = refcode; 52 } 53 43 54 int Nsec = GetPhotcodeNsec(ecode); 44 int Nsecfilt = GetPhotcodeNsecfilt (); 55 if (Nsec < 0) return NAN; 56 57 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 45 58 46 59 int entry = Nsecfilt*ave+Nsec; … … 312 325 } 313 326 314 i nt Nsecfilt = GetPhotcodeNsecfilt ();327 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 315 328 316 329 SetMrelInfo summary, results; … … 334 347 int i; 335 348 336 i nt Nsecfilt = GetPhotcodeNsecfilt ();349 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 337 350 338 351 SetMrelInfo summary, results; … … 424 437 ThreadInfo *threadinfo = data; 425 438 426 i nt Nsecfilt = GetPhotcodeNsecfilt ();439 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 427 440 428 441 SetMrelInfo results; … … 451 464 off_t k; 452 465 453 i nt Nsecfilt = GetPhotcodeNsecfilt ();466 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 454 467 455 468 off_t m = average[0].measureOffset; … … 559 572 off_t j; 560 573 561 i nt Nsecfilt = GetPhotcodeNsecfilt ();574 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 562 575 563 576 for (i = 0; i < Ncatalog; i++) { … … 601 614 ALLOCATE (slist, double, Ntot); 602 615 603 i nt Nsecfilt = GetPhotcodeNsecfilt ();616 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 604 617 605 618 // eliminate bad stars using the stats for a single secfilt at a time … … 666 679 // N1 = N2 = N3 = N4 = N0 = 0; 667 680 668 i nt Nsecfilt = GetPhotcodeNsecfilt ();681 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 669 682 670 683 Ntot = 0; … … 719 732 StatType stats; 720 733 721 i nt Nsecfilt = GetPhotcodeNsecfilt ();734 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 722 735 723 736 Ntot = 0; … … 760 773 StatType stats; 761 774 762 i nt Nsecfilt = GetPhotcodeNsecfilt ();775 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 763 776 764 777 Ntot = 0; … … 805 818 ALLOCATE (Mlist, double, NBIN); 806 819 807 i nt Nsecfilt = GetPhotcodeNsecfilt ();820 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 808 821 809 822 int Ns; … … 840 853 Graphdata graphdata; 841 854 842 i nt Nsecfilt = GetPhotcodeNsecfilt ();855 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 843 856 844 857 Ntotal = 0; … … 911 924 return; 912 925 913 i nt Nsecfilt = GetPhotcodeNsecfilt ();926 if (Nsecfilt < 0) { Nsecfilt = GetPhotcodeNsecfilt (); } 914 927 915 928 FILE *fout = NULL; -
trunk/Ohana/src/relphot/src/args.c
r42389 r42821 237 237 } 238 238 239 USE_REF_EQUIV = FALSE; 240 if ((N = get_argument (argc, argv, "-use-ref-equiv"))) { 241 remove_argument (N, &argc, argv); 242 USE_REF_EQUIV = TRUE; 243 } 239 244 PRESERVE_PS1 = FALSE; 240 245 if ((N = get_argument (argc, argv, "-preserve-ps1"))) { … … 521 526 remove_argument (N, &argc, argv); 522 527 USE_REFERENCE_WEIGHT = TRUE; 528 } 529 530 /* Normally, stacks and warps are treated differently from chips. In this case, 531 WHAT IS DIFFERENT? 532 */ 533 534 CALIBRATE_WARPS_LIKE_CHIPS = FALSE; 535 if ((N = get_argument (argc, argv, "-calibrate-warps-like-chips"))) { 536 remove_argument (N, &argc, argv); 537 CALIBRATE_WARPS_LIKE_CHIPS = TRUE; 538 } 539 CALIBRATE_STACKS_LIKE_CHIPS = FALSE; 540 if ((N = get_argument (argc, argv, "-calibrate-stacks-like-chips"))) { 541 remove_argument (N, &argc, argv); 542 CALIBRATE_STACKS_LIKE_CHIPS = TRUE; 523 543 } 524 544 … … 836 856 } 837 857 858 USE_REF_EQUIV = FALSE; 859 if ((N = get_argument (argc, argv, "-use-ref-equiv"))) { 860 remove_argument (N, &argc, argv); 861 USE_REF_EQUIV = TRUE; 862 } 838 863 PRESERVE_PS1 = FALSE; 839 864 if ((N = get_argument (argc, argv, "-preserve-ps1"))) { … … 978 1003 } 979 1004 1005 CALIBRATE_WARPS_LIKE_CHIPS = FALSE; 1006 if ((N = get_argument (argc, argv, "-calibrate-warps-like-chips"))) { 1007 remove_argument (N, &argc, argv); 1008 CALIBRATE_WARPS_LIKE_CHIPS = TRUE; 1009 } 1010 CALIBRATE_STACKS_LIKE_CHIPS = FALSE; 1011 if ((N = get_argument (argc, argv, "-calibrate-stacks-like-chips"))) { 1012 remove_argument (N, &argc, argv); 1013 CALIBRATE_STACKS_LIKE_CHIPS = TRUE; 1014 } 1015 980 1016 STAGES = STAGE_CHIP | STAGE_WARP | STAGE_STACK; 981 1017 if ((N = get_argument (argc, argv, "-skip-chip"))) { -
trunk/Ohana/src/relphot/src/bcatalog.c
r42389 r42821 1 1 # include "relphot.h" 2 3 # define BAD_COUNT(FIELD) \ 4 badCount.FIELD ++; \ 5 if (doTest1 && (catalog[0].measure[offset].imageID == TEST_IMAGE1)) { badTest1.FIELD ++; } \ 6 if (doTest2 && (catalog[0].measure[offset].imageID == TEST_IMAGE2)) { badTest2.FIELD ++; } 7 8 typedef struct { 9 int Ncode; 10 int Ntime; 11 int Ndophot; 12 int Nmag; 13 int Nsigma; 14 int Nimag; 15 int Nfew; 16 int Ngalaxy; 17 int Npsfqf; 18 int Nnan; 19 int Nbad; 20 int Npoor; 21 } MyBadCountType; 2 22 3 23 int LimitDensityCatalog_ByNmeasure (Catalog *subcatalog, Catalog *oldcatalog); … … 9 29 off_t NAVERAGE, NMEASURE, Naverage, Nmeasure, Nm; 10 30 float mag; 11 int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf, Nnan, Nbad, Npoor; 31 32 // int Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Nfew, Ngalaxy, Npsfqf, Nnan, Nbad, Npoor; 12 33 13 34 int Nsecfilt = GetPhotcodeNsecfilt (); … … 26 47 int NmMin = catalog[0].Nmeasure; 27 48 28 Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = Nnan = Nbad = Npoor = 0; 49 MyBadCountType badCount = {0,0,0, 0,0,0, 0,0,0, 0,0,0}; 50 MyBadCountType badTest1 = {0,0,0, 0,0,0, 0,0,0, 0,0,0}; 51 MyBadCountType badTest2 = {0,0,0, 0,0,0, 0,0,0, 0,0,0}; 52 53 int doTest1 = (TEST_IMAGE1 >= 0); 54 int doTest2 = (TEST_IMAGE2 >= 0); 55 56 FILE *ftest1 = (doTest1) ? fopen ("test1.meas.dat", "a") : NULL; 57 FILE *ftest2 = (doTest2) ? fopen ("test2.meas.dat", "a") : NULL; 58 59 // Ncode = Ntime = Ndophot = Nmag = Nsigma = Nimag = Nfew = Npsfqf = Ngalaxy = Nnan = Nbad = Npoor = 0; 29 60 30 61 // copy the following fields to the subcatalog: … … 57 88 58 89 offset = catalog[0].average[i].measureOffset + j; 90 91 if (doTest1) { 92 Measure *m = &catalog[0].measure[offset]; 93 if (m->imageID == TEST_IMAGE1) { 94 fprintf (ftest1, "%5d %5d %5d | %5d %12d %5.3f %5.3f %5.3f %5.3f %4.3f %4.3f 0x%08x\n", m->detID, m->objID, m->catID, m->photcode, m->t, m->M, m->Map, m->Mkron, m->dM, m->psfQF, m->psfQFperf, m->photFlags); 95 } 96 } 97 if (doTest2) { 98 Measure *m = &catalog[0].measure[offset]; 99 if (m->imageID == TEST_IMAGE2) { 100 fprintf (ftest2, "%5d %5d %5d | %5d %12d %5.3f %5.3f %5.3f %5.3f %4.3f %4.3f 0x%08x\n", m->detID, m->objID, m->catID, m->photcode, m->t, m->M, m->Map, m->Mkron, m->dM, m->psfQF, m->psfQFperf, m->photFlags); 101 } 102 } 59 103 60 104 /* select measurements by photcode */ … … 69 113 } 70 114 if (!found) { 71 Ncode ++;115 BAD_COUNT(Ncode); 72 116 continue; 73 117 } … … 75 119 /* select measurements by time */ 76 120 if (TimeSelect) { 77 if (catalog[0].measure[offset].t < TSTART) { Ntime ++; continue; }78 if (catalog[0].measure[offset].t > TSTOP) { Ntime ++; continue; }121 if (catalog[0].measure[offset].t < TSTART) { BAD_COUNT(Ntime); continue; } 122 if (catalog[0].measure[offset].t > TSTOP) { BAD_COUNT(Ntime); continue; } 79 123 } 80 124 81 125 /* select measurements by quality */ 82 if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { Ndophot ++; continue; }126 if (DophotSelect && ((catalog[0].measure[offset].photFlags >> 16) != DophotValue)) { BAD_COUNT(Ndophot); continue; } 83 127 84 128 float Maper = USE_APER_FOR_STARGAL ? catalog[0].measure[offset].Map : catalog[0].measure[offset].Mkron; 85 129 86 130 // skip garbage measurements 87 if (isnan(catalog[0].measure[offset].psfQF) || (catalog[0].measure[offset].psfQF < 0.95)) { Npsfqf ++; continue; }88 if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < 0.95)) { Npsfqf ++; continue; }89 if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; }90 if (isnan(Maper)) { Nnan ++; continue; }131 if (isnan(catalog[0].measure[offset].psfQF) || (catalog[0].measure[offset].psfQF < PSF_QF_MIN)) { BAD_COUNT(Npsfqf); continue; } 132 if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < PSF_QF_MIN)) { BAD_COUNT(Npsfqf); continue; } 133 if (isnan(catalog[0].measure[offset].M)) { BAD_COUNT(Nnan); continue; } 134 if (isnan(Maper)) { BAD_COUNT(Nnan); continue; } 91 135 92 136 // require 0x01 in photFlags (fitted with a PSF) -- add to the test data 93 if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { Nbad ++; continue; }137 if (REQUIRE_PSFFIT && (catalog[0].measure[offset].photFlags & 0x01) == 0) { BAD_COUNT(Nbad); continue; } 94 138 95 139 // very loose cut on PSF - APER mag (Map or Mkron) -- this lightly rejects galaxies & other oddities 96 140 float Mkp = catalog[0].measure[offset].M - Maper; 97 if (fabs(Mkp) > 1.0) { Nbad ++; continue; }141 if (fabs(Mkp) > 1.0) { BAD_COUNT(Nbad); continue; } 98 142 99 143 if (catalog[0].measure[offset].photFlags & code->photomBadMask) { 100 Nbad++;144 BAD_COUNT(Nbad); 101 145 continue; 102 146 } 103 if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { Npoor++; continue;}147 if (catalog[0].measure[offset].photFlags & code->photomPoorMask) { BAD_COUNT(Npoor); continue;} 104 148 105 149 // weak test for galaxies 106 if (Mkp > 0.5) {150 if (Mkp > STAR_MAX_PSF_KRON) { 107 151 nEXT ++; 108 152 } else { … … 112 156 /* select measurements by mag limit */ 113 157 mag = PhotCat (&catalog[0].measure[offset], MAG_CLASS_PSF); 114 if (mag > MAG_LIM) { Nmag ++; continue; } 158 if (mag > MAG_LIM) { BAD_COUNT(Nmag); continue; } 159 if (mag < MAG_MIN) { BAD_COUNT(Nmag); continue; } 160 // note that these two cuts are applied to all photcodes. these are also applied to 161 // the nominal apparent mags : if the expected sensitivity is very different between 162 // different filters, or if exposure times have a large range, these cuts may not be 163 // effective (or may exclude too much). 115 164 116 165 /* select measurements by measurement error */ 117 if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) { Nsigma ++; continue; }166 if ((SIGMA_LIM > 0) && (catalog[0].measure[offset].dM > SIGMA_LIM)) { BAD_COUNT(Nsigma); continue; } 118 167 119 168 /* select measurements by mag limit */ 120 169 if (ImagSelect) { 121 170 mag = PhotInst (&catalog[0].measure[offset], MAG_CLASS_PSF); 122 if (mag < ImagMin) { Nimag ++; continue; } 123 if (mag > ImagMax) { Nimag ++; continue; } 124 } 171 if (mag < ImagMin) { BAD_COUNT(Nimag); continue; } 172 if (mag > ImagMax) { BAD_COUNT(Nimag); continue; } 173 } 174 // note that instrumental mag cuts are reasonable for individual exposures using the same 175 // detector, but are probably not appropriate for stacks with a large range of the number 176 // of inputs. 125 177 126 178 // count this measurement as valid for this secfilt entry … … 147 199 if (nEXT >= nPSF) { 148 200 Nmeasure -= Nm; 149 Ngalaxy++;201 badCount.Ngalaxy++; 150 202 continue; 151 203 } … … 157 209 if (Nm <= STAR_TOOFEW) { /* enough measurements total? */ 158 210 Nmeasure -= Nm; 159 Nfew++;211 badCount.Nfew++; 160 212 continue; 161 213 } … … 167 219 if (!anySecfiltGood) { 168 220 Nmeasure -= Nm; 169 Nfew++;221 badCount.Nfew++; 170 222 continue; 171 223 } … … 204 256 subcatalog[0].Naverage, subcatalog[0].Nmeasure, catalog[0].Naverage, catalog[0].Nmeasure, catalog[0].filename, NmMin, NmMax); 205 257 fprintf (stderr, "rejections: %d stars have too few measures:\n %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n", 206 Nfew, Ncode, Ntime, Ndophot, Nmag, Nsigma, Nimag, Npsfqf, Nnan, Ngalaxy, Nbad, Npoor); 258 badCount.Nfew, badCount.Ncode, badCount.Ntime, badCount.Ndophot, badCount.Nmag, badCount.Nsigma, badCount.Nimag, badCount.Npsfqf, badCount.Nnan, badCount.Ngalaxy, badCount.Nbad, badCount.Npoor); 259 } 260 261 if (doTest1) { 262 fprintf (stderr, "TEST1 rejections: %d stars have too few measures: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n", 263 badTest1.Nfew, badTest1.Ncode, badTest1.Ntime, badTest1.Ndophot, badTest1.Nmag, badTest1.Nsigma, badTest1.Nimag, badTest1.Npsfqf, badTest1.Nnan, badTest1.Ngalaxy, badTest1.Nbad, badTest1.Npoor); 264 } 265 if (doTest2) { 266 fprintf (stderr, "TEST2 rejections: %d stars have too few measures: %d code, %d time, %d dophot, %d mag, %d sigma, %d imag, %d psfqf, %d Nnan, %d galaxies, %d bad, %d poor\n", 267 badTest2.Nfew, badTest2.Ncode, badTest2.Ntime, badTest2.Ndophot, badTest2.Nmag, badTest2.Nsigma, badTest2.Nimag, badTest2.Npsfqf, badTest2.Nnan, badTest2.Ngalaxy, badTest2.Nbad, badTest2.Npoor); 207 268 } 208 269 … … 212 273 } 213 274 214 free (Nvalid) 275 free (Nvalid); 276 277 if (ftest1) { fclose (ftest1); } 278 if (ftest2) { fclose (ftest2); } 215 279 216 280 return (TRUE); -
trunk/Ohana/src/relphot/src/extra.c
r41647 r42821 70 70 } 71 71 72 // for now (20140710) I need to identify gpc1 stacks explicitly. generalize in the future72 // for now (20140710) I need to identify gpc1 & gpc2 stacks explicitly. generalize in the future 73 73 int isGPC1stack (int photcode) { 74 74 75 if ((photcode == 11000) || (photcode == 14100)) return TRUE; // g-band 76 if ((photcode == 11100) || (photcode == 14200)) return TRUE; // r-band 77 if ((photcode == 11200) || (photcode == 14300)) return TRUE; // i-band 78 if ((photcode == 11300) || (photcode == 14400)) return TRUE; // z-band 79 if ((photcode == 11400) || (photcode == 14500)) return TRUE; // y-band 80 if ((photcode == 11500) || (photcode == 14600)) return TRUE; // w-band 75 // 11000 : GPC1.g.SkyChip 76 // 11001 : VARIOUS.g.SkyChip (output of xcamera stacks) 77 // 14100 : SIMTEST.g.SkyChip 78 // 31000 : GPC2.g.SkyChip 79 80 if (CALIBRATE_STACKS_LIKE_CHIPS) return FALSE; 81 82 if ((photcode == 11000) || (photcode == 11001) || (photcode == 14100) || (photcode == 31000)) return TRUE; // g-band 83 if ((photcode == 11100) || (photcode == 11101) || (photcode == 14200) || (photcode == 31100)) return TRUE; // r-band 84 if ((photcode == 11200) || (photcode == 11201) || (photcode == 14300) || (photcode == 31200)) return TRUE; // i-band 85 if ((photcode == 11300) || (photcode == 11301) || (photcode == 14400) || (photcode == 31300)) return TRUE; // z-band 86 if ((photcode == 11400) || (photcode == 11401) || (photcode == 14500) || (photcode == 31400)) return TRUE; // y-band 87 if ((photcode == 11500) || (photcode == 11501) || (photcode == 14600) || (photcode == 31500)) return TRUE; // w-band 81 88 82 89 return FALSE; … … 85 92 // for now (20140710) I need to identify gpc1 stacks explicitly. generalize in the future 86 93 int isGPC1warp (int photcode) { 94 95 if (CALIBRATE_WARPS_LIKE_CHIPS) return FALSE; 96 97 // 11000 : GPC1.g.SkyChip 98 // 14100 : SIMTEST.g.SkyChip 99 100 // 12000 : GPC1.g.ForcedWarp 101 // 15100 : SIMTEST.g.ForcedWarp 102 // 32000 : GPC2.g.ForcedWarp 87 103 88 104 // diff warps get stack-like photcodes (kind of lame) … … 97 113 } 98 114 99 if ((photcode == 12000) || (photcode == 15100) ) return TRUE; // g-band100 if ((photcode == 12100) || (photcode == 15200) ) return TRUE; // r-band101 if ((photcode == 12200) || (photcode == 15300) ) return TRUE; // i-band102 if ((photcode == 12300) || (photcode == 15400) ) return TRUE; // z-band103 if ((photcode == 12400) || (photcode == 15500) ) return TRUE; // y-band104 if ((photcode == 12500) || (photcode == 15600) ) return TRUE; // w-band115 if ((photcode == 12000) || (photcode == 15100) || (photcode == 32000)) return TRUE; // g-band 116 if ((photcode == 12100) || (photcode == 15200) || (photcode == 32100)) return TRUE; // r-band 117 if ((photcode == 12200) || (photcode == 15300) || (photcode == 32200)) return TRUE; // i-band 118 if ((photcode == 12300) || (photcode == 15400) || (photcode == 32300)) return TRUE; // z-band 119 if ((photcode == 12400) || (photcode == 15500) || (photcode == 32400)) return TRUE; // y-band 120 if ((photcode == 12500) || (photcode == 15600) || (photcode == 32500)) return TRUE; // w-band 105 121 106 122 return FALSE; -
trunk/Ohana/src/relphot/src/fit1d_irls.c
r41557 r42821 374 374 StatType stats; 375 375 liststats_setmode (&stats, "MEDIAN"); 376 liststats (dataset->alldata->yVector, NULL, NULL, Nvalues, &stats); 376 liststats (dataset->alldata->yVector, dataset->alldata->dyVector, NULL, Nvalues, &stats); 377 // liststats sorts yVector and dyVector together 377 378 378 379 double altSigma = (stats.Upper80 - stats.Lower20) / 1.6; // 20% to 80% encompasses 60% of the values, corresponds to the range (-0.85 sigma : +0.85 sigma) … … 380 381 // soften the individual errors with 10% of the scatter above 381 382 for (int j = 0; j < Nvalues; j++) { 382 double newSigma = hypot(dataset->alldata->dyVector[j], 0. 1*altSigma);383 double newSigma = hypot(dataset->alldata->dyVector[j], 0.5*altSigma); 383 384 dataset->alldata->dyVector[j] = newSigma; 384 385 } -
trunk/Ohana/src/relphot/src/initialize.c
r42134 r42821 50 50 fprintf (stderr, "DophotSelect: FALSE\n"); 51 51 } 52 fprintf (stderr, "PSF_QF limit: 0.85 (hardwired)\n");52 fprintf (stderr, "PSF_QF limit: %f\n", PSF_QF_MIN); 53 53 54 54 // fprintf (stderr, "Photom Bad Mask: 0x%08x, Photom Poor Mask: 0x%08x\n"); 55 55 56 fprintf (stderr, "MAG_ LIM: %f, SIGMA_LIM: %f\n", MAG_LIM, SIGMA_LIM);56 fprintf (stderr, "MAG_MIN: %f, MAG_LIM: %f, SIGMA_LIM: %f\n", MAG_MIN, MAG_LIM, SIGMA_LIM); 57 57 fprintf (stderr, "INST_MAG_MIN: %f, INST_MAG_MAX: %f\n", ImagMin, ImagMax); 58 58 59 fprintf (stderr, "STAR_MAX_PSF_KRON: %f\n", STAR_MAX_PSF_KRON); 59 60 fprintf (stderr, "STAR_TOOFEW: %d\n", STAR_TOOFEW); 60 61 -
trunk/Ohana/src/relphot/src/load_catalogs.c
r41647 r42821 151 151 // TimeSelect -time 152 152 // DophotSelect 153 // (note that psfQF is applied rigidly at 0.85, as is the galaxy test) 153 // PSF_QF_MIN 154 // STAR_MAX_PSF_KRON 155 // MAG_MIN 154 156 // MAG_LIM 155 157 // SIGMA_LIM … … 158 160 159 161 char *command = NULL; 160 strextend (&command, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s -region %f %f %f %f -D CAMERA %s -D MAG_LIM %f -D SIGMA_LIM %f", 161 PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname, UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA, MAG_LIM, SIGMA_LIM); 162 strextend (&command, "relphot_client %s -load %s -hostID %d -D CATDIR %s -hostdir %s", PhotcodeList, table->hosts[i].results, table->hosts[i].hostID, CATDIR, table->hosts[i].pathname); 163 strextend (&command, "-region %f %f %f %f -D CAMERA %s", UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, CAMERA); 164 strextend (&command, "-D MAG_MIN %f -D MAG_LIM %f -D SIGMA_LIM %f", MAG_MIN, MAG_LIM, SIGMA_LIM); 165 strextend (&command, "-D STAR_MAX_PSF_KRON %f -D PSF_QF_MIN %f", STAR_MAX_PSF_KRON, PSF_QF_MIN); 162 166 163 167 if (VERBOSE) { strextend (&command, "-v"); } -
trunk/Ohana/src/relphot/src/reload_catalogs.c
r42112 r42821 251 251 if (!(STAGES & STAGE_WARP)) { strextend (&command, "-skip-warp"); } 252 252 if (!(STAGES & STAGE_STACK)) { strextend (&command, "-skip-stack"); } 253 if (CALIBRATE_WARPS_LIKE_CHIPS) { strextend (&command, "-calibrate-warps-like-chips"); } 254 if (CALIBRATE_STACKS_LIKE_CHIPS) { strextend (&command, "-calibrate-stacks-like-chips"); } 253 255 254 256 // deprecate -
trunk/Ohana/src/relphot/src/relphot.c
r42483 r42821 33 33 34 34 switch (mode) { 35 case UPDATE_IMAGES: 35 case UPDATE_IMAGES: // -images 36 36 // calculate zero points for images (may group by exposure [mosaic], night [tgroups]; may measure flat-correction) 37 // IF CALLED WITH NLOOP == 0, DOES NOT LOAD bcatalog, just loads image table and generates ImageSubset.dat 37 // IF CALLED WITH NLOOP == 0 (and NOT -only-stacks-and-warps), this step DOES NOT LOAD bcatalog. Instead it just loads 38 // the image table and applies the Mcal values to the measurements. In parallel context, it generates ImageSubset.dat. 38 39 // If called with -update, calls reload_catalogs() just like apply_offsets, UNLESS -only-stacks-and-warps is selected 39 40 relphot_images (skylist);
Note:
See TracChangeset
for help on using the changeset viewer.
