Changeset 41637 for branches/eam_branches/relphot.20210521/src/MosaicOps.c
- Timestamp:
- Jun 4, 2021, 10:46:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/MosaicOps.c
r41625 r41637 1483 1483 /* mark mosaic if: abs(Mcal - <Mcal>) too large, dMcal too large */ 1484 1484 1485 static float MinMaxChiSq = NAN; 1486 static float MinMaxScatter = NAN; 1485 static float MinChiSqLim = NAN; 1486 static float MaxChiSqLim = NAN; 1487 static float MinScatterLim = NAN; 1488 static float MaxScatterLim = NAN; 1487 1489 1488 1490 void clean_mosaics () { … … 1494 1496 1495 1497 if (VERBOSE) fprintf (stderr, "marking poor mosaics\n"); 1498 1499 if (isnan (MaxChiSqLim)) MaxChiSqLim = MOSAIC_CHISQ; 1500 if (isnan (MaxScatterLim)) MaxScatterLim = MOSAIC_SCATTER; 1496 1501 1497 1502 ALLOCATE (mlist, double, Nmosaic); … … 1516 1521 liststats (mlist, NULL, NULL, N, &stats); 1517 1522 float ChiSqUpper90 = stats.Upper90; 1518 if (isnan (Min MaxChiSq)) MinMaxChiSq = 2.0*stats.median;1519 float MaxChiSq = MAX (MinMaxChiSq, ChiSqUpper90);1523 if (isnan (MinChiSqLim)) MinChiSqLim = 2.0*stats.median; // chi-square cut cannot fall below this value (even if this is > MaxChiSqLim) 1524 float ChiSqLimit = MAX(MinChiSqLim, MIN(MaxChiSqLim, ChiSqUpper90)); // chi-square cut should be between MinChiSqLim and MaxChiSqLim 1520 1525 1521 1526 liststats (slist, NULL, NULL, N, &stats); 1522 1527 float ScatterUpper90 = stats.Upper90; 1523 if (isnan (Min MaxScatter)) MinMaxScatter = 2.0*stats.median;1524 float MaxScatter = MAX (MinMaxScatter, ScatterUpper90);1525 1526 fprintf (stderr, "MOSAIC: Max ChiSq: %f, Max Scatter: %f | ChiSquare Upper 90: %f, Scatter Upper 90: %f\n", MaxChiSq, MaxScatter, ChiSqUpper90, ScatterUpper90);1528 if (isnan (MinScatterLim)) MinScatterLim = 2.0*stats.median; // scatter cut cannto fall below this value (even if this is > MaxScatterLim) 1529 float ScatterLimit = MAX(MinScatterLim, MIN(MaxScatterLim, ScatterUpper90)); 1530 1531 fprintf (stderr, "MOSAIC: ChiSqLimit: %f, ScatterLimit: %f | ChiSquare Upper 90: %f, Scatter Upper 90: %f\n", ChiSqLimit, ScatterLimit, ChiSqUpper90, ScatterUpper90); 1527 1532 1528 1533 int Ntotal = 0, Npoor = 0, Nmark = 0, Nscatter = 0, Nfew = 0, Nchisq = 0; … … 1547 1552 Nfew ++; 1548 1553 } 1549 if (mosaic[i].stdev > MaxScatter) {1554 if (mosaic[i].stdev > ScatterLimit) { 1550 1555 mark = TRUE; 1551 1556 Nscatter ++; 1552 1557 } 1553 if (mosaic[i].McalChiSq > MaxChiSq) {1558 if (mosaic[i].McalChiSq > ChiSqLimit) { 1554 1559 mark = TRUE; 1555 1560 Nchisq ++;
Note:
See TracChangeset
for help on using the changeset viewer.
