- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/register_imfile.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ippScripts/scripts/register_imfile.pl
r22428 r23352 23 23 use Math::Trig; 24 24 25 my $ipprc = PS::IPP::Config->new(); # IPP configuration26 25 use File::Spec; 27 26 … … 49 48 ) or pod2usage( 2 ); 50 49 51 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 52 $SIG{__DIE__} = sub { die @_ if $^S; 53 my_die( $_[0], $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_UNKNOWN_ERROR ); }; 54 55 $ipprc->redirect_output($logfile) if $logfile; 50 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 51 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_SYS_ERROR ) if $logfile; 56 52 57 53 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; … … 98 94 print "STDOUT:\n$out1"; 99 95 print "STDERR:\n$err1"; 100 &my_die("Unable to perform ppStats on exposure id $exp_id: " . $h1->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $h1->result() ) unless $result1;96 &my_die("Unable to perform ppStats on exposure id $exp_id: " . $h1->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h1->result() or $PS_EXIT_PROG_ERROR) ) unless $result1; 101 97 102 98 print "[Running " . join(' ', @command2) . "]\n"; … … 107 103 print "STDOUT:\n$out2"; 108 104 print "STDERR:\n$err2"; 109 &my_die("Unable to perform ppStatsFromMetadata on exposure id $exp_id: " . $h2->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $h2->result() ) unless $result2;105 &my_die("Unable to perform ppStatsFromMetadata on exposure id $exp_id: " . $h2->result(), $exp_id, $tmp_exp_name, $tmp_class_id, $uri, ($h2->result() or $PS_EXIT_PROG_ERROR) ) unless $result2; 110 106 chomp $out2; 111 107 $cmdflags = $out2; … … 132 128 133 129 # determine solar-system parameters 134 my $longitude = &value_for_flag ($cmdflags, "-longitude");135 my $latitude = &value_for_flag ($cmdflags, "-latitude");136 my $elevation = &value_for_flag ($cmdflags, "-elevation");137 my $ra = &value_for_flag ($cmdflags, "-ra");138 my $dec = &value_for_flag ($cmdflags, "-decl");139 my $dateobs = &value_for_flag ($cmdflags, "-dateobs");130 my $longitude = &value_for_flag($cmdflags, "-longitude"); 131 my $latitude = &value_for_flag($cmdflags, "-latitude"); 132 my $elevation = &value_for_flag($cmdflags, "-elevation"); 133 my $ra = &value_for_flag($cmdflags, "-ra"); 134 my $dec = &value_for_flag($cmdflags, "-decl"); 135 my $dateobs = &value_for_flag($cmdflags, "-dateobs"); 140 136 141 137 # if the needed data is available, pass it to sunmoon: … … 216 212 217 213 # for failed imfiles, we insert UNKNOWN for inst, telescope, class_id 214 215 $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code; 218 216 219 217 carp($msg); … … 230 228 $command .= " -hostname $host" if defined $host; 231 229 $command .= " -dbname $dbname" if defined $dbname; 232 system ($command); 230 print "Running: $command\n"; 231 system($command); 233 232 } 234 233 exit $exit_code;
Note:
See TracChangeset
for help on using the changeset viewer.
