Changeset 42696
- Timestamp:
- Jun 24, 2024, 9:08:34 AM (2 years ago)
- Location:
- branches/eam_branches/ipp-20230313/Ohana/src/relphot
- Files:
-
- 9 edited
-
include/relphot.h (modified) (2 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/StarOps.c (modified) (14 diffs)
-
src/args.c (modified) (2 diffs)
-
src/bcatalog.c (modified) (4 diffs)
-
src/extra.c (modified) (3 diffs)
-
src/initialize.c (modified) (1 diff)
-
src/load_catalogs.c (modified) (2 diffs)
-
src/relphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/Ohana/src/relphot/include/relphot.h
r42389 r42696 414 414 int IS_DIFF_DB; 415 415 416 double MAG_MIN; 416 417 double MAG_LIM; 417 418 double SIGMA_LIM; 419 420 double STAR_MAX_PSF_KRON; 421 double PSF_QF_MIN; 422 418 423 double IMAGE_SCATTER; 419 424 double IMAGE_OFFSET; … … 468 473 int RESET_FLATCORR; 469 474 int REPAIR_WARPS; 475 int USE_REF_EQUIV; 470 476 int PRESERVE_PS1; 471 477 int REQUIRE_PSFFIT; -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/ConfigInit.c
r41647 r42696 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); -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/StarOps.c
r41647 r42696 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; -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/args.c
r42389 r42696 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"))) { … … 836 841 } 837 842 843 USE_REF_EQUIV = FALSE; 844 if ((N = get_argument (argc, argv, "-use-ref-equiv"))) { 845 remove_argument (N, &argc, argv); 846 USE_REF_EQUIV = TRUE; 847 } 838 848 PRESERVE_PS1 = FALSE; 839 849 if ((N = get_argument (argc, argv, "-preserve-ps1"))) { -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/bcatalog.c
r42389 r42696 85 85 86 86 // 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; }87 if (isnan(catalog[0].measure[offset].psfQF) || (catalog[0].measure[offset].psfQF < PSF_QF_MIN)) { Npsfqf ++; continue; } 88 if (isnan(catalog[0].measure[offset].psfQFperf) || (catalog[0].measure[offset].psfQFperf < PSF_QF_MIN)) { Npsfqf ++; continue; } 89 89 if (isnan(catalog[0].measure[offset].M)) { Nnan ++; continue; } 90 90 if (isnan(Maper)) { Nnan ++; continue; } … … 104 104 105 105 // weak test for galaxies 106 if (Mkp > 0.5) {106 if (Mkp > STAR_MAX_PSF_KRON) { 107 107 nEXT ++; 108 108 } else { … … 113 113 mag = PhotCat (&catalog[0].measure[offset], MAG_CLASS_PSF); 114 114 if (mag > MAG_LIM) { Nmag ++; continue; } 115 if (mag < MAG_MIN) { Nmag ++; continue; } 116 // note that these two cuts are applied to all photcodes. these are also applied to 117 // the nominal apparent mags : if the expected sensitivity is very different between 118 // different filters, or if exposure times have a large range, these cuts may not be 119 // effective (or may exclude too much). 115 120 116 121 /* select measurements by measurement error */ … … 123 128 if (mag > ImagMax) { Nimag ++; continue; } 124 129 } 130 // note that instrumental mag cuts are reasonable for individual exposures using the same 131 // detector, but are probably not appropriate for stacks with a large range of the number 132 // of inputs. 125 133 126 134 // count this measurement as valid for this secfilt entry -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/extra.c
r41647 r42696 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 ((photcode == 11000) || (photcode == 11001) || (photcode == 14100) || (photcode == 31000)) return TRUE; // g-band 81 if ((photcode == 11100) || (photcode == 11101) || (photcode == 14200) || (photcode == 31100)) return TRUE; // r-band 82 if ((photcode == 11200) || (photcode == 11201) || (photcode == 14300) || (photcode == 31200)) return TRUE; // i-band 83 if ((photcode == 11300) || (photcode == 11301) || (photcode == 14400) || (photcode == 31300)) return TRUE; // z-band 84 if ((photcode == 11400) || (photcode == 11401) || (photcode == 14500) || (photcode == 31400)) return TRUE; // y-band 85 if ((photcode == 11500) || (photcode == 11501) || (photcode == 14600) || (photcode == 31500)) return TRUE; // w-band 81 86 82 87 return FALSE; … … 85 90 // for now (20140710) I need to identify gpc1 stacks explicitly. generalize in the future 86 91 int isGPC1warp (int photcode) { 92 93 // 11000 : GPC1.g.SkyChip 94 // 14100 : SIMTEST.g.SkyChip 95 96 // 12000 : GPC1.g.ForcedWarp 97 // 15100 : SIMTEST.g.ForcedWarp 98 // 32000 : GPC2.g.ForcedWarp 87 99 88 100 // diff warps get stack-like photcodes (kind of lame) … … 97 109 } 98 110 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-band111 if ((photcode == 12000) || (photcode == 15100) || (photcode == 32000)) return TRUE; // g-band 112 if ((photcode == 12100) || (photcode == 15200) || (photcode == 32100)) return TRUE; // r-band 113 if ((photcode == 12200) || (photcode == 15300) || (photcode == 32200)) return TRUE; // i-band 114 if ((photcode == 12300) || (photcode == 15400) || (photcode == 32300)) return TRUE; // z-band 115 if ((photcode == 12400) || (photcode == 15500) || (photcode == 32400)) return TRUE; // y-band 116 if ((photcode == 12500) || (photcode == 15600) || (photcode == 32500)) return TRUE; // w-band 105 117 106 118 return FALSE; -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/initialize.c
r42134 r42696 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 -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/load_catalogs.c
r41647 r42696 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"); } -
branches/eam_branches/ipp-20230313/Ohana/src/relphot/src/relphot.c
r42520 r42696 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.
