IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2008, 2:56:13 PM (18 years ago)
Author:
Paul Price
Message:

Adding stage-dependent recipes; this is most important for psphot.

File:
1 edited

Legend:

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

    r20099 r20369  
    6464$ipprc->redirect_output($logDest) if $redirect;
    6565
    66 # Recipes to use based on reduction class
    67 # the CHIP recipe should not perform astrometry anymore (2008.04.08)
    68 
    69 $reduction = 'DEFAULT' unless defined $reduction;
    70 my $recipe = $ipprc->reduction($reduction, 'CHIP'); # Recipe to use
    71 unless ($recipe) {
    72     &my_die("Couldn't find selected reduction for CHIP: $reduction\n", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    73 }
    74 
    7566# Look for programs we need
    7667my $missing_tools;
     
    8475}
    8576
     77# Recipes to use based on reduction class
     78$reduction = 'DEFAULT' unless defined $reduction;
     79my $recipe_ppImage = $ipprc->reduction($reduction, 'CHIP_PPIMAGE'); # Recipe to use for ppImage
     80my $recipe_psphot  = $ipprc->reduction($reduction, 'CHIP_PSPHOT'); # Recipe to use for psphot
     81unless ($recipe_ppImage and $recipe_psphot) {
     82    &my_die("Couldn't find selected reduction for CHIP_PPIMAGE and CHIP_PSPHOT: $reduction\n", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
     83}
     84
    8685my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    8786
     
    120119    if ($run_state eq "new") {
    121120        $command  = "$ppImage -file $uri $outroot";
    122         $command .= " -recipe PPIMAGE $recipe";
     121        $command .= " -recipe PPIMAGE $recipe_ppImage";
     122        $command .= " -recipe PSPHOT $recipe_psphot";
    123123        $command .= " -threads $threads" if defined $threads;
    124124        $command .= " -dbname $dbname" if defined $dbname;
     
    147147
    148148    ## get the ppImage recipe for this camera and CHIP reduction
    149     $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe -";
     149    $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
    150150    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    151151        run(command => $command, verbose => $verbose);
     
    177177
    178178    if ($do_stats) {
    179         my $outputStatsReal = $ipprc->file_resolve($outputStats);
    180         &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;
    181 
    182         # measure chip stats
    183         $command = "$ppStatsFromMetadata $outputStatsReal - CHIP_IMFILE";
    184         ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    185             run(command => $command, verbose => $verbose);
    186         unless ($success) {
    187             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    188             &my_die("Unable to perform ppStatsFromMetadata: $error_code", $exp_id, $chip_id, $class_id, $error_code);
    189         }
    190         foreach my $line (@$stdout_buf) {
    191             $cmdflags .= " $line";
    192         }
    193         chomp $cmdflags;
     179        my $outputStatsReal = $ipprc->file_resolve($outputStats);
     180        &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;
     181
     182        # measure chip stats
     183        $command = "$ppStatsFromMetadata $outputStatsReal - CHIP_IMFILE";
     184        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     185            run(command => $command, verbose => $verbose);
     186        unless ($success) {
     187            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     188            &my_die("Unable to perform ppStatsFromMetadata: $error_code", $exp_id, $chip_id, $class_id, $error_code);
     189        }
     190        foreach my $line (@$stdout_buf) {
     191            $cmdflags .= " $line";
     192        }
     193        chomp $cmdflags;
    194194    }
    195195}
Note: See TracChangeset for help on using the changeset viewer.