Index: trunk/ippScripts/scripts/calibrate_dvo.pl
===================================================================
--- trunk/ippScripts/scripts/calibrate_dvo.pl	(revision 15314)
+++ trunk/ippScripts/scripts/calibrate_dvo.pl	(revision 16276)
@@ -36,8 +36,8 @@
 use Pod::Usage qw( pod2usage );
 
-my ($dvo_id, $catdir, $region, $dbname, $workdir, $no_update, $no_op);
+my ($cal_id, $dvodb, $region, $dbname, $workdir, $no_update, $no_op);
 GetOptions(
-    'dvo_id|i=s'       => \$dvo_id,
-    'catdir|c=s'       => \$catdir,
+    'cal_id|i=s'       => \$cal_id,
+    'dvodb|c=s'        => \$dvodb,
     'region|r=s'       => \$region,
     'dbname|d=s'       => \$dbname,# Database name
@@ -48,8 +48,8 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --dvo_id --catdir --region",
+pod2usage( -msg => "Required options: --cal_id --dvodb --region",
            -exitval => 3) unless
-    defined $dvo_id and
-    defined $catdir and
+    defined $cal_id and
+    defined $dvodb and
     defined $region;
 
@@ -78,5 +78,5 @@
 {
     my $command = "$addstar -resort";
-    $command .= "-D CATDIR $catdir";
+    $command .= "-D CATDIR $dvodb";
     $command .= "-region $RAs $RAe $DECs $DECe";
 
@@ -86,5 +86,5 @@
     unless ($success) { 
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RESORT", $status, $dbname);
+        &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RESORT", $status, $dbname);
     }
 }
@@ -94,5 +94,5 @@
     foreach my $filter (@filters) {
 	my $command = "$relphot $filter";
-	$command .= "-D CATDIR $catdir";
+	$command .= "-D CATDIR $dvodb";
 	$command .= "-region $RAs $RAe $DECs $DECe";
 
@@ -102,5 +102,5 @@
 	unless ($success) { 
 	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);
+	    &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELPHOT", $status, $dbname);
 	}
     }
@@ -112,5 +112,5 @@
     foreach my $filter (@filters) {
 	my $command = "$uniphot $filter";
-	$command .= "-D CATDIR $catdir";
+	$command .= "-D CATDIR $dvodb";
 	$command .= "-region $RAs $RAe $DECs $DECe";
 
@@ -120,5 +120,5 @@
 	unless ($success) { 
 	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	    &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname);
+	    &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "UNIPHOT", $status, $dbname);
 	}
     }
@@ -127,5 +127,5 @@
 {
     my $command = "$relastro -objects";
-    $command .= "-D CATDIR $catdir";
+    $command .= "-D CATDIR $dvodb";
     $command .= "-region $RAs $RAe $DECs $DECe";
 
@@ -135,5 +135,5 @@
     unless ($success) { 
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
+	&my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.OBJECTS", $status, $dbname);
     }
 }
@@ -141,5 +141,5 @@
 {
     my $command = "$relastro -images";
-    $command .= "-D CATDIR $catdir";
+    $command .= "-D CATDIR $dvodb";
     $command .= "-region $RAs $RAe $DECs $DECe";
 
@@ -149,13 +149,13 @@
     unless ($success) { 
 	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-	&my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);
-    }
-}
-
-my $command = "$caltool -addcalrun";
-$command .= " -dvo_id $dvo_id";
+	&my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.IMAGES", $status, $dbname);
+    }
+}
+
+my $command = "$caltool -addrun";
+$command .= " -cal_id $cal_id";
 $command .= " -region $region";
 $command .= " -last_step RELASTRO.IMAGES";
-$command .= " -status SUCCESS";
+$command .= " -state 0";
 $command .= " -dbname $dbname" if defined $dbname;
 
@@ -176,5 +176,5 @@
 {
     my $msg = shift; # Warning message on die
-    my $dvo_id    = shift;
+    my $cal_id    = shift;
     my $region    = shift;
     my $last_step = shift;
@@ -183,10 +183,10 @@
 
     carp($msg);
-    if ($dvo_id && $region && $last_step && $status and not $no_update) {
+    if ($cal_id && $region && $last_step && $status and not $no_update) {
         my $command = "$caltool -addcalrun";
-	$command .= " -dvo_id $dvo_id";
+	$command .= " -cal_id $cal_id";
         $command .= " -region $region";
 	$command .= " -last_step $last_step";
-	$command .= " -status $status";
+	$command .= " -state $status";
         $command .= " -dbname $dbname" if defined $dbname;
         system ($command);
