IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 12, 2007, 9:36:26 AM (19 years ago)
Author:
eugene
Message:

make jpegs even if psastro fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/camera_exp.pl

    r14140 r14158  
    6363
    6464my $recipe1 = $ipprc->reduction($reduction, 'JPEG_BIN1'); # Recipe to use
    65 &my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     65&my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe1;
    6666
    6767my $recipe2 = $ipprc->reduction($reduction, 'JPEG_BIN2'); # Recipe to use
    68 &my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     68&my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe2;
    6969
    7070# values to extract from output metadata and the stats to calculate
     
    173173
    174174unless ($no_op) {
     175
     176    ## build the output JPEG images first so we get them even if the astrometry fails
     177
     178    # Make the jpeg for binning 1
     179    {
     180        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
     181        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     182            run(command => $command, verbose => 1);
     183        unless ($success) {
     184            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     185            &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
     186        }
     187        &my_die("Unable to find expected output file: $jpeg1", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg1);
     188    }
     189
     190    # Make the jpeg for binning 2
     191    {
     192        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
     193        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     194            run(command => $command, verbose => 1);
     195        unless ($success) {
     196            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     197            &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
     198        }
     199        &my_die("Unable to find expected output file: $jpeg2", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg2);
     200    }
    175201
    176202    # only run psastro / addstar if any of the output chip astrometry files exist
     
    196222        # XXX this construct requires the user to have a valid .ptolemyrc
    197223        # XXX which in turn points at ippconfig/dvo.site
    198         {
     224       
     225        # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
     226        # XXX this needs to be converted to addstar_client...
     227        if (defined $dvodbReal) {
    199228            my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
    200229            my $command = "addstar -D CAMERA $camdir " . $ipprc->file_resolve($fpaObjects);
    201            
    202             if (defined $dvodbReal) {
    203                 $command .= " -D CATDIR $dvodbReal";
    204             }
     230            $command .= " -D CATDIR $dvodbReal";
    205231
    206232            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    213239    }
    214240   
    215     # Make the jpeg for binning 1
    216     {
    217         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    218         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    219             run(command => $command, verbose => 1);
    220         unless ($success) {
    221             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    222             &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
    223         }
    224         &my_die("Unable to find expected output file: $jpeg1", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg1);
    225     }
    226 
    227     # Make the jpeg for binning 2
    228     {
    229         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    230         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    231             run(command => $command, verbose => 1);
    232         unless ($success) {
    233             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    234             &my_die("Unable to perform ppImage: $error_code", $cam_id, $error_code);
    235         }
    236         &my_die("Unable to find expected output file: $jpeg2", $cam_id, $PS_EXIT_PROG_ERROR) unless -f $ipprc->file_resolve($jpeg2);
    237     }
    238241}
    239242
     
    269272        my $command = "$camtool -addprocessedexp -cam_id $cam_id -code $exit_code";
    270273        $command .= " -dbname $dbname" if defined $dbname;
    271 ###        system ($command);
     274        system ($command);
    272275    }
    273276    exit $exit_code;
Note: See TracChangeset for help on using the changeset viewer.