- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/warp_skycell.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippScripts/scripts/warp_skycell.pl
r25518 r27838 7 7 use Sys::Hostname; 8 8 my $host = hostname(); 9 my $date = `date`; 9 10 print "\n\n"; 10 print "Starting script $0 on $host \n\n";11 print "Starting script $0 on $host at $date\n\n"; 11 12 12 13 use DateTime; … … 48 49 'threads=s' => \$threads, # Number of threads to use for pswarp 49 50 'run-state=s' => \$run_state, # 'new' or 'update' 50 'magicked '=> \$magicked, # input run has been magicked already?51 'magicked=s' => \$magicked, # input run has been magicked already? 51 52 'verbose' => \$verbose, # Print to stdout 52 53 'no-update' => \$no_update, # Don't update the database? … … 77 78 # Recipes to use based on reduction class 78 79 $reduction = 'DEFAULT' unless defined $reduction; 79 my $recipe_pswarp = $ipprc->reduction($reduction, 'WARP_PSWARP'); # Recipe to use for ppImage 80 unless ($recipe_pswarp) { 81 &my_die("Couldn't find selected reduction for WARP_PSWARP: $reduction\n", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR); 80 my $recipe_pswarp = $ipprc->reduction($reduction, 'WARP_PSWARP'); # Recipe to use 81 my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use 82 unless ($recipe_pswarp and $recipe_psastro) { 83 &my_die("Couldn't find selected reduction: $reduction\n", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_CONFIG_ERROR); 82 84 } 83 85 … … 121 123 $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE'); 122 124 } 125 126 my $dynamicMasks; # Use dynamic masks? 127 { 128 # Get the PSASTRO recipe 129 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 130 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 131 run(command => $command, verbose => $verbose); 132 unless ($success) { 133 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 134 &my_die("Unable to perform ppConfigDump: $error_code", $warp_id, $PS_EXIT_CONFIG_ERROR); 135 } 136 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 137 &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_CONFIG_ERROR); 138 139 $dynamicMasks = metadataLookupBool($recipeData, 'REFSTAR_MASK'); 140 } 141 123 142 124 143 my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outroot, $skycell_id ); … … 154 173 my $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name 155 174 156 my $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $imfile->{cam_path_base}, $imfile->{class_id});# Mask name157 if ( !$ipprc->file_exists($mask)) {158 print "Celestial mask $mask not found, using basic mask\n";159 $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name160 &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask);175 my $mask; # Mask name 176 if ($dynamicMasks) { 177 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $imfile->{cam_path_base}, $imfile->{class_id}); 178 } else { 179 $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $imfile->{chip_path_base}, $imfile->{class_id}); 161 180 } 162 181 163 182 &my_die("Couldn't find input file: $image", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($image); 183 &my_die("Couldn't find input file: $weight", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($weight); 184 &my_die("Couldn't find input file: $mask", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($mask); 164 185 165 186 # Astrometry file: astrometry is done at the camera stage, and always results in a MEF file … … 243 264 # Check first for the stats file 244 265 my $outputStatsReal = $ipprc->file_resolve($outputStats); 245 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;266 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStatsReal); 246 267 &my_die("Stats file has zero size: $outputStats", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless -s $outputStatsReal; 247 268 … … 267 288 &my_die("Couldn't find expected output file: $outputSources", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputSources); 268 289 &my_die("Couldn't find expected output file: $outputPSF", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) if metadataLookupBool($recipe, 'PSF') and not $ipprc->file_exists($outputPSF); 290 if ($run_state eq 'new') { 291 &my_die("Couldn't find expected output file: $configuration", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($configuration); 292 } 269 293 } 270 294 … … 276 300 $command .= " -tess_id $tess_dir"; 277 301 $command .= " -path_base $outroot"; # needed for logfile lookups 278 $command .= " - magicked" if $magicked;302 $command .= " -set_magicked $magicked" if $magicked; 279 303 280 304 $command .= " -uri $outputImage" if !$quality; … … 298 322 $command .= " -warp_id $warp_id"; 299 323 $command .= " -skycell_id $skycell_id"; 324 $command .= " -set_magicked $magicked" if $magicked; 300 325 $command .= " -dbname $dbname" if defined $dbname; 301 326
Note:
See TracChangeset
for help on using the changeset viewer.
