Changeset 41637 for branches/eam_branches/relphot.20210521/src/TGroupOps.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/TGroupOps.c
r41625 r41637 1265 1265 */ 1266 1266 1267 static float Min MaxChiSq= NAN;1268 static float Max MaxChiSq = 6.0;1269 static float Min MaxScatter= NAN;1270 static float Max MaxScatter = 0.1;1267 static float MinChiSqLim = NAN; 1268 static float MaxChiSqLim = NAN; 1269 static float MinScatterLim = NAN; 1270 static float MaxScatterLim = NAN; 1271 1271 1272 1272 void clean_tgroups () { … … 1277 1277 1278 1278 if (VERBOSE) fprintf (stderr, "marking poor tgroups\n"); 1279 1280 if (isnan (MaxChiSqLim)) MaxChiSqLim = NIGHT_CHISQ; 1281 if (isnan (MaxScatterLim)) MaxScatterLim = NIGHT_SCATTER; 1279 1282 1280 1283 ALLOCATE (mlist, double, NtgroupTimes*Nphotcodes); … … 1300 1303 liststats (mlist, NULL, NULL, N, &stats); 1301 1304 float ChiSqUpper90 = stats.Upper90; 1302 if (isnan (Min MaxChiSq)) MinMaxChiSq = 2.0*stats.median;1303 float MaxChiSq = MIN(MaxMaxChiSq, MAX (MinMaxChiSq, ChiSqUpper90)); // the upper limit should be between MinMaxChiSq and MaxMaxChiSq1305 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 1304 1307 1305 1308 liststats (slist, NULL, NULL, N, &stats); 1306 1309 float ScatterUpper90 = stats.Upper90; 1307 if (isnan (Min MaxScatter)) 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); 1311 1314 1312 1315 int Ntotal = 0, Npoor = 0, Nmark = 0, Nscatter = 0, Nchisq = 0, NfewNights = 0, NfewExp = 0; … … 1337 1340 } 1338 1341 // scatter too large 1339 if (tgroup[j].stdev > MaxScatter) {1342 if (tgroup[j].stdev > ScatterLimit) { 1340 1343 mark = TRUE; 1341 1344 Nscatter ++; 1342 1345 } 1343 1346 // chisq too large 1344 if (tgroup[j].McalChiSq > MaxChiSq) {1347 if (tgroup[j].McalChiSq > ChiSqLimit) { 1345 1348 mark = TRUE; 1346 1349 Nchisq ++;
Note:
See TracChangeset
for help on using the changeset viewer.
