IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20369


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.

Location:
trunk/ippScripts/scripts
Files:
3 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}
  • trunk/ippScripts/scripts/diff_skycell.pl

    r20338 r20369  
    2727use Pod::Usage qw( pod2usage );
    2828
    29 my ($diff_id, $dbname, $threads, $outroot, $verbose, $no_update, $no_op, $redirect);
     29my ($diff_id, $dbname, $threads, $outroot, $reduction, $verbose, $no_update, $no_op, $redirect);
    3030GetOptions(
    3131    'diff_id|d=s'       => \$diff_id, # Diff identifier
     
    3333    'threads=s'         => \$threads,   # Number of threads to use
    3434    'outroot=s'         => \$outroot, # Output root name
     35    'reduction=s'       => \$reduction, # Reduction class
    3536    'verbose'           => \$verbose,   # Print to stdout
    3637    'no-update'         => \$no_update, # Don't update the database?
     
    6061    warn("Can't find required tools.");
    6162    exit($PS_EXIT_CONFIG_ERROR);
     63}
     64
     65# Recipes to use based on reduction class
     66$reduction = 'DEFAULT' unless defined $reduction;
     67my $recipe_ppSub = $ipprc->reduction($reduction, 'DIFF_PPSUB'); # Recipe to use for ppSub
     68my $recipe_psphot  = $ipprc->reduction($reduction, 'DIFF_PSPHOT'); # Recipe to use for psphot
     69unless ($recipe_ppSub and $recipe_psphot) {
     70    &my_die("Couldn't find selected reduction for DIFF_PPSUB and DIFF_PSPHOT: $reduction\n", $diff_id, $PS_EXIT_CONFIG_ERROR);
    6271}
    6372
     
    192201    $command .= " -stats $outputStats";
    193202    $command .= " -threads $threads" if defined $threads;
     203    $command .= " -recipe PPSUB $recipe_ppSub";
     204    $command .= " -recipe PSPHOT $recipe_psphot";
    194205    $command .= " -recipe PPSTATS WARPSTATS";
    195206    $command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF";
  • trunk/ippScripts/scripts/stack_skycell.pl

    r20316 r20369  
    3030use Pod::Usage qw( pod2usage );
    3131
    32 my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $verbose, $no_update, $no_op, $redirect, $save_temps);
     32my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps);
    3333GetOptions(
    3434    'stack_id|d=s'      => \$stack_id, # Stack identifier
     
    3838    'debug'             => \$debug,   # Print to stdout
    3939    'threads=s'         => \$threads,   # Number of threads to use for ppStack
     40    'reduction=s'       => \$reduction, # Reduction class
    4041    'verbose'           => \$verbose,   # Print to stdout
    4142    'no-update'         => \$no_update, # Don't update the database?
     
    7475    warn("Can't find required tools.");
    7576    exit($PS_EXIT_CONFIG_ERROR);
     77}
     78
     79# Recipes to use based on reduction class
     80$reduction = 'DEFAULT' unless defined $reduction;
     81my $recipe_ppStack = $ipprc->reduction($reduction, 'STACK_PPSTACK'); # Recipe to use for ppStack
     82my $recipe_ppSub = $ipprc->reduction($reduction, 'STACK_PPSUB'); # Recipe to use for ppSub
     83my $recipe_psphot  = $ipprc->reduction($reduction, 'STACK_PSPHOT'); # Recipe to use for psphot
     84unless ($recipe_ppStack and $recipe_ppSub and $recipe_psphot) {
     85    &my_die("Couldn't find selected reduction for STACK_PPSTACK, STACK_PPSUB and STACK_PSPHOT: $reduction\n", $stack_id, $PS_EXIT_CONFIG_ERROR);
    7686}
    7787
     
    188198    my $command = "$ppStack $listName $outroot";
    189199    $command .= " -stats $outputStats" if $do_stats;;
    190     $command .= " -recipe PPSUB STACK";
     200    $command .= " -recipe PPSTACK $recipe_ppStack";
     201    $command .= " -recipe PPSUB $recipe_ppSub";
     202    $command .= " -recipe PSPHOT $recipe_psphot";
    191203    $command .= " -recipe PPSTATS WARPSTATS" if $do_stats;;
    192204    $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE";
Note: See TracChangeset for help on using the changeset viewer.