Index: /trunk/Ohana/src/perl/src/fr.select
===================================================================
--- /trunk/Ohana/src/perl/src/fr.select	(revision 56)
+++ /trunk/Ohana/src/perl/src/fr.select	(revision 57)
@@ -11,5 +11,5 @@
 $stop   = $ARGV[2];
 $mode = "\U$ARGV[3]\E";
-if (($mode ne "MEF") && ($mode ne "SPLIT")) { die "ERROR: mode must be either -split or -mef\n";}
+if (($mode ne "MEF") && ($mode ne "SPLIT")) { die "ERROR: mode must be either SPLIT or MEF\n";}
 $output = $ARGV[4];
 
@@ -17,9 +17,22 @@
 # these probably should go in the config files eventually.
 $MAX_CNTS = 60000;
-$MIN_CNTS = 2000;
-$MIN_FLUX = 2;
 $MAX_FLUX = 40;
-# if ($filter eq "R") { $MIN_CNTS = 900; }
-if ($filter eq "NB920") { $MIN_CNTS = 180; $MIN_FLUX = 0.3; }
+
+# define some of the relevant parameters
+$tmp = `filtnames $filter`; chop $tmp;
+if ($?) { die "ERROR: invalid filter $filter\n"; }
+$filter = $tmp;
+
+# recipe file defines detrend types & cutoff exptime values
+$recipefile = `gconfig DETREND_RECIPES`; chop $recipefile;
+if ($?) { die "ERROR: missing DETREND_RECIPES in configuration\n"; }
+
+# extract filter extras list
+($tmp, $tmp, $tmp, $extras) = split (" ", `gconfig -c $recipefile $filter`);
+if ($?) { die "ERROR: missing detrend recipe for $filter\n"; }
+
+# grab extra values:
+($detype, $MIN_FLUX, $MIN_CNTS) = split (",", $extras);
+if ("\U$detype\E" ne "FRINGE") { die "ERROR: fringe extras are missing\n"; }
 
 # relevant camera parameters
