IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31313


Ignore:
Timestamp:
Apr 18, 2011, 8:55:26 AM (15 years ago)
Author:
eugene
Message:

raise bit for PASS1 detections; set MODE_PSFMODEL in linear fit as well as nonlinear fit; move flags for fitting results into pmSourceFits not the calling function (more explicitly sets the bits in the right cases); adding test MaskedKron function

Location:
branches/eam_branches/ipp-20110404/psphot
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psphot/src/Makefile.am

    r31154 r31313  
    167167        psphotSourcePlots.c            \
    168168        psphotRadialPlot.c             \
     169        psphotKronMasked.c             \
    169170        psphotDeblendSatstars.c        \
    170171        psphotMosaicSubimage.c         \
  • branches/eam_branches/ipp-20110404/psphot/src/psphot.h

    r31154 r31313  
    149149bool            psphotPSFstats (pmReadout *readout, pmPSF *psf);
    150150bool            psphotMomentsStats (pmReadout *readout, psArray *sources);
     151
     152bool            psphotKronMasked (pmConfig *config, const pmFPAview *view, const char *filerule);
     153bool            psphotKronMaskedReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf);
    151154
    152155// in psphotGuessModel.c
  • branches/eam_branches/ipp-20110404/psphot/src/psphotBlendFit.c

    r31154 r31313  
    280280        if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) {
    281281            if (psphotFitBlob (readout, source, newSources, psf, fitOptions, maskVal, markVal)) {
    282                 source->type = PM_SOURCE_TYPE_EXTENDED;
    283282                psTrace ("psphot", 5, "source at %7.1f, %7.1f is ext", source->peak->xf, source->peak->yf);
    284283                Next ++;
    285                 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    286284                continue;
    287285            }
     
    291289                psTrace ("psphot", 5, "source at %7.1f, %7.1f is psf", source->peak->xf, source->peak->yf);
    292290                Npsf ++;
    293                 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    294291                continue;
    295292            }
  • branches/eam_branches/ipp-20110404/psphot/src/psphotFitSourcesLinear.c

    r31154 r31313  
    164164
    165165        // check the integral of the model : is it large enough?
     166        // apply mask?
    166167        float modelSum = 0.0;
    167168        for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
     
    171172        }
    172173        if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit)
    173         // if (modelSum < 0.01) continue; // skip sources with no model constraint (somewhat arbitrary limit)
    174174        if (modelSum < 0.8) {
    175175            fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n",
     
    177177        }
    178178
    179         pmModel *model = pmSourceGetModel (NULL, source);
     179        bool isPSF = false;
     180        pmModel *model = pmSourceGetModel (&isPSF, source);
    180181
    181182        psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal));
    182183        psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, model->fitRadius, "OR", markVal);
    183184
    184         source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
     185        // we call this function multiple times. for the first time, we have only PSF models for all objects
     186        // the second time has extended sources.  If we ever fit the PSF model, we should raise this bit
     187        source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
     188        if (isPSF) {
     189            source->mode |= PM_SOURCE_MODE_PSFMODEL;
     190        }           
     191       
    185192        psArrayAdd (fitSources, 100, source);
    186193    }
  • branches/eam_branches/ipp-20110404/psphot/src/psphotFitSourcesLinearStack.c

    r31154 r31313  
    6969            if (!pmSourceCacheModel (source, maskVal)) continue;
    7070          }
     71
     72          // check the integral of the model : is it large enough?
     73          float modelSum = 0.0;
     74          for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
     75              for (int ix = 0; ix < source->modelFlux->numCols; ix++) {
     76                  modelSum += source->modelFlux->data.F32[iy][ix];
     77              }
     78          }
     79          if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit)
     80          if (modelSum < 0.8) {
     81              fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n",
     82                       source->peak->xf, source->peak->yf, modelSum, source->peak->rawFlux);
     83          }
    7184
    7285          source->mode |= PM_SOURCE_MODE_LINEAR_FIT;
  • branches/eam_branches/ipp-20110404/psphot/src/psphotMagnitudes.c

    r31154 r31313  
    177177
    178178        status = pmSourceMagnitudes (source, psf, photMode, maskVal, markVal, source->apRadius);
    179         if (status && isfinite(source->apMag)) Nap ++;
     179        if (status && isfinite(source->apMag)) {
     180            Nap ++;
     181        } else {
     182            fprintf (stderr, "failed to measure mag for source @ %f,%f\n", source->peak->xf, source->peak->yf);
     183        }
    180184
    181185        // clear the mask bit
  • branches/eam_branches/ipp-20110404/psphot/src/psphotReadout.c

    r31154 r31313  
    146146    }
    147147
     148    // psphotKronMasked(config, view, filerule);
     149
    148150    // find blended neighbors of very saturated stars (detections->newSources)
    149151    // if (!psphotDeblendSatstars (config, view, filerule)) {
  • branches/eam_branches/ipp-20110404/psphot/src/psphotSourceFits.c

    r31154 r31313  
    146146    pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
    147147    source->mode |=  PM_SOURCE_MODE_BLEND_FIT;
     148    source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    148149    return true;
    149150}
     
    186187
    187188    // build cached model and subtract
     189    source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    188190    pmSourceCacheModel (source, maskVal);
    189191    pmSourceSub (source, PM_MODEL_OP_FULL, maskVal);
     
    319321    source->type = PM_SOURCE_TYPE_EXTENDED;
    320322    source->mode |= PM_SOURCE_MODE_EXTMODEL;
     323    source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    321324
    322325    // build cached model and subtract
     
    346349    source->modelPSF = psMemIncrRefCounter (DBL->data[0]);
    347350    source->mode     |= PM_SOURCE_MODE_PAIR;
     351    source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;
    348352
    349353    // copy most data from the primary source (modelEXT, blends stay NULL)
  • branches/eam_branches/ipp-20110404/psphot/src/psphotSourceStats.c

    r31154 r31313  
    9898
    9999    // generate the array of sources, define the associated pixel
     100    bool firstPass = false;
    100101    if (!detections->newSources) {
    101102        detections->newSources = psArrayAllocEmpty (peaks->n);
     103        firstPass = true;
    102104    }
    103105    sources = detections->newSources;
     
    125127        if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) {
    126128            fprintf (stderr, "moment failure\n");
     129        }
     130
     131        if (firstPass) {
     132            source->mode2 |= PM_SOURCE_MODE2_PASS1_SRC;
    127133        }
    128134
  • branches/eam_branches/ipp-20110404/psphot/test/tap_psphot_stackphot.pro

    r31154 r31313  
    11#!/usr/bin/env mana
    22# -*-sh-*-
     3
     4$KAPA = kapa -noX
    35
    46# config for ppImage to generate chip, mask, weight
Note: See TracChangeset for help on using the changeset viewer.