- Timestamp:
- May 21, 2021, 4:49:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
