Changeset 41607
- Timestamp:
- May 21, 2021, 4:49:23 PM (5 years ago)
- Location:
- branches/eam_branches/relphot.20210521
- Files:
-
- 7 edited
-
include/relphot.h (modified) (2 diffs)
-
src/GridOps.c (modified) (1 diff)
-
src/StarOps.c (modified) (1 diff)
-
src/reload_catalogs.c (modified) (1 diff)
-
src/relphot_images.c (modified) (2 diffs)
-
src/setMrelCatalog.c (modified) (5 diffs)
-
src/setMrelFinal.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/include/relphot.h
r41606 r41607 500 500 RelphotStages STAGES; 501 501 502 # ifdef GRID_V1503 int setGridMeasure (off_t meas, int cat, double X, double Y);504 # endif505 506 # ifdef GRID_V2507 int setGridMeasure (off_t meas, int cat, double X, double Y, int ccdnum);508 # endif509 510 502 /*** relphot prototypes ***/ 511 503 void ConfigInit PROTO((int *argc, char **argv)); … … 568 560 void global_stats PROTO((Catalog *catalog, int Ncatalog, int nloop)); 569 561 void initGrid PROTO(()); 562 void setMflatFromGrid PROTO((Catalog *catalog)); 570 563 void initGridBins PROTO(()); 571 564 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int doImageList)); -
branches/eam_branches/relphot.20210521/src/GridOps.c
r41603 r41607 301 301 return Mgrid; 302 302 } 303 304 // for historical reasons, Mflat and Mgrid have opposite signs 305 void setMflatFromGrid (Catalog *catalog) { 306 if (!GRID_ZEROPT) return; 307 for (off_t j = 0; j < catalog->Nmeasure; j++) { 308 float Mgrid = getMgrid (&catalog->measure[j]); 309 catalog->measure[j].Mflat -= Mgrid; 310 } 311 } 312 -
branches/eam_branches/relphot.20210521/src/StarOps.c
r41606 r41607 291 291 292 292 // setMrel and setMrelOutput are extremely similar, but have slightly different implications: 293 // * setMrel uses the internal Tiny structures only 294 // * setMrelOutput skips stars for which there are too few good measurements 295 // * setMrelOutput is meant to be called repeatedly, relaxing the criteria for 'good' on each pass 293 // * setMrel only uses the internal Tiny structures 294 // * setMrel skips stars for which there are too few good measurements (setMrelOutput assigns an average mag with only 1) 295 // * setMrelOutput sets psfQF, psfQFperf, extNsigma, rank info, etc 296 // * setMrelOutput sets average Map 296 297 // * setMrelOutput updates 2MASS average flags 297 298 // * setMrelOutput updates average EXT flags (PS1 and 2MASS) 299 // * setMrelOutput sets average stack & warp photometry (if requested) 298 300 299 301 int setMrel (Catalog *catalog, int Ncatalog) { -
branches/eam_branches/relphot.20210521/src/reload_catalogs.c
r41606 r41607 100 100 101 101 initMrel (&catalog, 1); 102 103 setMflatFromGrid (&catalog); // Mgrid is used to set Mflat; Mgrid is the ignored in setMrelFinal/setMrelCatalog.c 102 104 setMrelFinal (&catalog, FALSE); 103 105 TIMESTAMP(time5); -
branches/eam_branches/relphot.20210521/src/relphot_images.c
r41606 r41607 89 89 SetZptIteration (i); 90 90 91 setMrel (catalog, Ncatalog); // threaded 91 setMrel (catalog, Ncatalog); // threaded (calls setMrel_catalog_alt in setMrelCatalog.c) 92 92 93 93 setMcal (catalog); … … 160 160 clients */ 161 161 if (!CALIBRATE_STACKS_AND_WARPS) { 162 reload_catalogs (skylist, 0, NULL); 162 reload_catalogs (skylist, 0, NULL); // calls setMrelFinal which setMrelOutput which calls setMrel_catalog_alt 163 163 MARKTIME("-- updated all catalogs: %f sec\n", dtime); 164 164 } -
branches/eam_branches/relphot.20210521/src/setMrelCatalog.c
r41606 r41607 233 233 // data for which the associated image has not been loaded (probably because of 234 234 // overlaps). Msys + measure.Mcal is our best guess of the true magnitude 235 Mmos = Mgrid = 0;236 235 Mcal = measureT[k].McalPSF; // check that this is zero for loaded REF value 237 236 } else { … … 243 242 Mgrp = getMgrp (meas, cat, measureT[k].airmass, &dMgrp); 244 243 if (isnan(Mgrp)) SKIP_THIS_MEAS(Ngrp); 245 Mgrid = getMgridTiny (&measureT[k]);244 Mgrid = isSetMrelFinal ? 0.0 : getMgridTiny (&measureT[k]); 246 245 if (isnan(Mgrid)) SKIP_THIS_MEAS(Ngrid); 247 246 Mflat = isnan (measureT[k].Mflat) ? 0.0 : measureT[k].Mflat; 248 247 } 248 // on the final calculation of Mrel the value of Mgrid has been applied to Mflat, but 249 // it has not been removed from the GridOps.c structures. In order to avoid double-counting, 250 // we need to skip Mgrid on the final calculation. 249 251 250 252 int myUbercalDist = getUbercalDist(meas, cat); … … 562 564 SecFilt *secfilt = &catalog[0].secfilt[ave*Nsecfilt]; 563 565 564 float McalPSF = 0, McalAPER = 0 , Mmos = 0, Mgrid = 0;566 float McalPSF = 0, McalAPER = 0; 565 567 566 568 // set the primary projection cell and skycell for this coordinate … … 726 728 McalPSF = measure[meas].McalPSF; // check that this is zero for loaded REF value 727 729 McalAPER = McalPSF; // check that this is zero for loaded REF value 728 Mmos = 0.0;729 Mgrid = 0.0;730 730 } else { 731 731 McalPSF = getMcal (measSeq, cat, MAG_CLASS_PSF); 732 732 McalAPER = USE_MCAL_PSF_FOR_STACK_APER ? getMcal (measSeq, cat, MAG_CLASS_PSF) : getMcal (measSeq, cat, MAG_CLASS_KRON); 733 Mmos = getMmos (measSeq, cat);734 Mgrid = getMgrid (&measure[meas]);735 // XXX can Mmos and Mgrid exist for stacks?736 733 } 737 734 … … 769 766 // get the zero point for the selected image 770 767 // Use a different zero point for the PSF-like and APERTURE-like magnitudes 771 float zpPSF = PhotZeroPoint (&measure[meas], &average[0], &secfilt[0]) - (McalPSF + Mmos + Mgrid);772 float zpAPER = PhotZeroPoint (&measure[meas], &average[0], &secfilt[0]) - (McalAPER + Mmos + Mgrid);768 float zpPSF = PhotZeroPoint (&measure[meas], &average[0], &secfilt[0]) - McalPSF; 769 float zpAPER = PhotZeroPoint (&measure[meas], &average[0], &secfilt[0]) - McalAPER; 773 770 774 771 // zpFactor to go from instrumental flux to Janskies -
branches/eam_branches/relphot.20210521/src/setMrelFinal.c
r41606 r41607 101 101 } 102 102 103 // XXX make this optional? (do not clean for -averages?)104 // XXX : for the moment, disable clean_measures105 if (!simpleAverage && FALSE) clean_measures (catalog, 1, TRUE); /* mark outliers ID_MEAS_POOR_PHOTOM */106 107 103 ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure); 108 104 setMeasureRank (catalog); … … 271 267 } 272 268 269 // XXX review this, especially the good/bad images 270 // by this point, we have propagated the mosaic and tgroup flags to each image 273 271 void setMeasureRank (Catalog *catalog) { 274 272
Note:
See TracChangeset
for help on using the changeset viewer.
