IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:08:50 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippScripts/scripts/register_imfile.pl

    r22428 r23352  
    2323use Math::Trig;
    2424
    25 my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2625use File::Spec;
    2726
     
    4948) or pod2usage( 2 );
    5049
    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;
     50my $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;
    5652
    5753pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    9894    print "STDOUT:\n$out1";
    9995    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;
    10197
    10298    print "[Running " . join(' ', @command2) . "]\n";
     
    107103    print "STDOUT:\n$out2";
    108104    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;
    110106    chomp $out2;
    111107    $cmdflags = $out2;
     
    132128
    133129# 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");
     130my $longitude = &value_for_flag($cmdflags, "-longitude");
     131my $latitude  = &value_for_flag($cmdflags, "-latitude");
     132my $elevation = &value_for_flag($cmdflags, "-elevation");
     133my $ra        = &value_for_flag($cmdflags, "-ra");
     134my $dec       = &value_for_flag($cmdflags, "-decl");
     135my $dateobs   = &value_for_flag($cmdflags, "-dateobs");
    140136
    141137# if the needed data is available, pass it to sunmoon:
     
    216212
    217213    # for failed imfiles, we insert UNKNOWN for inst, telescope, class_id
     214
     215    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
    218216
    219217    carp($msg);
     
    230228        $command .= " -hostname $host" if defined $host;
    231229        $command .= " -dbname $dbname" if defined $dbname;
    232         system ($command);
     230        print "Running: $command\n";
     231        system($command);
    233232    }
    234233    exit $exit_code;
Note: See TracChangeset for help on using the changeset viewer.