IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 31, 2021, 11:45:18 AM (5 years ago)
Author:
eugene
Message:

major revision of the flagging and resets. cleanup of old cruft and deprecated flag values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/src/setMrelCatalog.c

    r41624 r41625  
    225225    }
    226226
     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
    227241    // ** Choose the calibration (depends on the mode : do I have an image reference or not?)
    228242    float Mcal = 0.0, Mmos = 0.0, Mgrid = 0.0, Mflat = 0.0, Mgrp = 0.0;
     
    235249      Mcal = measureT[k].McalPSF; // check that this is zero for loaded REF value
    236250    } else {
    237       // getMcal returns image[].Mcal; note the flat-field correction is stored in measure.Mflat
     251      // getMcal returns image[].Mcal
    238252      Mcal  = getMcal (meas, cat, MAG_CLASS_PSF);
    239253      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
    246256      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    }
    251268
    252269    int myUbercalDist = getUbercalDist(meas, cat);
     
    367384    }
    368385
     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
    369388    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:
    371389
    372390    // XXX hardwired grizy = (01234) JHK = (567) w = (8)
     
    419437    int NrankingPSF = useOLS ? magStatsByRanking (&results->psfData[Nsec], psfstats) : magStatsByRankingIRLS (&results->psfData[Nsec], psfstats);
    420438    if (NrankingPSF < Nminmeas) {
    421       secfilt[Nsec].flags |= ID_OBJ_FEW;
     439      secfilt[Nsec].flags |= ID_SECF_STAR_FEW;
    422440    } else {
    423441      secfilt[Nsec].MpsfChp  = psfstats->mean;
    424442      secfilt[Nsec].dMpsfChp = psfstats->error;
    425443      secfilt[Nsec].Mchisq   = (psfstats->Nmeas > 1) ? psfstats->chisq : NAN;
     444      secfilt[Nsec].flags &= ~ID_SECF_STAR_FEW;
    426445    }
    427446
     
    629648      haveStackObject = TRUE;
    630649
    631       // if (measure[k].dbFlags & MEAS_BAD) SKIP_THIS_MEAS_STACK(Nbad);
    632 
    633650      int isPrimary = FALSE;
    634651     
Note: See TracChangeset for help on using the changeset viewer.