Changeset 31313
- Timestamp:
- Apr 18, 2011, 8:55:26 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/psphot
- Files:
-
- 10 edited
-
src/Makefile.am (modified) (1 diff)
-
src/psphot.h (modified) (1 diff)
-
src/psphotBlendFit.c (modified) (2 diffs)
-
src/psphotFitSourcesLinear.c (modified) (3 diffs)
-
src/psphotFitSourcesLinearStack.c (modified) (1 diff)
-
src/psphotMagnitudes.c (modified) (1 diff)
-
src/psphotReadout.c (modified) (1 diff)
-
src/psphotSourceFits.c (modified) (4 diffs)
-
src/psphotSourceStats.c (modified) (2 diffs)
-
test/tap_psphot_stackphot.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psphot/src/Makefile.am
r31154 r31313 167 167 psphotSourcePlots.c \ 168 168 psphotRadialPlot.c \ 169 psphotKronMasked.c \ 169 170 psphotDeblendSatstars.c \ 170 171 psphotMosaicSubimage.c \ -
branches/eam_branches/ipp-20110404/psphot/src/psphot.h
r31154 r31313 149 149 bool psphotPSFstats (pmReadout *readout, pmPSF *psf); 150 150 bool psphotMomentsStats (pmReadout *readout, psArray *sources); 151 152 bool psphotKronMasked (pmConfig *config, const pmFPAview *view, const char *filerule); 153 bool psphotKronMaskedReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf); 151 154 152 155 // in psphotGuessModel.c -
branches/eam_branches/ipp-20110404/psphot/src/psphotBlendFit.c
r31154 r31313 280 280 if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) { 281 281 if (psphotFitBlob (readout, source, newSources, psf, fitOptions, maskVal, markVal)) { 282 source->type = PM_SOURCE_TYPE_EXTENDED;283 282 psTrace ("psphot", 5, "source at %7.1f, %7.1f is ext", source->peak->xf, source->peak->yf); 284 283 Next ++; 285 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;286 284 continue; 287 285 } … … 291 289 psTrace ("psphot", 5, "source at %7.1f, %7.1f is psf", source->peak->xf, source->peak->yf); 292 290 Npsf ++; 293 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT;294 291 continue; 295 292 } -
branches/eam_branches/ipp-20110404/psphot/src/psphotFitSourcesLinear.c
r31154 r31313 164 164 165 165 // check the integral of the model : is it large enough? 166 // apply mask? 166 167 float modelSum = 0.0; 167 168 for (int iy = 0; iy < source->modelFlux->numRows; iy++) { … … 171 172 } 172 173 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)174 174 if (modelSum < 0.8) { 175 175 fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n", … … 177 177 } 178 178 179 pmModel *model = pmSourceGetModel (NULL, source); 179 bool isPSF = false; 180 pmModel *model = pmSourceGetModel (&isPSF, source); 180 181 181 182 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 182 183 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, model->fitRadius, "OR", markVal); 183 184 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 185 192 psArrayAdd (fitSources, 100, source); 186 193 } -
branches/eam_branches/ipp-20110404/psphot/src/psphotFitSourcesLinearStack.c
r31154 r31313 69 69 if (!pmSourceCacheModel (source, maskVal)) continue; 70 70 } 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 } 71 84 72 85 source->mode |= PM_SOURCE_MODE_LINEAR_FIT; -
branches/eam_branches/ipp-20110404/psphot/src/psphotMagnitudes.c
r31154 r31313 177 177 178 178 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 } 180 184 181 185 // clear the mask bit -
branches/eam_branches/ipp-20110404/psphot/src/psphotReadout.c
r31154 r31313 146 146 } 147 147 148 // psphotKronMasked(config, view, filerule); 149 148 150 // find blended neighbors of very saturated stars (detections->newSources) 149 151 // if (!psphotDeblendSatstars (config, view, filerule)) { -
branches/eam_branches/ipp-20110404/psphot/src/psphotSourceFits.c
r31154 r31313 146 146 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 147 147 source->mode |= PM_SOURCE_MODE_BLEND_FIT; 148 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 148 149 return true; 149 150 } … … 186 187 187 188 // build cached model and subtract 189 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 188 190 pmSourceCacheModel (source, maskVal); 189 191 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); … … 319 321 source->type = PM_SOURCE_TYPE_EXTENDED; 320 322 source->mode |= PM_SOURCE_MODE_EXTMODEL; 323 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 321 324 322 325 // build cached model and subtract … … 346 349 source->modelPSF = psMemIncrRefCounter (DBL->data[0]); 347 350 source->mode |= PM_SOURCE_MODE_PAIR; 351 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 348 352 349 353 // copy most data from the primary source (modelEXT, blends stay NULL) -
branches/eam_branches/ipp-20110404/psphot/src/psphotSourceStats.c
r31154 r31313 98 98 99 99 // generate the array of sources, define the associated pixel 100 bool firstPass = false; 100 101 if (!detections->newSources) { 101 102 detections->newSources = psArrayAllocEmpty (peaks->n); 103 firstPass = true; 102 104 } 103 105 sources = detections->newSources; … … 125 127 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) { 126 128 fprintf (stderr, "moment failure\n"); 129 } 130 131 if (firstPass) { 132 source->mode2 |= PM_SOURCE_MODE2_PASS1_SRC; 127 133 } 128 134 -
branches/eam_branches/ipp-20110404/psphot/test/tap_psphot_stackphot.pro
r31154 r31313 1 1 #!/usr/bin/env mana 2 2 # -*-sh-*- 3 4 $KAPA = kapa -noX 3 5 4 6 # config for ppImage to generate chip, mask, weight
Note:
See TracChangeset
for help on using the changeset viewer.
