- Timestamp:
- May 31, 2021, 11:45:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/setMrelCatalog.c
r41624 r41625 225 225 } 226 226 227 /* some things to note here: 228 229 Mcal, Mmos, Mgrid are only relevant (non-zero) during the relphot_images and 230 relphot_parallel_images analysis steps. For the final output steps (setMrelFinal), 231 these are turned off 232 233 During the image analysis, Mflat is the prior stored value while Mgrid is the new 234 measurement. In the final output step, Mgrid is transferred to Mflat and zero 235 236 On the final calculation of Mrel, the value of Mgrid has been applied to Mflat, but 237 it has not been removed from the GridOps.c structures. In order to avoid 238 double-counting, we need to skip Mgrid on the final calculation. 239 */ 240 227 241 // ** Choose the calibration (depends on the mode : do I have an image reference or not?) 228 242 float Mcal = 0.0, Mmos = 0.0, Mgrid = 0.0, Mflat = 0.0, Mgrp = 0.0; … … 235 249 Mcal = measureT[k].McalPSF; // check that this is zero for loaded REF value 236 250 } else { 237 // getMcal returns image[].Mcal ; note the flat-field correction is stored in measure.Mflat251 // getMcal returns image[].Mcal 238 252 Mcal = getMcal (meas, cat, MAG_CLASS_PSF); 239 253 if (isnan(Mcal)) SKIP_THIS_MEAS(Ncal); 240 Mmos = getMmos (meas, cat); 241 if (isnan(Mmos)) SKIP_THIS_MEAS(Nmos); 242 Mgrp = getMgrp (meas, cat, measureT[k].airmass, &dMgrp); 243 if (isnan(Mgrp)) SKIP_THIS_MEAS(Ngrp); 244 Mgrid = isSetMrelFinal ? 0.0 : getMgridTiny (&measureT[k]); 245 if (isnan(Mgrid)) SKIP_THIS_MEAS(Ngrid); 254 255 // the flat-field correction is stored in measure.Mflat 246 256 Mflat = isnan (measureT[k].Mflat) ? 0.0 : measureT[k].Mflat; 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. 257 258 // see note above re: final output vs image analysis 259 if (!isSetMrelFinal) { 260 Mmos = getMmos (meas, cat); 261 if (isnan(Mmos)) SKIP_THIS_MEAS(Nmos); 262 Mgrp = getMgrp (meas, cat, measureT[k].airmass, &dMgrp); 263 if (isnan(Mgrp)) SKIP_THIS_MEAS(Ngrp); 264 Mgrid = getMgridTiny (&measureT[k]); 265 if (isnan(Mgrid)) SKIP_THIS_MEAS(Ngrid); 266 } 267 } 251 268 252 269 int myUbercalDist = getUbercalDist(meas, cat); … … 367 384 } 368 385 386 // if -preserve-ps1 is set and this object has PS1 data, skip the rest of the steps: 387 // NOTE: This test only applies if this bit was set by an earlier analysis 369 388 if (PRESERVE_PS1 && (secfilt[Nsec].flags & ID_SECF_HAS_PS1)) continue; 370 // if -preserve-ps1 is set and this object has PS1 data, skip the rest of the steps:371 389 372 390 // XXX hardwired grizy = (01234) JHK = (567) w = (8) … … 419 437 int NrankingPSF = useOLS ? magStatsByRanking (&results->psfData[Nsec], psfstats) : magStatsByRankingIRLS (&results->psfData[Nsec], psfstats); 420 438 if (NrankingPSF < Nminmeas) { 421 secfilt[Nsec].flags |= ID_ OBJ_FEW;439 secfilt[Nsec].flags |= ID_SECF_STAR_FEW; 422 440 } else { 423 441 secfilt[Nsec].MpsfChp = psfstats->mean; 424 442 secfilt[Nsec].dMpsfChp = psfstats->error; 425 443 secfilt[Nsec].Mchisq = (psfstats->Nmeas > 1) ? psfstats->chisq : NAN; 444 secfilt[Nsec].flags &= ~ID_SECF_STAR_FEW; 426 445 } 427 446 … … 629 648 haveStackObject = TRUE; 630 649 631 // if (measure[k].dbFlags & MEAS_BAD) SKIP_THIS_MEAS_STACK(Nbad);632 633 650 int isPrimary = FALSE; 634 651
Note:
See TracChangeset
for help on using the changeset viewer.
