Changeset 27718 for trunk/ippScripts/scripts/flatcorr_init.pl
- Timestamp:
- Apr 21, 2010, 11:35:15 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/flatcorr_init.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/flatcorr_init.pl
r20100 r27718 1 1 #!/usr/bin/env perl 2 2 3 ## USAGE:flatcorr_init.pl 3 ## USAGE:flatcorr_init.pl 4 4 ## given dbname, dvodb, filter, time range, camera, telescope, etc? 5 5 ## select matching images and register as a new flatcorr run … … 24 24 use Sys::Hostname; 25 25 my $host = hostname(); 26 my $date = `date`; 26 27 print "\n\n"; 27 print "Starting script $0 on $host \n\n";28 print "Starting script $0 on $host at $date\n\n"; 28 29 29 30 use vars qw( $VERSION ); … … 68 69 my $caltool = can_run('caltool') or (warn "Can't find caltool" and $missing_tools = 1); 69 70 70 if ($missing_tools) { 71 if ($missing_tools) { 71 72 warn ("Can't find required tools"); 72 exit($PS_EXIT_CONFIG_ERROR); 73 exit($PS_EXIT_CONFIG_ERROR); 73 74 } 74 75 … … 90 91 cache_run(command => $command, verbose => 1); 91 92 92 unless ($success) { 93 unless ($success) { 93 94 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 94 95 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RESORT", $status, $dbname); … … 99 100 { 100 101 foreach my $filter (@filters) { 101 my $command = "$relphot $filter";102 $command .= "-D CATDIR $catdir";103 $command .= "-region $RAs $RAe $DECs $DECe";104 105 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =106 cache_run(command => $command, verbose => 1);107 108 unless ($success) { 109 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);110 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname);111 }102 my $command = "$relphot $filter"; 103 $command .= "-D CATDIR $catdir"; 104 $command .= "-region $RAs $RAe $DECs $DECe"; 105 106 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 107 cache_run(command => $command, verbose => 1); 108 109 unless ($success) { 110 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 111 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELPHOT", $status, $dbname); 112 } 112 113 } 113 114 } … … 117 118 if (0) { 118 119 foreach my $filter (@filters) { 119 my $command = "$uniphot $filter";120 $command .= "-D CATDIR $catdir";121 $command .= "-region $RAs $RAe $DECs $DECe";122 123 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =124 cache_run(command => $command, verbose => 1);125 126 unless ($success) { 127 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);128 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname);129 }120 my $command = "$uniphot $filter"; 121 $command .= "-D CATDIR $catdir"; 122 $command .= "-region $RAs $RAe $DECs $DECe"; 123 124 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 125 cache_run(command => $command, verbose => 1); 126 127 unless ($success) { 128 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 129 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "UNIPHOT", $status, $dbname); 130 } 130 131 } 131 132 } … … 137 138 138 139 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 139 cache_run(command => $command, verbose => 1);140 141 unless ($success) { 142 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);143 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname);140 cache_run(command => $command, verbose => 1); 141 142 unless ($success) { 143 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 144 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.OBJECTS", $status, $dbname); 144 145 } 145 146 } … … 151 152 152 153 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 153 cache_run(command => $command, verbose => 1);154 155 unless ($success) { 156 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);157 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname);154 cache_run(command => $command, verbose => 1); 155 156 unless ($success) { 157 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 158 &my_die ("Unable to perform addstar -resort on region $region: $error_code", $dvo_id, $region, "RELASTRO.IMAGES", $status, $dbname); 158 159 } 159 160 } … … 185 186 my $region = shift; 186 187 my $last_step = shift; 187 my $status = shift;188 my $dbname = shift;188 my $status = shift; 189 my $dbname = shift; 189 190 190 191 carp($msg); 191 192 if (defined $dvo_id && defined $region && defined $last_step && defined $status and not $no_update) { 192 193 my $command = "$caltool -addcalrun"; 193 $command .= " -dvo_id $dvo_id";194 $command .= " -dvo_id $dvo_id"; 194 195 $command .= " -region $region"; 195 $command .= " -last_step $last_step";196 $command .= " -status $status";196 $command .= " -last_step $last_step"; 197 $command .= " -status $status"; 197 198 $command .= " -dbname $dbname" if defined $dbname; 198 199 system ($command);
Note:
See TracChangeset
for help on using the changeset viewer.
