Index: trunk/ippScripts/scripts/publish_file.pl
===================================================================
--- trunk/ippScripts/scripts/publish_file.pl	(revision 24957)
+++ trunk/ippScripts/scripts/publish_file.pl	(revision 25072)
@@ -39,10 +39,9 @@
 
 # Parse the command-line arguments
-my ( $pub_id, $exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );
+my ( $pub_id, $camera, $stage, $stage_id, $format, $product, $workdir );
 my ( $dbname, $verbose, $no_update, $save_temps, $redirect );
 
 GetOptions(
     'pub_id=s'          => \$pub_id, # Publish identifier
-    'exp_id=s'          => \$exp_id, # Exposure identifier
     'camera=s'          => \$camera, # Camera name
     'stage=s'           => \$stage,       # Stage of interest
@@ -58,8 +57,7 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --pub_id --exp_id --camera --stage --stage_id --product --workdir",
+pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir",
            -exitval => $PS_EXIT_CONFIG_ERROR) unless
     defined $pub_id and
-    defined $exp_id and
     defined $camera and
     defined $product and
@@ -68,5 +66,5 @@
     defined $workdir;
 
-my $outroot = "$workdir/$product.$pub_id.$exp_id"; # Output root name
+my $outroot = "$workdir/$product.$pub_id"; # Output root name
 
 my $ipprc = PS::IPP::Config->new( $camera ) or
@@ -83,4 +81,5 @@
 my %files;                      # Input filenames
 my %zp;                         # Zero points
+my %exp_id;                     # Exposure identifiers
 {
     my $command;                # Command to run
@@ -119,8 +118,11 @@
             $zp{"$skycell_id.pos"} = $zp;
             $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways};
+            $exp_id{"$skycell_id.pos"} = $comp->{exp1};
+            $exp_id{"$skycell_id.neg"} = $comp->{exp2} if defined $comp->{bothways} and $comp->{bothways};
         } elsif ($stage eq 'camera') {
             my $cam_id = $comp->{cam_id};
             $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base );
             $zp{$cam_id} = $zp;
+            $exp_id{$cam_id} = $comp->{exp_id};
         }
     }
@@ -137,4 +139,5 @@
 
     my $zp = $zp{$comp};
+    my $exp_id = $exp_id{$comp};
     if ($product eq "IPP-MOPS") {
         my $outuri = "$outroot.$comp.fits";
@@ -142,5 +145,5 @@
             &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR);
 
-        my $command = "$ppMops $file $zp $out";
+        my $command = "$ppMops $file $zp $exp_id $out";
         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
             run(command => $command, verbose => $verbose);
