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/TGroupOps.c

    r41625 r41637  
    12651265 */
    12661266
    1267 static float MinMaxChiSq = NAN;
    1268 static float MaxMaxChiSq = 6.0;
    1269 static float MinMaxScatter = NAN;
    1270 static float MaxMaxScatter = 0.1;
     1267static float MinChiSqLim = NAN;
     1268static float MaxChiSqLim = NAN;
     1269static float MinScatterLim = NAN;
     1270static float MaxScatterLim = NAN;
    12711271
    12721272void clean_tgroups () {
     
    12771277
    12781278  if (VERBOSE) fprintf (stderr, "marking poor tgroups\n");
     1279
     1280  if (isnan (MaxChiSqLim))   MaxChiSqLim   = NIGHT_CHISQ;
     1281  if (isnan (MaxScatterLim)) MaxScatterLim = NIGHT_SCATTER;
    12791282
    12801283  ALLOCATE (mlist, double, NtgroupTimes*Nphotcodes);
     
    13001303  liststats (mlist, NULL, NULL, N, &stats);
    13011304  float ChiSqUpper90 = stats.Upper90;
    1302   if (isnan (MinMaxChiSq)) MinMaxChiSq = 2.0*stats.median;
    1303   float MaxChiSq = MIN(MaxMaxChiSq, MAX (MinMaxChiSq, ChiSqUpper90)); // the upper limit should be between MinMaxChiSq and MaxMaxChiSq
     1305  if (isnan (MinChiSqLim)) MinChiSqLim = 2.0*stats.median;             // chi-square cut cannot fall below this value (even if this is > MaxChiSqLim)
     1306  float ChiSqLimit = MAX(MinChiSqLim, MIN(MaxChiSqLim, ChiSqUpper90)); // chi-square cut should be between MinChiSqLim and MaxChiSqLim
    13041307
    13051308  liststats (slist, NULL, NULL, N, &stats);
    13061309  float ScatterUpper90 = stats.Upper90;
    1307   if (isnan (MinMaxScatter)) MinMaxScatter = 2.0*stats.median;
    1308   float MaxScatter = MIN(MaxMaxScatter, MAX (MinMaxScatter, ScatterUpper90));
    1309 
    1310   fprintf (stderr, "TGROUPS: Max ChiSq: %f, Max Scatter: %f | ChiSquare Upper 90: %f, Scatter Upper 90: %f\n", MaxChiSq, MaxScatter, ChiSqUpper90, ScatterUpper90);
     1310  if (isnan (MinScatterLim)) MinScatterLim = 2.0*stats.median;         // scatter cut cannto fall below this value (even if this is > MaxScatterLim)
     1311  float ScatterLimit = MAX(MinScatterLim, MIN(MaxScatterLim, ScatterUpper90));
     1312
     1313  fprintf (stderr, "TGROUPS: ChiSqLimit: %f, ScatterLimit: %f | ChiSquare Upper 90: %f, Scatter Upper 90: %f\n", ChiSqLimit, ScatterLimit, ChiSqUpper90, ScatterUpper90);
    13111314 
    13121315  int Ntotal = 0, Npoor = 0, Nmark = 0, Nscatter = 0, Nchisq = 0, NfewNights = 0, NfewExp = 0;
     
    13371340      }
    13381341      // scatter too large
    1339       if (tgroup[j].stdev > MaxScatter) {
     1342      if (tgroup[j].stdev > ScatterLimit) {
    13401343        mark = TRUE;
    13411344        Nscatter ++;
    13421345      }
    13431346      // chisq too large
    1344       if (tgroup[j].McalChiSq > MaxChiSq) {
     1347      if (tgroup[j].McalChiSq > ChiSqLimit) {
    13451348        mark = TRUE;
    13461349        Nchisq ++;
Note: See TracChangeset for help on using the changeset viewer.