IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 15, 2017, 8:48:53 PM (9 years ago)
Author:
mhuber
Message:

adding extra cuts applied in ppMops to only WSdiff (flags2, diff params), some may be applicable to WW later (dev)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppTranslate/src/ppMopsRead.c

    r38729 r40038  
    229229    psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE");
    230230    psVector *flagsV = psMetadataLookupVector(NULL, table, "FLAGS");
     231    psVector *flags2V = psMetadataLookupVector(NULL, table, "FLAGS2");
    231232    psVector *xExtErrV = NULL;
    232233    psVector *yExtErrV = NULL;
     
    240241    }
    241242
     243    //MEH -- diff params, may need skyChipPsfVersion
     244    psVector *npos = psMetadataLookupVector(NULL, table, "DIFF_NPOS");
     245    psVector *fpos = psMetadataLookupVector(NULL, table, "DIFF_FRATIO");
     246    psVector *rbad = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_BAD");
     247    psVector *rmask = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_MASK");
     248    psVector *rall = psMetadataLookupVector(NULL, table, "DIFF_NRATIO_ALL");
     249
    242250    double plateScale = 0.0;        // Plate scale
    243251    long numGood = 0;               // Number of good rows
     
    250258        continue;
    251259      }
     260
     261      //MEH -- section off flags2 and diffstats cuts to just be for WSdiffs --
     262      // -- need to test similarity/differences for WW/WS -- have separate block for WW
     263      // -- may need to move block
     264      if (!strcasecmp(args->difftype, "WS")) {
     265        psU64 flags2 = flags2V->data.U64[row]; // table reads in as U64
     266        if (flags2 & SOURCE_MASK2) {
     267          psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of flags2: %lud", row, i, flags2);
     268          det->mask->data.U8[row] = 0xFF;
     269          continue;
     270        }
     271
     272        // add diff params to discard -- needs to be in config.. -- WSdiff only?
     273        // -- needs to be finite to test but unclear if should reject (probably)
     274        // -- using Napoli 2013 to start with
     275        // DIFF_NPOS>3
     276        // DIFF_FRATIO>0.6
     277        // DIFF_NRATIO_BAD>0.4
     278        // DIFF_NRATIO_MASK>0.4
     279        // DIFF_NRATIO_ALL>0.3
     280        // -- unclear about npos still --
     281        //if (npos->data.F32[row]<=3 ||
     282        if (!isfinite(fpos->data.F32[row]) || !isfinite(rbad->data.F32[row]) || !isfinite(rmask->data.F32[row]) || !isfinite(rall->data.F32[row])) {
     283           psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of NAN diff params: 3, 0.6, 0.4, 0.4, 0.3: %ld %g %f %f %f ", row, i, npos->data.F32[row],fpos->data.F32[row],rbad->data.F32[row],rmask->data.F32[row],rall->data.F32[row]);
     284          det->mask->data.U8[row] = 0xFF;
     285          continue;
     286        }
     287        if (fpos->data.F32[row]<=0.6 || rbad->data.F32[row]<=0.4 || rmask->data.F32[row]<=0.4 || rall->data.F32[row]<=0.3) {
     288          psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of diff params: 3, 0.6, 0.4, 0.4, 0.3: %ld %g %f %f %f ", row, i, npos->data.F32[row],fpos->data.F32[row],rbad->data.F32[row],rmask->data.F32[row],rall->data.F32[row]);
     289          det->mask->data.U8[row] = 0xFF;
     290          continue;
     291        }
     292      }
    252293
    253294      // Calculate error in RA, Dec
Note: See TracChangeset for help on using the changeset viewer.