Index: trunk/ippToPsps/perl/ippToPsps/Batch.pm
===================================================================
--- trunk/ippToPsps/perl/ippToPsps/Batch.pm	(revision 29999)
+++ trunk/ippToPsps/perl/ippToPsps/Batch.pm	(revision 30147)
@@ -126,8 +126,4 @@
     $self->{_surveyType} = $self->getSurveyTypeFromDistGroup();
 
-    # can we run ippToPsps?
-    $self->{_ippToPsps} = can_run('ippToPsps') or
-        (warn "Can't find 'ippToPsps' program" and exit($PS_EXIT_CONFIG_ERROR));
-
     # set up batch output paths
     $self->init();
@@ -139,4 +135,17 @@
 
     return $self;
+}
+
+########################################################################################
+# 
+# Sets to program and checks we can run it
+# 
+########################################################################################
+sub setProgram {
+    my ($self, $program) = @_;
+
+    # can we run ippToPsps?
+    $self->{program} = can_run($program) or
+        (warn "Can't find '$program' program" and exit($PS_EXIT_CONFIG_ERROR));
 }
 
@@ -197,21 +206,6 @@
     my ($self, $input, $resultsFilePath) = @_;
 
-    # build command
-    my $command = "$self->{_ippToPsps}";
-    $command .= " -input $input";
-    $command .= " -output $self->{_batchDir}";
-    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
-    $command .= " -config ../config"; # TODO
-        $command .= " -id $self->{_expId}";
-    $command .= " -expname $self->{_expName}";
-    $command .= " -survey $self->{_surveyType}";
-    $command .= " -batch $self->{_type}";
-    $command .= " -results $resultsFilePath";
-
-    # run command
-    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
-        = run(command => $command, verbose => $self->{_verbose});
-
-    return $success;
+    my $thisFunction = (caller(0))[3];
+    print "* ERROR: '$thisFunction' not implemented\n";
 }
 
Index: trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm
===================================================================
--- trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm	(revision 29999)
+++ trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm	(revision 30147)
@@ -8,4 +8,5 @@
 use File::Temp qw(tempfile);
 use XML::LibXML;
+use IPC::Cmd 0.36 qw( can_run run );
 
 use ippToPsps::Batch;
@@ -63,4 +64,6 @@
             );
 
+    $self->setProgram("detectionbatch");
+
     bless $self, $class;
     $self->process();
@@ -105,4 +108,31 @@
 #######################################################################################
 #
+# runs the ippToPsps program
+#
+#######################################################################################
+sub runProgram {
+    my ($self, $input, $resultsFilePath) = @_;
+
+    # build command
+    my $command = "$self->{program}";
+    $command .= " -input $input";
+    $command .= " -output $self->{_batchDir}";
+    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
+    $command .= " -config ../config"; # TODO
+    $command .= " -survey $self->{_surveyType}";
+    $command .= " -results $resultsFilePath";
+    $command .= " -expid $self->{_expId}";
+    $command .= " -expname $self->{_expName}";
+
+    # run command
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
+        = run(command => $command, verbose => $self->{_verbose});
+
+    return $success;
+}
+
+
+#######################################################################################
+#
 # - Reads results from processing (min/max obj ID etc)
 # - writes to Db
Index: trunk/ippToPsps/perl/ippToPsps/InitBatch.pm
===================================================================
--- trunk/ippToPsps/perl/ippToPsps/InitBatch.pm	(revision 29999)
+++ trunk/ippToPsps/perl/ippToPsps/InitBatch.pm	(revision 30147)
@@ -8,4 +8,5 @@
 use File::Temp qw(tempfile);
 use XML::LibXML;
+use IPC::Cmd 0.36 qw( can_run run );
 
 use ippToPsps::Batch;
@@ -37,4 +38,6 @@
             $_[7]);    # save_temps
 
+    $self->setProgram("initbatch");
+
     bless $self, $class;
     $self->process();
@@ -52,4 +55,26 @@
     return "NULL";
 }
