Index: trunk/ippScripts/scripts/staticsky.pl
===================================================================
--- trunk/ippScripts/scripts/staticsky.pl	(revision 28092)
+++ trunk/ippScripts/scripts/staticsky.pl	(revision 28096)
@@ -21,4 +21,6 @@
 use PS::IPP::Metadata::List qw( parse_md_list );
 use Data::Dumper;
+use File::Temp qw( tempfile );
+use File::Basename;
 use PS::IPP::Config 1.01 qw( :standard );
 
@@ -36,7 +38,8 @@
 }
 
-my ($sky_id, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect, $save_temps);
+my ($sky_id, $camera, $dbname, $threads, $outroot, $reduction, $inverse, $run_state, $verbose, $no_update, $no_op, $redirect, $save_temps);
 GetOptions(
     'sky_id=s'          => \$sky_id, # Diff identifier
+    'camera|c=s'        => \$camera, # Camera name
     'dbname|d=s'        => \$dbname, # Database name
     'threads=s'         => \$threads,   # Number of threads to use
@@ -53,19 +56,19 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --sky_id --outroot",
+    -msg => "Required options: --sky_id --outroot --camera (--run_state)",
     -exitval => 3,
           ) unless 
     defined $sky_id and
-    defined $outroot;
-
-my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $sky_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
-
-# XXX camera is not known here; cannot use filerules...
-# my $logDest = $ipprc->filename("LOG.EXP", $outroot);
-my $logDest = "$outroot.log";
-$logDest .= ".update" if $run_state eq "update";
+    defined $outroot and
+    defined $camera;
+#   and defined $run_state;
+
+my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $sky_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
+
+my $logDest = $ipprc->filename("LOG.EXP", $outroot);
+# $logDest .= ".update" if $run_state eq "update";
 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $sky_id, $PS_EXIT_SYS_ERROR ) if $redirect;
 
-my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_DIFF);
+# my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_STATICSKY);
 
 my $outbase = basename($outroot);
@@ -91,10 +94,7 @@
 }
 
-# XXX do we NEED to define the camera?
-# &my_die("Unable to identify camera", $sky_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless defined $camera;
-# $ipprc->define_camera($camera);
-
 # generate the input 
 print $listFile "INPUT   MULTI\n";
+my $nInputs = @$files;
 
 foreach my $file (@$files) {
@@ -103,4 +103,6 @@
     # XXX if we take the input from 'warp', we will need to make different selections here
     my $path_base = $file->{path_base};
+    print "input: $path_base\n";
+
     my $imageCnv  = $ipprc->filename("PPSTACK.OUTPUT",          $path_base ); # Image name
     my $maskCnv   = $ipprc->filename("PPSTACK.OUTPUT.MASK",     $path_base ); # Mask name
@@ -235,4 +237,5 @@
         # if ($run_state eq 'new') {
 	$command .= " -addresult -path_base $outroot";
+	$command .= " -num_inputs $nInputs";
 	$command .= " $cmdflags";
 	$command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
