Changeset 13552
- Timestamp:
- May 30, 2007, 12:41:30 PM (19 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 4 edited
-
detrend_norm_exp.pl (modified) (4 diffs)
-
detrend_process_exp.pl (modified) (4 diffs)
-
detrend_reject_imfile.pl (modified) (6 diffs)
-
detrend_resid.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/detrend_norm_exp.pl
r13275 r13552 56 56 $ipprc->define_camera($camera); 57 57 58 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs 59 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs 60 58 # Recipes to use, as a function of the detrend type 59 use constant RECIPES => { 60 'bin1' => { # We're creating a master --- already processed the input 61 'bias' => 'PPIMAGE_J1_IMAGE_B', # Bias only 62 'dark' => 'PPIMAGE_J1_IMAGE_B', # Dark only 63 'shutter' => 'PPIMAGE_J1_IMAGE_B', # Shutter only 64 'flat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 65 'domeflat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 66 'skyflat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 67 'fringe' => 'PPIMAGE_J1_IMAGE_F', # Fringe only 68 }, 69 'bin2' => { # We're checking the master --- input is not already processed 70 'bias' => 'PPIMAGE_J2_IMAGE_B', # Bias only 71 'dark' => 'PPIMAGE_J2_IMAGE_B', # Dark only 72 'shutter' => 'PPIMAGE_J2_IMAGE_B', # Shutter only 73 'flat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 74 'domeflat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 75 'skyflat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 76 'fringe' => 'PPIMAGE_J2_IMAGE_F', # Fringe only 77 }, 78 }; 61 79 62 80 # Look for programs we need … … 134 152 my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 135 153 154 # Recipes to use in processing 155 my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)}; 156 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1; 157 158 my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)}; 159 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2; 160 136 161 unless ($no_op) { 137 162 # Make the jpeg for binning 1 138 163 { 139 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run164 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run 140 165 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 141 166 run(command => $command, verbose => 1); … … 145 170 # Make the jpeg for binning 2 146 171 { 147 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run172 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run 148 173 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 149 174 run(command => $command, verbose => 1); … … 153 178 154 179 unless ($no_update) { 155 my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter " .156 "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " . 157 "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run 180 my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter"; 181 $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot "; 182 $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; 158 183 $command .= " -dbname $dbname" if defined $dbname; 159 184 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
trunk/ippScripts/scripts/detrend_process_exp.pl
r13275 r13552 56 56 $ipprc->define_camera($camera); 57 57 58 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs 59 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs 60 58 # Recipes to use, as a function of the detrend type 59 use constant RECIPES => { 60 'bin1' => { # We're creating a master --- already processed the input 61 'bias' => 'PPIMAGE_J1_IMAGE_B', # Bias only 62 'dark' => 'PPIMAGE_J1_IMAGE_B', # Dark only 63 'shutter' => 'PPIMAGE_J1_IMAGE_B', # Shutter only 64 'flat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 65 'domeflat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 66 'skyflat' => 'PPIMAGE_J1_IMAGE_F', # Flat-field only 67 'fringe' => 'PPIMAGE_J1_IMAGE_F', # Fringe only 68 }, 69 'bin2' => { # We're checking the master --- input is not already processed 70 'bias' => 'PPIMAGE_J2_IMAGE_B', # Bias only 71 'dark' => 'PPIMAGE_J2_IMAGE_B', # Dark only 72 'shutter' => 'PPIMAGE_J2_IMAGE_B', # Shutter only 73 'flat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 74 'domeflat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 75 'skyflat' => 'PPIMAGE_J2_IMAGE_F', # Flat-field only 76 'fringe' => 'PPIMAGE_J2_IMAGE_F', # Fringe only 77 }, 78 }; 61 79 62 80 # Look for programs we need … … 135 153 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 136 154 155 # Recipes to use in processing 156 my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)}; 157 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1; 158 159 my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)}; 160 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2; 161 137 162 unless ($no_op) { 138 163 # Make the jpeg for binning 1 139 164 { 140 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run165 my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run 141 166 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 142 167 run(command => $command, verbose => 1); … … 150 175 # Make the jpeg for binning 2 151 176 { 152 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run177 my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run 153 178 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 154 179 run(command => $command, verbose => 1); … … 162 187 163 188 unless ($no_update) { 164 my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .165 "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " . 166 "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run 189 my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag"; 190 $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot"; 191 $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; 167 192 $command .= " -dbname $dbname" if defined $dbname; 168 193 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
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; -
trunk/ippScripts/scripts/detrend_resid.pl
r13275 r13552 69 69 use constant RECIPES => { 70 70 'master' => { # We're creating a master --- already processed the input 71 'bias' => 'PPIMAGE_B', # Bias only72 'dark' => 'PPIMAGE_D', # Dark only73 'shutter' => 'PPIMAGE_S', # Shutter only74 'flat' => 'PPIMAGE_F', # Flat-field only71 'bias' => 'PPIMAGE_B', # Bias only 72 'dark' => 'PPIMAGE_D', # Dark only 73 'shutter' => 'PPIMAGE_S', # Shutter only 74 'flat' => 'PPIMAGE_F', # Flat-field only 75 75 'domeflat' => 'PPIMAGE_F', # Flat-field only 76 'skyflat' => 'PPIMAGE_F', # Flat-field only77 'fringe' => 'PPIMAGE_R', # Fringe only76 'skyflat' => 'PPIMAGE_F', # Flat-field only 77 'fringe' => 'PPIMAGE_R', # Fringe only 78 78 }, 79 79 'verify' => { # We're checking the master --- input is not already processed 80 'bias' => 'PPIMAGE_OB', # Bias only81 'dark' => 'PPIMAGE_OBD', # Dark only82 'shutter' => 'PPIMAGE_OBDS', # Shutter only83 'flat' => 'PPIMAGE_OBDSF', # Flat-field only80 'bias' => 'PPIMAGE_OB', # Bias only 81 'dark' => 'PPIMAGE_OBD', # Dark only 82 'shutter' => 'PPIMAGE_OBDS', # Shutter only 83 'flat' => 'PPIMAGE_OBDSF', # Flat-field only 84 84 'domeflat' => 'PPIMAGE_OBDSF', # Flat-field only 85 'skyflat' => 'PPIMAGE_OBDSF', # Flat-field only86 'fringe' => 'PPIMAGE_OBDSFR', # Fringe only85 'skyflat' => 'PPIMAGE_OBDSF', # Flat-field only 86 'fringe' => 'PPIMAGE_OBDSFR', # Fringe only 87 87 }, 88 88 }; … … 94 94 'shutter' => '-shutter', # Specify the shutter frame 95 95 'flat' => '-flat', # Specify the flat frame 96 'domeflat' => '-flat', # Specify the flat frame97 'skyflat' => '-flat', # Specify the flat frame96 'domeflat' => '-flat', # Specify the flat frame 97 'skyflat' => '-flat', # Specify the flat frame 98 98 'fringe' => '-fringe', # Specify the fringe frame 99 99 }; 100 101 100 102 101 use constant DELETE_STATS => 0; # Delete the statistics file when done?
Note:
See TracChangeset
for help on using the changeset viewer.
