Index: trunk/ippScripts/scripts/camera_exp.pl
===================================================================
--- trunk/ippScripts/scripts/camera_exp.pl	(revision 14138)
+++ trunk/ippScripts/scripts/camera_exp.pl	(revision 14140)
@@ -138,4 +138,5 @@
 
 my $chipObjects; 
+my $chipObjectsExist = 0;
 foreach my $file (@$files) {
     # use the path_base as OUTPUT root and convert the filenames with ipprc->filename:
@@ -147,4 +148,9 @@
     print $list2File ($ipprc->filename("PPIMAGE.BIN2", $file->{path_base}, $class_id) . "\n");
     print $list3File ($chipObjects . "\n");
+
+     # if any of the output chip astrometry files exist, we can run psastro / addstar below
+    if ($ipprc->file_exists($chipObjects)) {
+	$chipObjectsExist = 1;
+    }
 }
 close $list1File;
@@ -168,37 +174,40 @@
 unless ($no_op) {
 
-    # run psastro +mosastro on the set of chips
-    # XXX note that this is wrong if imfiles are cells
-    # XXX add a ppStats call which will collect the astrometry stats
-    if (scalar @$files > 1) {
-	my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro " . 
-	    "-F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF";
-	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	    run(command => $command, verbose => 1);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform psastro: $error_code", $cam_id, $error_code);
-	}
-    } else {
-	$ipprc->file_copy($chipObjects, $fpaObjects) unless $chipObjects eq $fpaObjects;
-    }
-    &my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);
-
-    # run addstar on either the single chip output or the single fpa output
-    # XXX this construct requires the user to have a valid .ptolemyrc 
-    # XXX which in turn points at ippconfig/dvo.site
-    {
-	my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
-	my $command = "addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects);
-	
-	if (defined $dvodbReal) {
-	    $command .= " -D CATDIR $dvodbReal";
-	}
-
-	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-	    run(command => $command, verbose => 1);
-	unless ($success) {
-	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
+    # only run psastro / addstar if any of the output chip astrometry files exist
+    if ($chipObjectsExist) {
+	# run psastro +mosastro on the set of chips or copy the chipObjects to fpaObjects
+	# XXX note that this is wrong if imfiles are cells
+	# XXX add a ppStats call which will collect the astrometry stats
+	if (scalar @$files > 1) {
+	    my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro " . 
+		"-F PSASTRO.OUTPUT PSASTRO.OUTPUT.MEF";
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => 1);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform psastro: $error_code", $cam_id, $error_code);
+	    }
+	} else {
+	    $ipprc->file_copy($chipObjects, $fpaObjects) unless $chipObjects eq $fpaObjects;
+	}
+	&my_die("Unable to find expected output file: $fpaObjects", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($fpaObjects);
+
+	# run addstar on either the single chip output or the single fpa output
+	# XXX this construct requires the user to have a valid .ptolemyrc 
+	# XXX which in turn points at ippconfig/dvo.site
+	{
+	    my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
+	    my $command = "addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects);
+	    
+	    if (defined $dvodbReal) {
+		$command .= " -D CATDIR $dvodbReal";
+	    }
+
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => 1);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
+	    }
 	}
     }
