Changeset 16276 for trunk/ippScripts/scripts/calibrate_dvo.pl
- Timestamp:
- Feb 1, 2008, 1:43:05 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/calibrate_dvo.pl (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/calibrate_dvo.pl
r15314 r16276 36 36 use Pod::Usage qw( pod2usage ); 37 37 38 my ($ dvo_id, $catdir, $region, $dbname, $workdir, $no_update, $no_op);38 my ($cal_id, $dvodb, $region, $dbname, $workdir, $no_update, $no_op); 39 39 GetOptions( 40 ' dvo_id|i=s' => \$dvo_id,41 ' catdir|c=s' => \$catdir,40 'cal_id|i=s' => \$cal_id, 41 'dvodb|c=s' => \$dvodb, 42 42 'region|r=s' => \$region, 43 43 'dbname|d=s' => \$dbname,# Database name … … 48 48 49 49 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 50 pod2usage( -msg => "Required options: -- dvo_id --catdir--region",50 pod2usage( -msg => "Required options: --cal_id --dvodb --region", 51 51 -exitval => 3) unless 52 defined $ dvo_id and53 defined $ catdirand52 defined $cal_id and 53 defined $dvodb and 54 54 defined $region; 55 55 … … 78 78 { 79 79 my $command = "$addstar -resort"; 80 $command .= "-D CATDIR $ catdir";80 $command .= "-D CATDIR $dvodb"; 81 81 $command .= "-region $RAs $RAe $DECs $DECe"; 82 82 … … 86 86 unless ($success) { 87 87 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 88 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $ dvo_id, $region, "RESORT", $status, $dbname);88 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RESORT", $status, $dbname); 89 89 } 90 90 } … … 94 94 foreach my $filter (@filters) { 95 95 my $command = "$relphot $filter"; 96 $command .= "-D CATDIR $ catdir";96 $command .= "-D CATDIR $dvodb"; 97 97 $command .= "-region $RAs $RAe $DECs $DECe"; 98 98 … … 102 102 unless ($success) { 103 103 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 104 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $ dvo_id, $region, "RELPHOT", $status, $dbname);104 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELPHOT", $status, $dbname); 105 105 } 106 106 } … … 112 112 foreach my $filter (@filters) { 113 113 my $command = "$uniphot $filter"; 114 $command .= "-D CATDIR $ catdir";114 $command .= "-D CATDIR $dvodb"; 115 115 $command .= "-region $RAs $RAe $DECs $DECe"; 116 116 … … 120 120 unless ($success) { 121 121 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 122 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $ dvo_id, $region, "UNIPHOT", $status, $dbname);122 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "UNIPHOT", $status, $dbname); 123 123 } 124 124 } … … 127 127 { 128 128 my $command = "$relastro -objects"; 129 $command .= "-D CATDIR $ catdir";129 $command .= "-D CATDIR $dvodb"; 130 130 $command .= "-region $RAs $RAe $DECs $DECe"; 131 131 … … 135 135 unless ($success) { 136 136 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 137 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $ dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);137 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.OBJECTS", $status, $dbname); 138 138 } 139 139 } … … 141 141 { 142 142 my $command = "$relastro -images"; 143 $command .= "-D CATDIR $ catdir";143 $command .= "-D CATDIR $dvodb"; 144 144 $command .= "-region $RAs $RAe $DECs $DECe"; 145 145 … … 149 149 unless ($success) { 150 150 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 151 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $ dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);152 } 153 } 154 155 my $command = "$caltool -add calrun";156 $command .= " - dvo_id $dvo_id";151 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $cal_id, $region, "RELASTRO.IMAGES", $status, $dbname); 152 } 153 } 154 155 my $command = "$caltool -addrun"; 156 $command .= " -cal_id $cal_id"; 157 157 $command .= " -region $region"; 158 158 $command .= " -last_step RELASTRO.IMAGES"; 159 $command .= " -stat us SUCCESS";159 $command .= " -state 0"; 160 160 $command .= " -dbname $dbname" if defined $dbname; 161 161 … … 176 176 { 177 177 my $msg = shift; # Warning message on die 178 my $ dvo_id = shift;178 my $cal_id = shift; 179 179 my $region = shift; 180 180 my $last_step = shift; … … 183 183 184 184 carp($msg); 185 if ($ dvo_id && $region && $last_step && $status and not $no_update) {185 if ($cal_id && $region && $last_step && $status and not $no_update) { 186 186 my $command = "$caltool -addcalrun"; 187 $command .= " - dvo_id $dvo_id";187 $command .= " -cal_id $cal_id"; 188 188 $command .= " -region $region"; 189 189 $command .= " -last_step $last_step"; 190 $command .= " -stat us$status";190 $command .= " -state $status"; 191 191 $command .= " -dbname $dbname" if defined $dbname; 192 192 system ($command);
Note:
See TracChangeset
for help on using the changeset viewer.
