Changeset 41608
- Timestamp:
- May 22, 2021, 1:44:24 PM (5 years ago)
- Location:
- branches/eam_branches/relphot.20210521/src
- Files:
-
- 7 edited
-
GridOps.c (modified) (3 diffs)
-
ImageOps.c (modified) (4 diffs)
-
MagResidSave.c (modified) (2 diffs)
-
MosaicOps.c (modified) (3 diffs)
-
TGroupOps.c (modified) (5 diffs)
-
setMrelCatalog.c (modified) (1 diff)
-
setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/GridOps.c
r41607 r41608 188 188 if (isnan(Mmos)) continue; 189 189 190 float Mflat = getMflat (nm, nc, catalog); 191 if (isnan(Mflat)) continue; 192 190 193 // Mrel* is the average magnitude for this star. For PS1 stacks, we have too much 191 194 // PSF variability. We need to calibrate the PSF magnitudes separately from the … … 200 203 if (isnan(MsysPSF)) continue; 201 204 202 // what about Mflat? 203 float Moff = Mcal + Mgrp + Mmos; 205 float Moff = Mcal + Mgrp + Mmos + Mflat; 204 206 205 207 // Msys = Mrel + Moff + Mgrid … … 307 309 for (off_t j = 0; j < catalog->Nmeasure; j++) { 308 310 float Mgrid = getMgrid (&catalog->measure[j]); 309 catalog->measure[j].Mflat -= Mgrid;310 } 311 } 312 311 catalog->measure[j].Mflat += Mgrid; 312 } 313 } 314 -
branches/eam_branches/relphot.20210521/src/ImageOps.c
r41606 r41608 636 636 // apply that offset as well here for this image (in other words, each detection is 637 637 // being compared to the model, excluding the zero point, Mcal. The model includes 638 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal - Mflat) 638 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal + Mflat) 639 // this was inconsistent w.r.t. PhotRel pre-r41606 639 640 640 641 float Mflat = getMflat (m, c, catalog); … … 647 648 } 648 649 649 float Moff = Mmos + Mgrp + Mgrid -Mflat;650 float Moff = Mmos + Mgrp + Mgrid + Mflat; 650 651 651 652 PhotCode *code = GetPhotcodebyCode (catalog[c].measureT[m].photcode); … … 830 831 // apply that offset as well here for this image (in other words, each detection is 831 832 // being compared to the model, excluding the zero point, Mcal. The model includes 832 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal -Mflat)833 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal + Mflat) 833 834 834 835 float Mflat = getMflat (m, c, catalog); … … 842 843 } 843 844 844 float Moff = Mmos + Mgrp + Mgrid -Mflat;845 float Moff = Mmos + Mgrp + Mgrid + Mflat; 845 846 846 847 psfStars.alldata-> yVector[Nref] = MsysPSF - MrelPSF - Moff; -
branches/eam_branches/relphot.20210521/src/MagResidSave.c
r41606 r41608 233 233 // apply that offset as well here for this image (in other words, each detection is 234 234 // being compared to the model, excluding the zero point, Mcal. The model includes 235 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal -Mflat)235 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal + Mflat) 236 236 237 237 float Mflat = getMflat (m, c, catalog); … … 248 248 if (isnan(MsysPSF)) continue; 249 249 250 float Moff = Mcal + Mmos + Mgrp + Mgrid -Mflat;250 float Moff = Mcal + Mmos + Mgrp + Mgrid + Mflat; 251 251 252 252 // Mrel is the true average apparent magnitude of this star -
branches/eam_branches/relphot.20210521/src/MosaicOps.c
r41606 r41608 1069 1069 // apply that offset as well here for this image (in other words, each detection is 1070 1070 // being compared to the model, excluding the zero point, Mcal. The model includes 1071 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal - Mflat) 1071 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal + Mflat). 1072 // this was inconsistent pre r41606 1072 1073 1073 1074 float Mflat = getMflat (m, c, catalog); … … 1094 1095 assert (Nbright >= 0); 1095 1096 1096 float Moff = Mcal + Mgrp + Mgrid -Mflat;1097 float Moff = Mcal + Mgrp + Mgrid + Mflat; 1097 1098 1098 1099 psfStars->alldata-> yVector[N] = MsysPSF - MrelPSF - Moff; … … 1205 1206 float MsysPSF = PhotSysTiny (&catalog[c].measureT[m], &catalog[c].averageT[n], &catalog[c].secfilt[n*Nsecfilt], MAG_CLASS_PSF); 1206 1207 1207 float delta = MsysPSF - MrelPSF - Mcal - Mgrid +Mflat;1208 float delta = MsysPSF - MrelPSF - Mcal - Mgrid - Mflat; 1208 1209 1209 1210 int isBad = (catalog[c].measureT[m].dbFlags & MEAS_BAD); -
branches/eam_branches/relphot.20210521/src/TGroupOps.c
r41606 r41608 874 874 // apply that offset as well here for this image (in other words, each detection is 875 875 // being compared to the model, excluding the zero point, Mcal. The model includes 876 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal - Mflat) 876 // the flat-correction. NOTE the sign of Mflat (Image.Mcal = Measure.Mcal + Mflat) 877 // this was inconsistent with PhotRel pre-r41606 877 878 878 879 float Mflat = getMflat (m, c, catalog); … … 899 900 assert (Nbright >= 0); 900 901 901 float Moff = Mcal + Mmos + Mgrid -Mflat;902 float Moff = Mcal + Mmos + Mgrid + Mflat; 902 903 903 904 psfStars->alldata-> yVector[N] = MsysPSF - MrelPSF - Moff; … … 1022 1023 1023 1024 // for historical reasons, Mflat is defined with the wrong sign 1024 float delta = MsysPSF - MrelPSF - Mcal - Mmos - Mgrid +Mflat - myTGroup->McalPSF;1025 float delta = MsysPSF - MrelPSF - Mcal - Mmos - Mgrid - Mflat - myTGroup->McalPSF; 1025 1026 1026 1027 int isBad = (catalog[c].measureT[m].dbFlags & MEAS_BAD); … … 1503 1504 float MrelPSF = getMrel (catalog, m, c, MAG_CLASS_PSF, MAG_SRC_CHP); // average magnitude 1504 1505 // float Mgrid = getMgridTiny (&catalog[c].measureT[m]); // camera offset (deprecated?) 1505 //float Mflat = getMflat (m, c, catalog); // flat-field correction1506 float Mflat = getMflat (m, c, catalog); // flat-field correction 1506 1507 1507 1508 off_t n = catalog[c].measureT[m].averef; … … 1511 1512 1512 1513 // for historical reasons, Mflat is defined with the wrong sign 1513 float delta = MsysPSF - MrelPSF - Mcal - Mmos - Mgrp ;1514 float delta = MsysPSF - MrelPSF - Mcal - Mmos - Mgrp - Mflat; 1514 1515 1515 1516 fprintf (fout, "%f %f : %f %f : %f %f %f : %f %f\n", catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysPSF, MrelPSF, Mcal, Mmos, Mgrp, catalog[c].measureT[m].airmass, delta); -
branches/eam_branches/relphot.20210521/src/setMrelCatalog.c
r41607 r41608 271 271 float dMap = NAN; 272 272 273 // XXX I am not convinced the sign on Mflat here is correct274 float Moff = Mcal + Mmos + Mgrp + Mgrid -Mflat;273 // This definition is consistent with PhotRel: Mrel = Msys - Mcal - Mflat 274 float Moff = Mcal + Mmos + Mgrp + Mgrid + Mflat; 275 275 276 276 if (isSetMrelFinal) { -
branches/eam_branches/relphot.20210521/src/setMrelFinal.c
r41607 r41608 103 103 ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure); 104 104 setMeasureRank (catalog); 105 setMrelOutput (catalog, 1); // sets the values secfilt.MpsfChp = <measure.M + measure.Mflat - image.Mcal>105 setMrelOutput (catalog, 1); // sets the values secfilt.MpsfChp = <measure.M - image.Mcal - measure.Mflat> 106 106 setMcalOutput (catalog, 1); // sets measure.Mcal = image.Mcal 107 107
Note:
See TracChangeset
for help on using the changeset viewer.
