- Timestamp:
- Dec 18, 2012, 5:56:48 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121130/psphot
- Files:
-
- 3 edited
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/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);
Note:
See TracChangeset
for help on using the changeset viewer.
