Index: /trunk/Ohana/src/perl/src/fr.getfringe
===================================================================
--- /trunk/Ohana/src/perl/src/fr.getfringe	(revision 21)
+++ /trunk/Ohana/src/perl/src/fr.getfringe	(revision 22)
@@ -7,6 +7,6 @@
 
 # define the path to include FLIPS:
-$flipsconf=`gconfig -q FLIPSCONF`; chop ($flipsconf);
-$flipspath=`gconfig -q FLIPSPATH`; chop ($flipspath);
+$flipsconf=`gconfig -q FLIPSCONF`; chop $flipsconf;
+$flipspath=`gconfig -q FLIPSPATH`; chop $flipspath;
 $ENV{'PATH'} = "$ENV{'PATH'}:$flipspath";
 $ENV{'FLIPSDIR'} = $flipsconf;
@@ -23,38 +23,20 @@
 foreach $line (@inlist) { chop $line; }
 
-# gtfringe is appending to the output file:
+# getfringe appends to the output file:
 unlink ($output);
 
-# we construct the Fringe Coord File from: FRINGE_COORD_PATH/CAMERA-FILTER-CCDNN-FringeCoord.reg
-$fkey      = `gconfig -q FILTER-KEYWORD`;    chop ($fkey);
-$ckey      = `gconfig -q CAMERA-KEYWORD`;    chop ($ckey);
-$coordpath = `gconfig -q FRINGE_COORD_PATH`; chop ($coordpath);
-$Nccd      = `cameraconfig -Nccd`;           chop ($Nccd);
-$answer = `cameraconfig -ccds`;
-@ccds = split (" ", $answer); 
-
-# double check lists size:
+# basic camera data
+$Nccd      = `cameraconfig -Nccd`;  chop $Nccd;
+$answer    = `cameraconfig -ccds`;  @ccds = split (" ", $answer); 
 if ($Nccd != @inlist) { die "ERROR: mis-matched image list sizes\n"; }
 
-# find filter and camera from image
-$answer = `echo $inlist[0] | fields $fkey $ckey`;
-($name, $filtvalue, $camera) = split (" ", $answer);
-$filter = `filtnames $filtvalue`; chop $filter;
-if ($?) { die "can't find filter for $filtvalue\n"; }
-print STDERR "camera: $camera\n";
-if ($camera eq "") { $camera = "WFI"; }
-#### a temporary hack to for this to work...
+# find fringe coordinate file
+$coordfile = `detsearch -image $inlist[0] 00 split -type frpts`; chop $coordfile;
+if ($?) { die "ERROR: can't find fringe point file for this image\n"; }
 
+# each call to getfringe adds a line to $output 
 for ($ccd = 0; $ccd < $Nccd; $ccd++) {
-    
-    $infile    = $inlist[$ccd];
-    $coordfile = sprintf "%s/%s-%s-CCD%s-FringeCoord.reg", $coordpath, $camera, $filter, $ccds[$ccd];
-
-    # each call to gtfringe adds a line to $output 
-    vsystem ("getfringe $infile $coordfile $bin $output");
-    if ($?) {
-	print STDERR "ERROR running getfringe\n";
-	exit 1;
-    }
+    vsystem ("getfringe $inlist[$ccd] $ccds[$ccd] $coordfile $bin $output");
+    if ($?) { die "ERROR running getfringe\n"; }
 }
 
