Index: trunk/ippScripts/scripts/warp_overlap.pl
===================================================================
--- trunk/ippScripts/scripts/warp_overlap.pl	(revision 16310)
+++ trunk/ippScripts/scripts/warp_overlap.pl	(revision 16320)
@@ -38,8 +38,9 @@
 my $ipprc = PS::IPP::Config->new(); # IPP configuration
 
-my ($warp_id, $camera, $dbname, $workdir, $verbose, $no_update, $no_op);
+my ($warp_id, $camera, $tess_id, $dbname, $workdir, $verbose, $no_update, $no_op);
 GetOptions(
     'warp_id|i=s'       => \$warp_id, # Warp identifier
     'camera|c=s'        => \$camera, # Camera name
+    'tess_id=s'         => \$tess_id, # Tessellation identifier
     'dbname|d=s'        => \$dbname, # Database name
     'workdir|w=s'       => \$workdir, # Working directory, for output files
@@ -51,8 +52,9 @@
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
 pod2usage(
-    -msg => "Required options: --warp_id --camera --workdir",
+    -msg => "Required options: --warp_id --camera --tess_id --workdir",
     -exitval => 3,
 ) unless defined $warp_id
     and defined $camera
+    and defined $tess_id
     and defined $workdir;
 
@@ -113,57 +115,51 @@
 unless ($no_op) {
     # Calculate the overlaps between imfiles and skycells
-    
-    my $tessellations = $ipprc->tessellations(); # Hash of defined tessellations
-    foreach my $tess_id ( keys %$tessellations ) {
-	### Because DVO doesn't use psModules, it doesn't understand Nebulous --- check
-	my $scheme = file_scheme($$tessellations{$tess_id}); # The scheme, e.g., file, path, neb
-	if (defined $scheme and lc($scheme) eq 'neb') {
-	    &my_die("Tessellation $tess_id refers to a Nebulous path: $$tessellations{$tess_id}", $warp_id, $PS_EXIT_CONFIG_ERROR);
+
+    my $tess_dir = $ipprc->tessellation_catdir( $tess_id ); # Tessellation catdir for DVO
+    $tess_dir = $ipprc->convert_filename_absolute( $tess_dir );
+
+	
+    my %unique_skycells = (); # Identified skycells (all unique by virtue of hash property)
+    
+    # XXX this is a bit too hard wired: the concept is that astrometry comes from the MOSAIC vs CHIP output
+    if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
+	# We have a MEF astrometry file from psastro
+	my $imfile = $imfiles->[0];
+	my $camRoot = $imfile->{cam_path_base};
+	my $astromFile = $ipprc->filename($astromSource, $camRoot); # Astrometry file
+	
+	my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
+	if (! @matchlist) {
+	    &my_die("Unable to perform dvoImageOverlaps: missing astrometry", $warp_id, $PS_EXIT_DATA_ERROR);
+	}	    
+	# Match each of the imfiles to this list
+	foreach my $imfile (@$imfiles) {
+	    extract_overlaps(\@matchlist, $imfile, $astromFile, $tess_id, \@overlaps, \%unique_skycells);
 	}
-	
-	my $tess_dir = $ipprc->convert_filename_absolute( $$tessellations{$tess_id} ); # Catdir for DVO
-	
-	my %unique_skycells = (); # Identified skycells (all unique by virtue of hash property)
-	
-	# XXX this is a bit too hard wired: the concept is that astrometry comes from the MOSAIC vs CHIP output
-	if ($astromSource eq 'PSASTRO.OUTPUT.MEF') {
-	    # We have a MEF astrometry file from psastro
-	    my $imfile = $imfiles->[0];
-	    my $camRoot = $imfile->{cam_path_base};
-	    my $astromFile = $ipprc->filename($astromSource, $camRoot); # Astrometry file
+    } else {
+	# We have per-imfile astrometry
+	foreach my $imfile (@$imfiles) {
+	    my $astromFile;
+	    if ($astromSource eq 'PSASTRO.OUTPUT') {
+		my $chipRoot = $imfile->{chip_path_base};
+		my $classID = $imfile->{class_id};
+		$astromFile = $ipprc->filename($astromSource, $chipRoot, $classID); # Astrometry file
+	    } else {
+		$astromFile = $imfile->{chip_uri}; # Astrometry file
+	    }
+	    my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
+	    if (! @matchlist and $verbose) {
+		print "skipping $astromFile\n";
+	    }	    
 	    
-	    my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
-	    if (! @matchlist) {
-		&my_die("Unable to perform dvoImageOverlaps: missing astrometry", $warp_id, $PS_EXIT_DATA_ERROR);
-	    }	    
-	    # Match each of the imfiles to this list
-	    foreach my $imfile (@$imfiles) {
-		extract_overlaps(\@matchlist, $imfile, $astromFile, $tess_id, \@overlaps, \%unique_skycells);
-	    }
-	} else {
-	    # We have per-imfile astrometry
-	    foreach my $imfile (@$imfiles) {
-		my $astromFile;
-		if ($astromSource eq 'PSASTRO.OUTPUT') {
-		    my $chipRoot = $imfile->{chip_path_base};
-		    my $classID = $imfile->{class_id};
-		    $astromFile = $ipprc->filename($astromSource, $chipRoot, $classID); # Astrometry file
-		} else {
-		    $astromFile = $imfile->{chip_uri}; # Astrometry file
-		}
-		my @matchlist = get_overlaps($astromFile, $tess_dir, $astromAccept); # List of overlaps
-		if (! @matchlist and $verbose) {
-		    print "skipping $astromFile\n";
-		}	    
-
-		extract_overlaps(\@matchlist, $imfile, $astromFile, $tess_id, \@overlaps, \%unique_skycells);
-	    }
+	    extract_overlaps(\@matchlist, $imfile, $astromFile, $tess_id, \@overlaps, \%unique_skycells);
 	}
-
-	# Extract the skycells to images, used as warp templates.
-	my @skycells = keys %unique_skycells;
-	generate_skycells($ipprc, $tess_id, \@skycells, $workdir) or
-	    &my_die("Unable to generate skycells for tessellation $tess_id", $warp_id, $PS_EXIT_SYS_ERROR);
-    }
+    }
+    
+    # Extract the skycells to images, used as warp templates.
+    my @skycells = keys %unique_skycells;
+    generate_skycells($ipprc, $tess_id, \@skycells, $workdir) or
+	&my_die("Unable to generate skycells for tessellation $tess_id", $warp_id, $PS_EXIT_SYS_ERROR);
+    
 } else {
     # create an overlap with an entry for each skycell:imfile match
