Changeset 34756
- Timestamp:
- Nov 30, 2012, 6:54:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ippScripts/scripts/regenerate_background.pl
r34746 r34756 11 11 use File::Spec; 12 12 use PS::IPP::Config 1.01 qw( :standard ); 13 use Getopt::Long qw (GetO tions :config auto_help auto_version gnu_getopt );13 use Getopt::Long qw (GetOptions :config auto_help auto_version gnu_getopt ); 14 14 use Pod::Usage qw( pod2usage ); 15 15 16 my $ppConfigDump = can_run('ppConfigDump'); 17 my $pswarp = can_run('pswarp'); 16 18 17 19 # Parse command line options. 18 my ($stage, $camera, $stage_id, $ dbname, $verbose, $logfile);20 my ($stage, $camera, $stage_id, $skycell_id, $dbname, $verbose, $logfile, $save_temps); 19 21 GetOptions('stage=s' => \$stage, # which analysis stage to generate bkg model 20 22 'camera|i=s' => \$camera, # user-supplied camera name … … 22 24 'skycell_id=s' => \$skycell_id, # skycell_id 23 25 'verbose' => \$verbose, # verbose commands 24 'logfile=s' => \$logfile # destination for stdout and stderr 26 'logfile=s' => \$logfile, # destination for stdout and stderr 27 'save_temps' => \$save_temps # save temporary files. 25 28 ) or pod2usage ( 2 ); 26 29 … … 49 52 &my_die("Unable to redirect output to logfile", $stage, $stage_id, $PS_EXIT_UNKNOWN_ERROR) if $logfile; 50 53 51 my $mdcParser = PS: IPP:Metadata::Config->new; # parser for metadata config files54 my $mdcParser = PS::IPP::Metadata::Config->new; # parser for metadata config files 52 55 53 56 … … 64 67 my $astromSource; # The astrometry source 65 68 { 66 my $command = "$ppConfigDump -camera $camera -recipe PSWARP $recipe_pswarp-dump-recipe PSWARP -";69 my $command = "$ppConfigDump -camera $camera -recipe PSWARP DEFAULT -dump-recipe PSWARP -"; 67 70 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 68 71 run(command => $command, verbose => $verbose); … … 70 73 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 71 74 &my_die("Unable to perform ppConfigDump: $error_code", 72 $ warp_id, $skycell_id, $tess_dir, $error_code);75 $stage, $stage_id, $error_code); 73 76 } 74 77 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 75 78 &my_die("Unable to parse metadata config doc", 76 $ warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR);79 $stage, $stage_id, $PS_EXIT_PROG_ERROR); 77 80 $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE'); 78 81 } 79 82 80 83 81 84 my $imfiles; # Array of component files 82 85 my $command = "$warptool -warped -warp_id $stage_id -skycell_id $skycell_id"; 83 my$command .= " -dbname $dbname " if defined $dbname;86 $command .= " -dbname $dbname " if defined $dbname; 84 87 85 88 my ( $success, $error_code, $full_buf, $stdout_buf, $stderrr_buf ) = … … 118 121 my ($bkgList_file,$bkgList_name) = tempfile("/tmp/bkgreg.warp.bkg.${warp_id}.${skycell_id}.XXXX", 119 122 UNLINK => !$save_temps); 120 my ($astromList_file,$astro List_name) = tempfile("/tmp/bkgreg.warp.astrom.${warp_id}.${skycell_id}.XXXX",123 my ($astromList_file,$astromList_name) = tempfile("/tmp/bkgreg.warp.astrom.${warp_id}.${skycell_id}.XXXX", 121 124 UNLINK => !$save_temps); 122 125 my $chipFiles; … … 159 162 if (!$skyCell_exists) { # Generate it 160 163 my $skyFile = prepare_output("SKYCELL.TEMPLATE", $path_base, $skycell_id, 1); 161 $ipprc->skycell_file( $tess_ dir, $skycell_id, $skyFile, $verbose ) or164 $ipprc->skycell_file( $tess_id, $skycell_id, $skyFile, $verbose ) or 162 165 &my_die("Unable to generate template skycell",$skycell_id,$warp_id,$PS_EXIT_SYS_ERROR); 163 166 } … … 269 272 my $error; 270 273 my $output = $ipprc->prepare_output($filerule, $outroot, $skycell_id, $delete, \$error) 271 or &my_die("failed to prepare output file for: $filerule", $skycell_id, $ warp_id, $error);274 or &my_die("failed to prepare output file for: $filerule", $skycell_id, $stage_id, $error); 272 275 return $output; 273 276 }
Note:
See TracChangeset
for help on using the changeset viewer.
