Index: trunk/tools/bills/comparep2detections
===================================================================
--- trunk/tools/bills/comparep2detections	(revision 39001)
+++ trunk/tools/bills/comparep2detections	(revision 39002)
@@ -12,15 +12,11 @@
 my $in;
 my $out;
-my $ofmt;
-my $stiltsJar = '/home/panstarrs/bills/jars/stilts.jar';
-my $stilts = "java -jar $stiltsJar";
 
-my $test = 1;
+my $testdata;
 
 my ($verbose, $save_temps);
 
 GetOptions(
-    "test"              =>  \$test,
-    "ofmt=s"            =>  \$ofmt,
+    "testdata=s"        =>  \$testdata,
     "join=s"            =>  \$joinType,
     "verbose|v"         =>  \$verbose,
@@ -28,14 +24,25 @@
 ) or pod2usage( 2 );
 
-die "usage: $0 [--ofmt <ofmt>] <p2 batch file> [<out>]\n" unless (scalar @ARGV == 1) or (scalar @ARGV == 2);
+die "usage: $0 <p2 batch file> [<out>]\n" unless (scalar @ARGV == 2);
 
 $in = shift;
 $out = shift;
 
+my $jardir = $ENV{JARDIR};
+unless ($jardir) {
+    $jardir = '/home/panstarrs/bills/jars' unless $jardir;
+    print STDERR "JARDIR envrionment variable not found. Using $jardir\n" if $verbose;
+    # add it to the enviorment so that the other programs can use it
+    $ENV{JARDIR} = $jardir;
+}
+my $stiltsJar = "$jardir/stilts.jar";
+my $stilts = "java -jar $stiltsJar";
+
+# file name for concatenated detection extensions
 my $detcat = "cat." . basename($in);
 
 runcommand( "concatp2batch $in $detcat");
 
-# find exp_id. XXX: we could use batch name for this or require user to find this
+# find exp_id. XXX: I think that we could use file batch name for this or require user to supply it as an argument
 my $command = "$stilts tcat in=$detcat icmd='head 1;keepcols imageID;' ofmt=ascii | grep -v '#'";
 my $imageID = `$command`;
@@ -46,7 +53,6 @@
 
 my $smf;
-if ($test) {
-    # XXX: make an option
-    my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
+if ($testdata) {
+#    my $testdata = "/data/ippc19.0/home/bills/ipp/ippToPsps/test/testdata";
     $smf = sprintf "%s/test.%02d.smf", $testdata, $exp_id;
 } else {
@@ -58,5 +64,5 @@
 
 $command = "concatsmf $smf $ippcat";
-$command .= " --test" if $test;
+$command .= " --test" if $testdata;
 
 runcommand($command);
Index: trunk/tools/bills/concatsmf
===================================================================
--- trunk/tools/bills/concatsmf	(revision 39001)
+++ trunk/tools/bills/concatsmf	(revision 39002)
@@ -36,5 +36,8 @@
 
 # TODO: make this an option
-my $stiltsJar = '/home/panstarrs/bills/jars/stilts.jar';
+my $jardir = $ENV{JARDIR};
+$jardir = '/home/panstarrs/bills/jars' unless $jardir;
+
+my $stiltsJar = "$jardir/stilts.jar";
 
 my $stilts="java -jar $stiltsJar";
@@ -59,5 +62,5 @@
 
 if ($test_smf) {
-    # Test smf created by the ippToPsps test suite
+    # Input is a test smf created by the ippToPsps test suite
     # file name format is 'test.$exp_id.smf"
     # There is only a single psf extension for chipnum zero
@@ -67,5 +70,5 @@
 }
 
-# gpc1 smf
+# assuming a gpc1 smf
 
 ($exp_name, $exp_id, undef, $cam_id) = split '\.', $infilename;
Index: trunk/tools/bills/matchIppToPsps
===================================================================
--- trunk/tools/bills/matchIppToPsps	(revision 39001)
+++ trunk/tools/bills/matchIppToPsps	(revision 39002)
@@ -7,5 +7,4 @@
 use Pod::Usage qw( pod2usage );
 
-
 my $joinType = '1and2';
 my $in1;
@@ -13,5 +12,9 @@
 my $out;
 my $ofmt;
-my $stiltsJar = '/home/panstarrs/bills/jars/stilts.jar';
+
+my $jardir = $ENV{JARDIR};
+$jardir = '/home/panstarrs/bills/jars' unless $jardir;
+
+my $stiltsJar = "$jardir/stilts.jar";
 my $stilts = "java -jar $stiltsJar";
 
