Changeset 35118 for trunk/ippScripts/scripts/background_chip.pl
- Timestamp:
- Feb 7, 2013, 1:40:20 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/background_chip.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/background_chip.pl
r34422 r35118 14 14 use DateTime; 15 15 my $mjd_start = DateTime->now->mjd; # MJD of starting script 16 use File::Basename; 16 17 17 18 use vars qw( $VERSION ); … … 123 124 my $in_image = $ipprc->filename("PPIMAGE.CHIP", $in_path, $class_id); 124 125 my $in_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $in_path, $class_id); 126 my $in_wt = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $in_path, $class_id); 125 127 my $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id); 126 128 my $in_pattern = $ipprc->filename("PPIMAGE.PATTERN", $in_path, $class_id); … … 148 150 } 149 151 152 # XXX: M31 TEST turn off restoring pattern correction 153 $apply_pattern = 0; 154 150 155 # Set up files 151 156 &my_die("Couldn't find input file: $in_image\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_image); 152 157 &my_die("Couldn't find input file: $in_mask\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_mask); 158 &my_die("Couldn't find input file: $in_wt\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_wt); 153 159 &my_die("Couldn't find input file: $in_bg\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_bg) or !$apply_bg; 154 160 &my_die("Couldn't find input file: $in_pattern\n", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($in_pattern) or !$apply_pattern; … … 163 169 my $out_image = prepare_output("PPBACKGROUND.OUTPUT", $outroot, $class_id, 1); 164 170 my $out_mask = prepare_output("PPBACKGROUND.OUTPUT.MASK", $outroot, $class_id, 1); 171 my $out_wt = prepare_output("PPBACKGROUND.OUTPUT.VARIANCE", $outroot, $class_id, 1); 165 172 my $out_stats = prepare_output("PPBACKGROUND.STATS", $outroot, $class_id, 1); 166 173 my $out_config = prepare_output("PPBACKGROUND.CONFIG", $outroot, $class_id, 1); 167 174 my $traceDest = prepare_output("TRACE.IMFILE", $outroot, $class_id, 1); 175 176 my $auxmask; 177 178 my $apply_auxiliary_mask = 1; 179 if ($apply_auxiliary_mask) { 180 my @auxmask_start_date = qw( 181 0000 182 5178 183 5218 184 5403 185 5424 186 5455 187 5485 188 5512 189 5545 190 5770 191 5797 192 5825 193 5854 194 5881 195 6138 196 6153 197 6197 198 6214 199 ); 200 my @auxmask_end_date = qw( 201 5177 202 5217 203 5402 204 5423 205 5454 206 5484 207 5511 208 5544 209 5769 210 5796 211 5824 212 5853 213 5880 214 6137 215 6152 216 6196 217 6213 218 9999 219 ); 220 221 my $outroot_base = basename($outroot); 222 223 # Assume that outroot base begins with exp_name: fix by passing in exp_name 224 my $mjd = substr($outroot_base, 1, 4); 225 if ($mjd =~ /\D/) { 226 my $error_code = 1; 227 &my_die("unexpected outroot base: $outroot_base: $error_code", $chip_bg_id, $class_id, $error_code); 228 } 229 230 my $i = 0; 231 while ($auxmask_end_date[$i] < $mjd) { 232 $i++; 233 } 234 235 my $auxmask_base = "/data/ipp064.0/bills/m31-masks/www.usm.uni-muenchen.de/people/arri/PAndromeda/masks_fits/mask"; 236 237 $auxmask = sprintf "%s_%04d-%04d_%s.fits", $auxmask_base, $auxmask_start_date[$i], $auxmask_end_date[$i], $class_id; 238 print "Auxililary mask file is $auxmask\n"; 239 } 240 241 242 168 243 169 244 # Run ppImage … … 172 247 $command .= " -image $in_image"; 173 248 $command .= " -mask $in_mask"; 249 $command .= " -variance $in_wt"; 250 $command .= " -auxmask $auxmask" if $auxmask; 174 251 $command .= " -stats $out_stats" if $do_stats; 175 252 $command .= " -background $in_bg" if $apply_bg;
Note:
See TracChangeset
for help on using the changeset viewer.
