Changeset 13552 for trunk/ippScripts/scripts/detrend_reject_imfile.pl
- Timestamp:
- May 30, 2007, 12:41:30 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/detrend_reject_imfile.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_reject_imfile.pl
r13275 r13552 60 60 $ipprc->define_camera($camera); 61 61 62 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs 63 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs 62 # Recipes to use, as a function of the detrend type 63 use constant RECIPES => { 64 'bin1' => { # We're creating a master --- already processed the input 65 'bias' => 'PPIMAGE_J1_RESID_B', # Bias only 66 'dark' => 'PPIMAGE_J1_RESID_B', # Dark only 67 'shutter' => 'PPIMAGE_J1_RESID_B', # Shutter only 68 'flat' => 'PPIMAGE_J1_RESID_F', # Flat-field only 69 'domeflat' => 'PPIMAGE_J1_RESID_F', # Flat-field only 70 'skyflat' => 'PPIMAGE_J1_RESID_F', # Flat-field only 71 'fringe' => 'PPIMAGE_J1_RESID_F', # Fringe only 72 }, 73 'bin2' => { # We're checking the master --- input is not already processed 74 'bias' => 'PPIMAGE_J2_RESID_B', # Bias only 75 'dark' => 'PPIMAGE_J2_RESID_B', # Dark only 76 'shutter' => 'PPIMAGE_J2_RESID_B', # Shutter only 77 'flat' => 'PPIMAGE_J2_RESID_F', # Flat-field only 78 'domeflat' => 'PPIMAGE_J2_RESID_F', # Flat-field only 79 'skyflat' => 'PPIMAGE_J2_RESID_F', # Flat-field only 80 'fringe' => 'PPIMAGE_J2_RESID_F', # Fringe only 81 }, 82 }; 64 83 65 84 # Look for programs we need … … 87 106 } 88 107 108 # XXX report an error message if stdout_buf is empty 109 89 110 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 90 111 &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR); 112 91 113 $files = parse_md_list($metadata) or 92 114 &my_die("Unable to parse metadata list", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR); 93 115 } 94 116 95 117 # XXX in debug mode, unlink = 0 96 118 my ($list1File, $list1Name) = tempfile( "$exp_tag.detresid.$det_id.$iter.b1.list.XXXX", UNLINK => 1 ); 97 119 my ($list2File, $list2Name) = tempfile( "$exp_tag.detresid.$det_id.$iter.b2.list.XXXX", UNLINK => 1 ); … … 118 140 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 119 141 142 # Recipes to use in processing 143 my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)}; 144 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1; 145 146 my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)}; 147 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2; 148 120 149 unless ($no_op) { 121 150 122 151 # Make the jpeg for binning 1 123 152 { 124 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run153 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run 125 154 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 126 155 run(command => $command, verbose => 1); … … 134 163 # Make the jpeg for binning 2 135 164 { 136 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run165 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run 137 166 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 138 167 run(command => $command, verbose => 1); … … 159 188 my $logFile; 160 189 unless ($no_op) { 190 # XXX this will fail if the file exists (because of Nebulous rules) 161 191 $logFile = $ipprc->file_create_open( $logName ); 162 192 } … … 298 328 299 329 unless ($no_update) { 300 my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag " .301 "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot "; # Command to run 330 my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_tag $exp_tag"; 331 $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot "; 302 332 $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; 303 333 $command .= ' -reject' if $reject;
Note:
See TracChangeset
for help on using the changeset viewer.
