Changeset 34838 for branches/eam_branches/ipp-20121130/psphot/src
- Timestamp:
- Dec 18, 2012, 5:56:48 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121130/psphot
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
src (modified) (1 prop)
-
src/psphotOutput.c (modified) (4 diffs)
-
src/psphotSourceMatch.c (modified) (4 diffs)
-
src/psphotSourceSize.c (modified) (3 diffs)
-
src/psphotStackImageLoop.c (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121130/psphot
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/psphot (added) merged: 34772,34786 /trunk/psphot (added) merged: 34769,34787-34788,34795-34796,34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/psphot/src
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/psphot/src (added) merged: 34772,34786 /trunk/psphot/src (added) merged: 34769,34787-34788,34795-34796,34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/psphot/src/psphotOutput.c
r34528 r34838 201 201 int nCR = 0; 202 202 int nEXT = 0; 203 int nForced = 0; 204 int nDetections = sources != NULL ? sources->n : 0; 203 205 204 206 // count the number of sources which will be written and other sub-types 205 207 for (int i = 0; (sources != NULL) && (i < sources->n); i++) { 206 208 pmSource *source = (pmSource *) sources->data[i]; 209 if (source->mode2 & PM_SOURCE_MODE2_MATCHED) { 210 nForced ++; 211 } 207 212 pmModel *model = pmSourceGetModel (NULL, source); 208 213 if (model == NULL) … … 217 222 } 218 223 224 // XXX: This loop cauess nSrc to be twice as large as it should be. This is kept 225 // for compatability 219 226 for (int i = 0; (sources != NULL) && (i < sources->n); i++) { 220 227 pmSource *source = (pmSource *) sources->data[i]; … … 226 233 227 234 psMetadataAddS32 (header, PS_LIST_TAIL, "NSTARS", PS_META_REPLACE, "Number of sources", nSrc); 235 psMetadataAddS32 (header, PS_LIST_TAIL, "NDET", PS_META_REPLACE, "Number of detections", nDetections); 228 236 psMetadataAddS32 (header, PS_LIST_TAIL, "NDET_EXT", PS_META_REPLACE, "Number of extended sources", nEXT); 229 237 psMetadataAddS32 (header, PS_LIST_TAIL, "NDET_CR", PS_META_REPLACE, "Number of cosmic rays", nCR); 238 psMetadataAddS32 (header, PS_LIST_TAIL, "NDET_FRC", PS_META_REPLACE, "Number of Forced detections", nForced); 230 239 return true; 231 240 } … … 306 315 psMetadataItemSupplement (&status, header, analysis, "NSTARS"); 307 316 317 psMetadataItemSupplement (&status, header, analysis, "NDET"); 308 318 psMetadataItemSupplement (&status, header, analysis, "NDET_EXT"); 309 319 psMetadataItemSupplement (&status, header, analysis, "NDET_CR"); 320 psMetadataItemSupplement (&status, header, analysis, "NDET_FRC"); 310 321 311 322 psMetadataItemSupplement (&status, header, analysis, "PSPHOT.PSF.APRESID"); -
branches/eam_branches/ipp-20121130/psphot/src/psphotSourceMatch.c
r34542 r34838 7 7 int order; 8 8 bool matchAll; 9 long nSources; 10 float yRatioMax; 9 11 char filterID[MATCH_INFO_FILTER_STR_LEN]; 10 12 } psphotStackMatchInfo; … … 218 220 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 219 221 psAssert (detections, "missing detections?"); 222 psAssert (detections->allSources, "all sources not defined?"); 220 223 221 224 detArrays->data[i] = psMemIncrRefCounter(detections); 222 225 readouts->data[i] = psMemIncrRefCounter(readout); 226 } 227 228 // We are having a problem with large number of false y band detections causing large numbers of 229 // matched detections to be created. 230 // The matchInfo recipe each entry contains a value for Y.RATIO.MAX. For each filter with a non-zero value 231 // we compare the ratio of the number of y detections to the number of detections in that filter to Y.RATIO.MAX. 232 // If the ratio in all filters with a non-zero is above its limit we consider the y band stack to 233 // be suspect and so disable the y band matchAll recipe (if set) 234 235 int iy = -1; 236 // note now we are looping over matchInfo 237 for (int i = 0; i < nImages; i++) { 238 // Remember which input is y 239 if (!strcmp(matchInfo[i].filterID, "y")) { 240 iy = i; 241 } 242 pmDetections *detections = detArrays->data[matchInfo[i].inputNum]; 243 matchInfo[i].nSources = detections->allSources->n; 244 } 245 246 if (iy >= 0) { 247 int nCut = 0; 248 int nTry = 0; 249 for (int i = 0; i < nImages; i++) { 250 if (i == iy) continue; 251 if (matchInfo[i].yRatioMax != 0.0 && matchInfo[i].nSources > 0) { 252 ++nTry; 253 float ratio = (float) matchInfo[iy].nSources / (float) matchInfo[i].nSources; 254 psLogMsg ("psphot", PS_LOG_DETAIL, "nSrc_y / nSrc_%s: %6.3f max: %6.3f", matchInfo[i].filterID, ratio, 255 matchInfo[i].yRatioMax); 256 if (ratio > matchInfo[i].yRatioMax) { 257 // This one is above it's threshold 258 ++nCut; 259 } 260 } 261 } 262 if (nTry > 0 && nCut == nTry) { 263 // All filters with a cut were above the threshold. Disable matchAll for y band 264 psLogMsg ("psphot", PS_LOG_INFO, "Clearing y band matchAll because y ratio was too high in %d filters", nTry); 265 matchInfo[iy].matchAll = false; 266 } 223 267 } 224 268 … … 516 560 bool matchAll = (strcasecmp("true", matchAllStr) == 0); 517 561 562 psString yRatioStr = psMetadataLookupStr (&status, item->data.md, "Y.RATIO.MAX"); 563 psF32 yRatioMax = atof(yRatioStr); 564 518 565 // look for this filter in the inputs 519 566 for (int i = 0; i < num; i++) { … … 524 571 matchInfo[i].order = order; 525 572 matchInfo[i].matchAll = matchAll; 573 matchInfo[i].yRatioMax = yRatioMax; 574 matchInfo[i].nSources = 0; 526 575 psLogMsg ("psphot", PS_LOG_DETAIL, "input: %d %s match order: %d match all: %d\n", 527 576 i, thisFilter, order, matchAll); -
branches/eam_branches/ipp-20121130/psphot/src/psphotSourceSize.c
r34418 r34838 11 11 float nSigmaMoments; 12 12 float nSigmaCR; 13 bool altDiffExt; 14 float altDiffExtThresh; 13 15 float soft; 14 16 int grow; … … 120 122 assert (status); 121 123 124 // Optional extended source measurement algorithm to improve diff image trails 125 options.altDiffExt = psMetadataLookupBool(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE"); 126 assert (status); 127 // Threshold for this alternate method 128 options.altDiffExtThresh = psMetadataLookupF32(&status, recipe, "PSPHOT.EXT.DIFF.ALTERNATE.THRESH"); 129 assert (status); 130 122 131 // location of a single test source 123 132 options.xtest = psMetadataLookupS32 (&status, recipe, "PSPHOT.CRMASK.XTEST"); … … 601 610 continue; 602 611 } 603 612 // Alternate extended source limit calculation 613 if (options->altDiffExt) { 614 // ratio of major to minor axes 615 // MRV = Major / Minor 616 // MRV = (0.5 * (Mxx + Myy) + 0.5 * sqrt( (Mxx + Myy)^2 + 4 Mxy^2)) / 617 // (0.5 * (Mxx + Myy) - 0.5 * sqrt( (Mxx + Myy)^2 + 4 Mxy^2)) 618 // MRV = (2 * 0.5 * (Mxx + Myy) - Minor) / Minor 619 float momentRatioVeres = (Mxx + Myy - Mminor) / Mminor; 620 bool isAltEXT = (momentRatioVeres > options->altDiffExtThresh); 621 if (isAltEXT) { 622 psTrace("psphotSourceClassRegion.EXT",4,"CLASS: %g %g\t%g %g\t%g %g\t%g %g\t%g ALTEXT\t%g %g\n", 623 source->peak->xf, source->peak->yf, Mminor, kMag, dMag, nSigmaMAG, options->sizeLimitCR, options->magLimitCR, options->nSigmaApResid, 624 momentRatioVeres,options->altDiffExtThresh); 625 source->mode |= PM_SOURCE_MODE_EXT_LIMIT; 626 source->tmpFlags |= PM_SOURCE_TMPF_SIZE_MEASURED; 627 Next ++; 628 continue; 629 } 630 } 631 604 632 // Everything else should just be treated as a PSF 605 633 psTrace("psphotSourceClassRegion.PSF",4,"CLASS: %g %g\t%g %g\t%g %g\t%g %g\t%g PSF\n", -
branches/eam_branches/ipp-20121130/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/psphot/src/psphotStackImageLoop.c (added) merged: 34772,34786 /trunk/psphot/src/psphotStackImageLoop.c merged: 34800
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
