Changeset 31328
- Timestamp:
- Apr 20, 2011, 11:03:36 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/psphot/src
- Files:
-
- 6 edited
-
psphotKronMasked.c (modified) (1 diff)
-
psphotMagnitudes.c (modified) (2 diffs)
-
psphotModelTest.c (modified) (1 diff)
-
psphotReadout.c (modified) (1 diff)
-
psphotReplaceUnfit.c (modified) (1 diff)
-
psphotSourceStats.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psphot/src/psphotKronMasked.c
r31314 r31328 85 85 86 86 // 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 89 96 int Kr = 2.5*source->moments->Mrf; 90 97 int Kr2 = Kr*Kr; -
branches/eam_branches/ipp-20110404/psphot/src/psphotMagnitudes.c
r31313 r31328 167 167 pmSource *source = (pmSource *) sources->data[i]; 168 168 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 169 183 // replace object in image 170 184 if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) { 171 185 pmSourceAdd (source, PM_MODEL_OP_FULL, maskVal); 172 186 } 187 188 if (saveTest) { 189 psphotSaveImage(NULL, testImage, "test.image.2.fits"); 190 } 173 191 174 192 // clear the mask bit and set the circular mask pixels … … 188 206 // re-subtract the object, leave local sky 189 207 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 208 209 if (saveTest) { 210 psphotSaveImage(NULL, testImage, "test.image.3.fits"); 211 } 190 212 191 213 if (backModel) { -
branches/eam_branches/ipp-20110404/psphot/src/psphotModelTest.c
r29548 r31328 226 226 // measure the source mags 227 227 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); 229 229 fprintf (stderr, "ap: %f, fit: %f, apmifit: %f, nIter: %d\n", obsMag, fitMag, obsMag - fitMag, model->nIter); 230 230 -
branches/eam_branches/ipp-20110404/psphot/src/psphotReadout.c
r31313 r31328 347 347 psErrorStackPrint(stderr, "Unable to replace sky"); 348 348 psErrorClear(); 349 350 /* psLogMsg("psphot", 3, "failed on psphotSkyReplace"); */ 351 /* return(psphotReadoutCleanup(config, view, filerule)); */ 352 } 349 } 350 353 351 // drop the references to the image pixels held by each source 354 352 if (!psphotSourceFreePixels (config, view, filerule)) { // pass 1 355 353 psErrorStackPrint(stderr, "Unable to free source pixels"); 356 354 psErrorClear(); 357 358 /* psLogMsg ("psphot", 3, "failed on psphotSourceFreePixels"); */ 359 /* return(psphotReadoutCleanup(config, view, filerule)); */ 360 } 355 } 356 361 357 // create the exported-metadata and free local data 362 358 return psphotReadoutCleanup(config, view, filerule); -
branches/eam_branches/ipp-20110404/psphot/src/psphotReplaceUnfit.c
r31154 r31328 67 67 psAssert (maskVal, "missing mask value?"); 68 68 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 69 76 for (int i = 0; i < sources->n; i++) { 70 77 source = sources->data[i]; -
branches/eam_branches/ipp-20110404/psphot/src/psphotSourceStats.c
r31313 r31328 238 238 psphotVisualShowMoments (sources); 239 239 240 // clear the mark bits 241 // psImageMaskPixels (readout->mask, "AND", PS_NOT_IMAGE_MASK(markVal)); 242 240 243 if (detections->allSources) { 241 244 psphotMaskCosmicRayFootprintCheck(detections->allSources); … … 462 465 continue; 463 466 } 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 464 473 Nmoments ++; 465 474
Note:
See TracChangeset
for help on using the changeset viewer.
