IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 4, 2021, 10:46:36 AM (5 years ago)
Author:
eugene
Message:

add user-control over night, mosaic, image chisq & scatter cuts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/relphot.20210521/src/MosaicOps.c

    r41625 r41637  
    14831483/* mark mosaic if: abs(Mcal - <Mcal>) too large, dMcal too large */
    14841484
    1485 static float MinMaxChiSq = NAN;
    1486 static float MinMaxScatter = NAN;
     1485static float MinChiSqLim = NAN;
     1486static float MaxChiSqLim = NAN;
     1487static float MinScatterLim = NAN;
     1488static float MaxScatterLim = NAN;
    14871489
    14881490void clean_mosaics () {
     
    14941496
    14951497  if (VERBOSE) fprintf (stderr, "marking poor mosaics\n");
     1498
     1499  if (isnan (MaxChiSqLim))   MaxChiSqLim   = MOSAIC_CHISQ;
     1500  if (isnan (MaxScatterLim)) MaxScatterLim = MOSAIC_SCATTER;
    14961501
    14971502  ALLOCATE (mlist, double, Nmosaic);
     
    15161521  liststats (mlist, NULL, NULL, N, &stats);
    15171522  float ChiSqUpper90 = stats.Upper90;
    1518   if (isnan (MinMaxChiSq)) 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
    15201525
    15211526  liststats (slist, NULL, NULL, N, &stats);
    15221527  float ScatterUpper90 = stats.Upper90;
    1523   if (isnan (MinMaxScatter)) 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);
    15271532 
    15281533  int Ntotal = 0, Npoor = 0, Nmark = 0, Nscatter = 0, Nfew = 0, Nchisq = 0;
     
    15471552      Nfew ++;
    15481553    }
    1549     if (mosaic[i].stdev > MaxScatter) {
     1554    if (mosaic[i].stdev > ScatterLimit) {
    15501555      mark = TRUE;
    15511556      Nscatter ++;
    15521557    }
    1553     if (mosaic[i].McalChiSq > MaxChiSq) {
     1558    if (mosaic[i].McalChiSq > ChiSqLimit) {
    15541559      mark = TRUE;
    15551560      Nchisq ++;
Note: See TracChangeset for help on using the changeset viewer.