IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2006, 4:20:08 PM (20 years ago)
Author:
Paul Price
Message:

Adding mode parameter, to allow "verify" mode.

File:
1 edited

Legend:

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

    r10534 r10544  
    2020
    2121my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
    22         $input_uri, $camera, $no_update);
     22        $input_uri, $camera, $mode, $no_update);
    2323GetOptions(
    2424    'det_id|d=s'        => \$det_id,
     
    3030    'input_uri|u=s'     => \$input_uri,
    3131    'camera|c=s'        => \$camera,
    32     'no-update'         => \$no_update
     32    'mode|m=s'          => \$mode,
     33    'no-update'         => \$no_update,
    3334) or pod2usage( 2 );
    3435
    3536pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3637pod2usage(
    37     -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --camera --input_uri",
     38    -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --camera --input_uri --mode --detrend (not for 'verify' mode)",
    3839    -exitval => 3,
    3940) unless defined $det_id
     
    4243    and defined $class_id
    4344    and defined $det_type
    44     and defined $detrend
    4545    and defined $input_uri
    46     and defined $camera;
     46    and defined $camera
     47    and defined $mode
     48    and (defined $detrend or lc($mode) eq 'verify');
    4749
    4850$ipprc->define_camera($camera);
     
    5052# Recipes to use, as a function of the detrend type
    5153use constant RECIPES => {
    52     'bias' => 'PPIMAGE_B',      # Bias only
    53     'dark' => 'PPIMAGE_D',      # Dark only
    54     'shutter' => 'PPIMAGE_S',   # Shutter only
    55     'flat' => 'PPIMAGE_F',      # Flat-field only
    56     'fringe' => 'PPIMAGE_R',    # Fringe only
     54    'master' => {               # We're creating a master --- already processed the input
     55        'bias' => 'PPIMAGE_B',  # Bias only
     56        'dark' => 'PPIMAGE_D',  # Dark only
     57        'shutter' => 'PPIMAGE_S',       # Shutter only
     58        'flat' => 'PPIMAGE_F',  # Flat-field only
     59        'fringe' => 'PPIMAGE_R',        # Fringe only
     60    },
     61    'verify' => {               # We're checking the master --- input is not already processed
     62        'bias' => 'PPIMAGE_OB', # Bias only
     63        'dark' => 'PPIMAGE_OBD',        # Dark only
     64        'shutter' => 'PPIMAGE_OBDS',    # Shutter only
     65        'flat' => 'PPIMAGE_OBDSF',      # Flat-field only
     66        'fringe' => 'PPIMAGE_OBDSFR',   # Fringe only
     67    },
    5768};
    5869
     
    7687
    7788# Recipe to use in processing
    78 my $recipe = RECIPES->{$det_type};
     89die "Unrecognised mode: $mode\n" if not defined RECIPES->{$mode};
     90my $recipe = RECIPES->{$mode}->{$det_type};
    7991die "Unrecognised detrend type: $det_type\n" if not defined $recipe;
    80 # Detrend to use in processing
    81 my $detFlag = DETRENDS->{$det_type};
    82 die "Unrecognised detrend type: $det_type\n" if not defined $detFlag;
    8392
    8493### Output file names --- must match camera configuration!
     
    99108{
    100109    my $command = "$ppImage -file $input_uri $outputRoot -recipe PPIMAGE $recipe" .
    101         " -stat $outputStats $detFlag $detrend"; # Command to run ppImage
     110        " -stat $outputStats "; # Command to run ppImage
     111
     112    # Detrend to use in processing
     113    if (lc($mode) ne 'verify') {
     114        my $detFlag = DETRENDS->{$det_type};
     115        die "Unrecognised detrend type: $det_type\n" if not defined $detFlag;
     116        $command .= "$detFlag $detrend";
     117    }
     118
    102119    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    103120        run(command => $command, verbose => 1);
Note: See TracChangeset for help on using the changeset viewer.