Index: trunk/ippScripts/scripts/background_warp.pl
===================================================================
--- trunk/ippScripts/scripts/background_warp.pl	(revision 35133)
+++ trunk/ippScripts/scripts/background_warp.pl	(revision 35134)
@@ -39,9 +39,10 @@
 
 my ($warp_bg_id, $skycell_id, $tess_dir, $reduction, $camera, $dbname, $outroot, $threads, $verbose, $no_update, $no_op, $redirect, $save_temps);
-my ($astrometry, $imageName, $maskName, $weightName, $magicked);
+my ($astrometry, $imageName, $maskName, $weightName, $magicked, $exp_tag, $alternate_astrometry_label);
 GetOptions(
     'warp_bg_id|i=s'      => \$warp_bg_id, # Warp identifier
     'skycell_id|s=s'      => \$skycell_id, # Skycell identifier
     'tess_dir|s=s'        => \$tess_dir, # Tesselation identifier
+    'exp_tag|=s'          => \$exp_tag, # exposure tag
     'camera|c=s'          => \$camera, # Camera name
     'dbname|d=s'          => \$dbname, # Database name
@@ -51,4 +52,5 @@
     'mask-list=s'         => \$maskName, # list of input mask files
     'astrometry=s'        => \$astrometry,
+    'alt_cam_label=s'     => \$alternate_astrometry_label,  # camRun.label for alternate astrometry
     'magicked=s'          => \$magicked,
     'threads=s'           => \$threads,   # Number of threads to use for pswarp
@@ -84,4 +86,9 @@
 }
 
+if ($alternate_astrometry_label) {
+    my_die( "--exp_tag is required when using alternate astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR )
+        unless defined $exp_tag;
+}
+
 my $ipprc = PS::IPP::Config->new( $camera ) or 
 my_die( "Unable to set up", $warp_bg_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
@@ -119,14 +126,9 @@
 my $tempOutRoot = "/tmp/background.warp.$warp_bg_id.$skycell_id";
 
-# XXX: get this from recipe
-my $alternate_astrometry_label = 'M31.test.20130206.bgsub';
-# XXX: get exp_id from command line
-my $exp_id = 196758;
-
 if (!defined $imageName) {
     # go find our inputs
     my $astrom_path_base;
     if (defined $alternate_astrometry_label) {
-        my $command = "$camtool -processedexp -exp_id $exp_id -label $alternate_astrometry_label";
+        my $command = "$camtool -processedexp -exp_tag $exp_tag -label $alternate_astrometry_label";
         $command .= " -dbname $dbname" if $dbname;
         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
