IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41960


Ignore:
Timestamp:
Dec 10, 2021, 3:37:47 PM (5 years ago)
Author:
cclin33
Message:

fix average magnitude issue on different photcode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/relphot/src/setMrelCatalog.c

    r41672 r41960  
    179179    // these bits should not be set unless we use them in this pass
    180180    // (note that we can only un-set them in the final pass when we actually have measure, not just measureT
    181     if (measure) measure[k].dbFlags &= ~(ID_MEAS_PHOTOM_PSF | ID_MEAS_PHOTOM_APER | ID_MEAS_PHOTOM_KRON);
     181    // CCL updated 2021.12.09:  the following line will reset the dbFlags for measure so I comment it out.
     182    // if (measure) measure[k].dbFlags &= ~(ID_MEAS_PHOTOM_PSF | ID_MEAS_PHOTOM_APER | ID_MEAS_PHOTOM_KRON);
    182183
    183184    // skip measurements that do not have a valid photcode (raise exception?)
     
    322323        results->aperData[Nsec].errlist[Nap] = dMap;
    323324        results->aperData[Nsec].wgtlist[Nap] = modifiedWeight;
    324         results->aperData[Nsec].ranking[Nap] = measureRank[k];
     325        results->aperData[Nsec].ranking[Nap] = measureRank ? measureRank[k] : 0;
    325326        results->aperData[Nsec].measSeq[Nap] = k;
    326327        results->aperData[Nsec].msklist[Nap] = 0;
     
    383384  float psfQfPerfMax = 0.0;
    384385
    385   // now calculate the mean stats for the Nsec bands.
    386   for (Nsec = 0; Nsec < Nsecfilt; Nsec++) {
     386  // now calculate the mean stats for the selected Nsec bands.
     387  for (int Ns = 0; Ns < Nphotcodes; Ns++) {
     388    int thisCode = photcodes[Ns][0].code;
     389    int Nsec = GetPhotcodeNsec(thisCode);
    387390
    388391    // -preserve-ps1 means keep an existing average PS1 value
     
    477480      secfilt[Nsec].dMkronChp = kronstats->error;
    478481      secfilt[Nsec].sMkronChp = kronstats->sigma;
    479       secfilt[Nsec].NusedKron = NrankingKRON;
     482      // actually used is Nmeas, NrankingKRON is including masked data
     483      secfilt[Nsec].NusedKron = kronstats->Nmeas;
    480484    }
    481485
     
    521525        secfilt[Nsec].dMapChp = apstats->error;
    522526        secfilt[Nsec].sMapChp = apstats->sigma;
    523         secfilt[Nsec].NusedAp = NrankingAPER;
     527        // actually used is Nmeas, NrankingAPER is including masked data
     528        secfilt[Nsec].NusedAp = apstats->Nmeas;
    524529      }
    525530      int minRankAper = (NrankingAPER > 0) ? results->aperData[Nsec].ranking[0] : 10;
Note: See TracChangeset for help on using the changeset viewer.