IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23548


Ignore:
Timestamp:
Mar 26, 2009, 9:01:47 AM (17 years ago)
Author:
eugene
Message:

test for USE.DEBURNED.IMAGE and deburned = 1; use alternate deburned image name

File:
1 edited

Legend:

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

    r23395 r23548  
    3535}
    3636
     37my @ARGS = @ARGV;
     38
    3739# Parse the command-line arguments
    3840my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
    39      $no_update, $no_op, $redirect, $magicked );
     41     $no_update, $no_op, $redirect, $magicked, $deburned );
    4042GetOptions(
    4143    'exp_id=s'          => \$exp_id,    # Exposure identifier
     
    4951    'reduction=s'       => \$reduction, # Reduction class
    5052    'run-state=s'       => \$run_state, # current state of the run (new, update)
    51     'magicked'          => \$magicked,  # magicked state of intput file
     53    'magicked'          => \$magicked,  # magicked state of input file
     54    'deburned=s'        => \$deburned,  # does deburned image exist?
    5255    'threads=s'         => \$threads,   # Number of threads to use for ppImage
    5356    'verbose'           => \$verbose,   # Print to stdout
     
    7881    print STDOUT "\n\n";
    7982    print STDOUT "Starting script $0 on $host\n\n";
    80     print STDOUT "COMMAND IS: @ARGV\n\n";
     83    print STDOUT "FULL COMMAND: $0 @ARGS\n\n";
    8184}
    8285
     
    124127    my $command;
    125128    my $do_stats;
     129
     130    ## get the ppImage recipe for this camera and CHIP reduction
     131    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
     132    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     133        run(command => $command, verbose => $verbose);
     134    unless ($success) {
     135        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     136        &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     137    }
     138    my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
     139        &my_die("Unable to parse metadata config doc", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     140
     141    ## XXX make the feature more general?
     142    my $useDeburnedImage = metadataLookupBool($recipeData, 'USE.DEBURNED.IMAGE');
     143    if ($useDeburnedImage && $deburned) {
     144        $uri =~ s/fits$/burn.tbl/;
     145        &my_die("Couldn't find deburned input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri);
     146    }
    126147
    127148    if ($run_state eq "new") {
     
    151172    }
    152173
    153     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     174    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    154175        run(command => $command, verbose => $verbose);
    155176    unless ($success) {
     
    157178        &my_die("Unable to perform ppImage: $error_code", $exp_id, $chip_id, $class_id, $error_code);
    158179    }
    159 
    160     ## get the ppImage recipe for this camera and CHIP reduction
    161     $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
    162     ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    163         run(command => $command, verbose => $verbose);
    164     unless ($success) {
    165         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    166         &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    167     }
    168     my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
    169         &my_die("Unable to parse metadata config doc", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    170180
    171181    ## allow the output images to be optional, depending on the recipe / reduction class
Note: See TracChangeset for help on using the changeset viewer.