- Timestamp:
- Dec 6, 2012, 6:32:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ippScripts/scripts/regenerate_background.pl
r34756 r34772 10 10 use IPC::Cmd 0.36 qw( can_run run ); 11 11 use File::Spec; 12 use File::Temp qw( tempfile ); 12 13 use PS::IPP::Config 1.01 qw( :standard ); 13 14 use Getopt::Long qw (GetOptions :config auto_help auto_version gnu_getopt ); 14 15 use Pod::Usage qw( pod2usage ); 16 use PS::IPP::Metadata::Config; 17 use PS::IPP::Metadata::List qw( parse_md_list ); 18 19 15 20 16 21 my $ppConfigDump = can_run('ppConfigDump'); … … 67 72 my $astromSource; # The astrometry source 68 73 { 69 my $command = "$ppConfigDump -camera $camera -recipe PSWARP DEFAULT-dump-recipe PSWARP -";74 my $command = "$ppConfigDump -camera $camera -recipe PSWARP BACKGROUND -dump-recipe PSWARP -"; 70 75 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 71 76 run(command => $command, verbose => $verbose); … … 97 102 } 98 103 99 my $in_md = $mdcParser->parse _list(join "", @$stdout_buf) or104 my $in_md = $mdcParser->parse(join "", @$stdout_buf) or 100 105 &my_die("Unable to parse metadata config doc", $stage, $stage_id, $PS_EXIT_PROG_ERROR); 101 106 $imfiles = parse_md_list($in_md) or … … 165 170 &my_die("Unable to generate template skycell",$skycell_id,$warp_id,$PS_EXIT_SYS_ERROR); 166 171 } 167 172 my $bkgOut_log = prepare_output("LOG.EXP",$path_base . ".BKG_REG",$skycell_id,1); 168 173 169 174 # Construct pswarp command 170 175 my $pswarp_command = "$pswarp "; 171 176 $pswarp_command .= " -list $bkgList_name -astromlist $astromList_name -bkglist $bkgList_name "; 177 $pswarp_command .= " ${path_base} "; 172 178 $pswarp_command .= " $skyCell_name "; 173 179 $pswarp_command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF "; … … 186 192 unless ($success) { 187 193 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 194 &my_die("Unable to perform pswarp: $error_code", $stage, $stage_id, $error_code); 195 } 196 197 my $update_command = "$warptool "; 198 $update_command .= " -updateskyfile -warp_id $warp_id -skycell_id $skycell_id "; 199 $update_command .= " -set_background_model 1 "; 200 $update_command .= " -dbname $dbname " if defined $dbname; 201 202 ( $success, $error_code, $full_buf, $stdout_buf, $stderrr_buf ) = 203 run(command => $update_command, verbose => $verbose); 204 unless ($success) { 205 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 188 206 &my_die("Unable to perform warptool: $error_code", $stage, $stage_id, $error_code); 189 207 } … … 223 241 224 242 my $num = 0; 225 243 my $path_base = '/tmp/x'; 244 my $expTime = 60; 245 226 246 my ($inputMDC_file, $inputMDC_name) = tempfile("/tmp/bkgreg.stack.mdc.${stage_id}.XXXX", 227 247 UNLINK => !$save_temps); … … 242 262 } 243 263 close($inputMDC_file); 244 264 265 my $bkgOut_log = prepare_output("LOG.IMFILE",$path_base . "BKG_REG",$skycell_id,1); 266 245 267 my $ppStack_command = "$ppStackMedian -input $inputMDC_name $path_base "; 246 268 $ppStack_command .= " -recipe PPSTACK STACK -recipe PPSUB STACK -recipe PSPHOT STACK "; … … 253 275 $ppStack_command .= " -Db PHOTOMETRY F -Db VARIANCE F -Db CONVOLVE F "; 254 276 $ppStack_command .= " -Df DEFAULT.EXPTIME $expTime "; 255 $ppStack_command .= " -threads $threads-log $bkgOut_log ";277 $ppStack_command .= " -threads 1 -log $bkgOut_log "; 256 278 $ppStack_command .= " -dbname $dbname " if defined $dbname; 257 279
Note:
See TracChangeset
for help on using the changeset viewer.
