Changeset 10544 for trunk/ippScripts/scripts
- Timestamp:
- Dec 7, 2006, 4:20:08 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_resid.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_resid.pl
r10534 r10544 20 20 21 21 my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend, 22 $input_uri, $camera, $ no_update);22 $input_uri, $camera, $mode, $no_update); 23 23 GetOptions( 24 24 'det_id|d=s' => \$det_id, … … 30 30 'input_uri|u=s' => \$input_uri, 31 31 'camera|c=s' => \$camera, 32 'no-update' => \$no_update 32 'mode|m=s' => \$mode, 33 'no-update' => \$no_update, 33 34 ) or pod2usage( 2 ); 34 35 35 36 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 36 37 pod2usage( 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)", 38 39 -exitval => 3, 39 40 ) unless defined $det_id … … 42 43 and defined $class_id 43 44 and defined $det_type 44 and defined $detrend45 45 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'); 47 49 48 50 $ipprc->define_camera($camera); … … 50 52 # Recipes to use, as a function of the detrend type 51 53 use 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 }, 57 68 }; 58 69 … … 76 87 77 88 # Recipe to use in processing 78 my $recipe = RECIPES->{$det_type}; 89 die "Unrecognised mode: $mode\n" if not defined RECIPES->{$mode}; 90 my $recipe = RECIPES->{$mode}->{$det_type}; 79 91 die "Unrecognised detrend type: $det_type\n" if not defined $recipe; 80 # Detrend to use in processing81 my $detFlag = DETRENDS->{$det_type};82 die "Unrecognised detrend type: $det_type\n" if not defined $detFlag;83 92 84 93 ### Output file names --- must match camera configuration! … … 99 108 { 100 109 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 102 119 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 103 120 run(command => $command, verbose => 1);
Note:
See TracChangeset
for help on using the changeset viewer.
