IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31328


Ignore:
Timestamp:
Apr 20, 2011, 11:03:36 AM (15 years ago)
Author:
eugene
Message:

commented-out test code; include the mark in the mask when replacing sources (they were subtracted including the mark)

Location:
branches/eam_branches/ipp-20110404/psphot/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psphot/src/psphotKronMasked.c

    r31314 r31328  
    8585
    8686        // generate the pixel masks
    87         int Xo = source->moments->Mx;
    88         int Yo = source->moments->My;
     87        // int Xo = source->moments->Mx;
     88        // int Yo = source->moments->My;
     89        float dX = source->moments->Mx - source->peak->xf;
     90        float dY = source->moments->My - source->peak->yf;
     91        float dR = hypot(dX, dY);
     92       
     93        float Xo = (dR < 2.0) ? source->moments->Mx : source->peak->xf;
     94        float Yo = (dR < 2.0) ? source->moments->My : source->peak->yf;
     95       
    8996        int Kr = 2.5*source->moments->Mrf;
    9097        int Kr2 = Kr*Kr;
  • branches/eam_branches/ipp-20110404/psphot/src/psphotMagnitudes.c

    r31313 r31328  
    167167        pmSource *source = (pmSource *) sources->data[i];
    168168
     169        bool saveTest = false;
     170        psImage *testImage = NULL;
     171# if (0)
     172        if ((fabs(source->peak->xf-3518) < 5) && (fabs(source->peak->yf-3178) < 5)) {
     173            saveTest = true;
     174            psRegion subregion = psRegionSet (source->peak->xf - 200, source->peak->xf + 200, source->peak->yf - 200, source->peak->yf + 200);
     175            testImage = psImageSubset ((psImage *) source->pixels->parent, subregion);
     176        }
     177# endif
     178
     179        if (saveTest) {
     180            psphotSaveImage(NULL, testImage, "test.image.1.fits");
     181        }
     182
    169183        // replace object in image
    170184        if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) {
    171185            pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal);
    172186        }
     187
     188        if (saveTest) {
     189            psphotSaveImage(NULL, testImage, "test.image.2.fits");
     190        }
    173191
    174192        // clear the mask bit and set the circular mask pixels
     
    188206        // re-subtract the object, leave local sky
    189207        pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
     208
     209        if (saveTest) {
     210            psphotSaveImage(NULL, testImage, "test.image.3.fits");
     211        }
    190212
    191213        if (backModel) {
  • branches/eam_branches/ipp-20110404/psphot/src/psphotModelTest.c

    r29548 r31328  
    226226    // measure the source mags
    227227    pmSourcePhotometryModel (&fitMag, model);
    228     pmSourcePhotometryAper  (&obsMag, NULL, NULL, model, source->pixels, source->variance, source->maskObj, maskVal);
     228    pmSourcePhotometryAper  (NULL, &obsMag, NULL, NULL, model, source->pixels, source->variance, source->maskObj, maskVal);
    229229    fprintf (stderr, "ap: %f, fit: %f, apmifit: %f, nIter: %d\n", obsMag, fitMag, obsMag - fitMag, model->nIter);
    230230
  • branches/eam_branches/ipp-20110404/psphot/src/psphotReadout.c

    r31313 r31328  
    347347      psErrorStackPrint(stderr, "Unable to replace sky");
    348348      psErrorClear();
    349 
    350 /*       psLogMsg("psphot", 3, "failed on psphotSkyReplace"); */
    351 /*       return(psphotReadoutCleanup(config, view, filerule)); */
    352     }
     349    }
     350
    353351    // drop the references to the image pixels held by each source
    354352    if (!psphotSourceFreePixels (config, view, filerule)) { // pass 1
    355353      psErrorStackPrint(stderr, "Unable to free source pixels");
    356354      psErrorClear();
    357 
    358 /*       psLogMsg ("psphot", 3, "failed on psphotSourceFreePixels"); */
    359 /*       return(psphotReadoutCleanup(config, view, filerule)); */
    360     }
     355    }
     356
    361357    // create the exported-metadata and free local data
    362358    return psphotReadoutCleanup(config, view, filerule);
  • branches/eam_branches/ipp-20110404/psphot/src/psphotReplaceUnfit.c

    r31154 r31328  
    6767    psAssert (maskVal, "missing mask value?");
    6868
     69    // bit-mask to mark pixels not used in analysis
     70    psImageMaskType markVal = psMetadataLookupImageMask(&status, recipe, "MARK.PSPHOT");
     71    assert (markVal);
     72
     73    // maskVal is used to test for rejected pixels, and must include markVal
     74    maskVal |= markVal;
     75
    6976    for (int i = 0; i < sources->n; i++) {
    7077      source = sources->data[i];
  • branches/eam_branches/ipp-20110404/psphot/src/psphotSourceStats.c

    r31313 r31328  
    238238    psphotVisualShowMoments (sources);
    239239
     240    // clear the mark bits
     241    // psImageMaskPixels (readout->mask, "AND", PS_NOT_IMAGE_MASK(markVal));
     242
    240243    if (detections->allSources) {
    241244        psphotMaskCosmicRayFootprintCheck(detections->allSources);
     
    462465            continue;
    463466        }
     467
     468        // XXX test of masking neighbors when measureing moments (does this fail?)
     469        // psEllipseMoments moments = {source->moments->Mxx, source->moments->Myy, source->moments->Mxy};
     470        // psEllipseAxes axes = psEllipseMomentsToAxes(moments, 20.0);
     471        // psImageMaskCircle (source->maskView, source->peak->x, source->peak->y, 3.0*axes.major, "OR", markVal);
     472
    464473        Nmoments ++;
    465474
Note: See TracChangeset for help on using the changeset viewer.