Changeset 34788
- Timestamp:
- Dec 11, 2012, 9:09:45 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ippconfig/recipes/psphot.config (modified) (1 diff)
-
psphot/src/psphotSourceMatch.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippconfig/recipes/psphot.config
r34769 r34788 384 384 # Note: if an input has a filter not in this list it will be processed after all of the others with MATCH.ALL = FALSE 385 385 PSPHOT.STACK.MATCH.FILTERS METADATA 386 TYPE PSPHOT_STACK.MATCH.FILTER FILTER.ID ORDER MATCH.ALL 387 gband PSPHOT_STACK.MATCH.FILTER g 4 FALSE 388 rband PSPHOT_STACK.MATCH.FILTER r 2 FALSE 389 iband PSPHOT_STACK.MATCH.FILTER i 1 FALSE 390 zband PSPHOT_STACK.MATCH.FILTER z 3 FALSE 391 yband PSPHOT_STACK.MATCH.FILTER y 5 TRUE 392 wband PSPHOT_STACK.MATCH.FILTER w 0 FALSE 386 TYPE PSPHOT_STACK.MATCH.FILTER FILTER.ID ORDER MATCH.ALL Y.RATIO.MAX 387 gband PSPHOT_STACK.MATCH.FILTER g 4 FALSE 0 388 rband PSPHOT_STACK.MATCH.FILTER r 2 FALSE 0.6 389 iband PSPHOT_STACK.MATCH.FILTER i 1 FALSE 0.4 390 zband PSPHOT_STACK.MATCH.FILTER z 3 FALSE 0 391 yband PSPHOT_STACK.MATCH.FILTER y 5 TRUE 0 392 wband PSPHOT_STACK.MATCH.FILTER w 0 FALSE 0 393 393 END 394 394 -
trunk/psphot/src/psphotSourceMatch.c
r34542 r34788 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 // In matchInfo recipe each filter can have 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 specified filters is above its limit, we disable matchAll for y band. 233 234 int iy = -1; 235 // now we are looping over matchInfo 236 for (int i = 0; i < nImages; i++) { 237 // Remember which input is y 238 if (!strcmp(matchInfo[i].filterID, "y")) { 239 iy = i; 240 } 241 pmDetections *detections = detArrays->data[matchInfo[i].inputNum]; 242 matchInfo[i].nSources = detections->allSources->n; 243 } 244 245 if (iy >= 0) { 246 int nCut = 0; 247 int nTry = 0; 248 for (int i = 0; i < nImages; i++) { 249 if (i == iy) continue; 250 if (matchInfo[i].yRatioMax != 0.0 && matchInfo[i].nSources > 0) { 251 ++nTry; 252 float ratio = (float) matchInfo[iy].nSources / (float) matchInfo[i].nSources; 253 psLogMsg ("psphot", PS_LOG_DETAIL, "nSrc_y / nSrc_%s: %6.3f max: %6.3f", matchInfo[i].filterID, ratio, 254 matchInfo[i].yRatioMax); 255 if (ratio > matchInfo[i].yRatioMax) { 256 // This one is above it's threshold 257 ++nCut; 258 } 259 } 260 } 261 if (nTry > 0 && nCut == nTry) { 262 // All filters with a cut were above the threshold. Disable matchAll for y band 263 psLogMsg ("psphot", PS_LOG_INFO, "Clearing y band matchAll because y ratio was too high in %d filters", nTry); 264 matchInfo[iy].matchAll = false; 265 } 223 266 } 224 267 … … 516 559 bool matchAll = (strcasecmp("true", matchAllStr) == 0); 517 560 561 psString yRatioStr = psMetadataLookupStr (&status, item->data.md, "Y.RATIO.MAX"); 562 psF32 yRatioMax = atof(yRatioStr); 563 518 564 // look for this filter in the inputs 519 565 for (int i = 0; i < num; i++) { … … 524 570 matchInfo[i].order = order; 525 571 matchInfo[i].matchAll = matchAll; 572 matchInfo[i].yRatioMax = yRatioMax; 573 matchInfo[i].nSources = 0; 526 574 psLogMsg ("psphot", PS_LOG_DETAIL, "input: %d %s match order: %d match all: %d\n", 527 575 i, thisFilter, order, matchAll);
Note:
See TracChangeset
for help on using the changeset viewer.
