IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40289


Ignore:
Timestamp:
Dec 13, 2017, 8:47:44 AM (9 years ago)
Author:
eugene
Message:

separately track kron and psf mags for Mcal to avoid NaN problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c

    r40263 r40289  
    643643    int minUbercalDist = 1000;
    644644   
    645     off_t Nref = 0;  // total number of reference stars on the image
    646     int Nbright = 0; // number of stars to measure the bright-end scatter
     645    off_t Nref = 0;    // number of stars used to measure McalPSF
     646    int   Nkron = 0;   // number of stars to measure McalAPER
     647    int   Nbright = 0; // number of stars to measure the bright-end scatter
    647648
    648649    if (N_onImage[i] == 0) {
     
    682683          continue;
    683684      }
    684       float MrelKron  = getMrel  (catalog, m, c, MAG_CLASS_KRON, MAG_SRC_CHP);
    685685     
    686686      // image.Mcal is not supposed to include the flat-field correction, so we need to
     
    697697        continue;
    698698      }
    699       float MsysKron = PhotSysTiny (&catalog[c].measureT[m], &catalog[c].averageT[n], &catalog[c].secfilt[n*Nsecfilt], MAG_CLASS_KRON);
    700699
    701700      PhotCode *code = GetPhotcodebyCode (catalog[c].measureT[m].photcode);
     
    715714      }
    716715
    717       kronStars->flxlist[Nref] = MsysKron - MrelKron - Mmos - Mgrid + Mflat;
    718       kronStars->errlist[Nref] = MAX (catalog[c].measureT[m].dM, MIN_ERROR);
    719       kronStars->wgtlist[Nref] = 1;
    720       kronStars->msklist[Nref] = 0;
     716      float MrelKron = getMrel  (catalog, m, c, MAG_CLASS_KRON, MAG_SRC_CHP);
     717      float MsysKron = PhotSysTiny (&catalog[c].measureT[m], &catalog[c].averageT[n], &catalog[c].secfilt[n*Nsecfilt], MAG_CLASS_KRON);
     718
     719      if (isfinite(MrelKron) && isfinite(MsysKron)) {
     720        kronStars->flxlist[Nkron] = MsysKron - MrelKron - Mmos - Mgrid + Mflat;
     721        kronStars->errlist[Nkron] = MAX (catalog[c].measureT[m].dM, MIN_ERROR);
     722        kronStars->wgtlist[Nkron] = 1;
     723        kronStars->msklist[Nkron] = 0;
     724        Nkron ++;
     725      }
    721726
    722727      if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) {
     
    763768    // no additional weight modification (we treat all stars on an image equally -- note an image is either ubercal-tied or not)
    764769# if (BASIC_STATS)
    765     liststats (kronStars->flxlist, kronStars->errlist, NULL, Nref, &stats);
     770    liststats (kronStars->flxlist, kronStars->errlist, NULL, Nkron, &stats);
    766771# else
    767772    liststats_irls (kronStars, Nref, &stats);
Note: See TracChangeset for help on using the changeset viewer.