+
+#######################################################################################
+#
+# runs the ippToPsps program
+#
+#######################################################################################
+sub runProgram {
+    my ($self, $input, $resultsFilePath) = @_;
+
+    # build command
+    my $command = "$self->{program}";
+    $command .= " -output $self->{_batchDir}";
+    $command .= " -config ../config"; # TODO
+    $command .= " -results $resultsFilePath";
+
+    # run command
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
+        = run(command => $command, verbose => $self->{_verbose});
+
+    return $success;
+}
+
 
 #######################################################################################
Index: trunk/ippToPsps/perl/ippToPsps/StackBatch.pm
===================================================================
--- trunk/ippToPsps/perl/ippToPsps/StackBatch.pm	(revision 29999)
+++ trunk/ippToPsps/perl/ippToPsps/StackBatch.pm	(revision 30147)
@@ -8,4 +8,5 @@
 use File::Temp qw(tempfile);
 use XML::LibXML;
+use IPC::Cmd 0.36 qw( can_run run );
 
 use ippToPsps::Batch;
@@ -62,5 +63,6 @@
             $_[11]  # save_temps
             );
-
+    
+    $self->setProgram("stackbatch");
 
     $self->{_skyId} = $_[1]; 
@@ -78,4 +80,9 @@
 sub createInputFileList {
     my ($self, $inputFile) = @_;
+
+  # TODO hardcode demo file for now
+        print $inputFile "/data/ippc18.0/home/rhenders/psphotstack.v3.001.cmf\n";
+            return 1;
+
 
     my ($nebPath, $numInputs);
@@ -98,4 +105,30 @@
     return 1;
 }
+
+#######################################################################################
+#
+# runs the ippToPsps program
+#
+#######################################################################################
+sub runProgram {
+    my ($self, $input, $resultsFilePath) = @_;
+
+    # build command
+    my $command = "$self->{program}";
+    $command .= " -input $input";
+    $command .= " -output $self->{_batchDir}";
+    if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";}
+    $command .= " -config ../config"; # TODO
+    $command .= " -survey $self->{_surveyType}";
+    $command .= " -results $resultsFilePath";
+    $command .= " -skycellid $self->{_expId}";
+
+    # run command
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
+        = run(command => $command, verbose => $self->{_verbose});
+
+    return $success;
+}
+
 
 #######################################################################################
Index: trunk/ippToPsps/perl/pspsSchema2xml.pl
===================================================================
--- trunk/ippToPsps/perl/pspsSchema2xml.pl	(revision 29999)
+++ trunk/ippToPsps/perl/pspsSchema2xml.pl	(revision 30147)
@@ -30,6 +30,6 @@
 pod2usage(
         -msg => "\n   Required options:\n\n".
-        "--schema <path to PSPS schema>\n".
-        "--type <init|det|diff|stack|object>\n".
+        "-s   <path to PSPS schema>\n".
+        "-t   <init|detection|diff|stack|object>\n".
         -exitval => 3
         ) unless
@@ -37,5 +37,10 @@
 defined $type;
 
-if ($type ne "init" && $type ne "det" && $type ne "diff" && $type ne "stack" && $type ne "object" ) {
+if (
+        $type ne "init" && 
+        $type ne "detection" && 
+        $type ne "diff" && 
+        $type ne "stack" && 
+        $type ne "object" ) {
 
     print "Don't understand type '$type'\n"; 
@@ -43,5 +48,5 @@
 }
 
-my $enumsHeader = "ippToPsps".ucfirst($type)."Enums";
+my $enumsHeader = ucfirst($type)."BatchEnums";
 open(OUT, ">".$enumsHeader.".h") or die("Error");
 
@@ -61,5 +66,5 @@
 
 if ($type eq "init") {createInit();}
-elsif ($type eq "det") {createDetections();}
+elsif ($type eq "detection") {createDetections();}
 elsif ($type eq "diff") {createDiffs();}
 elsif ($type eq "stack") {createStacks();}
