Changeset 34780
- Timestamp:
- Dec 7, 2012, 4:21:32 PM (14 years ago)
- Location:
- branches/czw_branch/20120906
- Files:
-
- 3 edited
-
ippScripts/scripts/regenerate_background.pl (modified) (5 diffs)
-
ippTools/share/stacktool_inputskyfile.sql (modified) (1 diff)
-
ippTools/src/stacktool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20120906/ippScripts/scripts/regenerate_background.pl
r34772 r34780 110 110 my $skycell_id = $imfile->{skycell_id}; 111 111 my $path_base = $imfile->{path_base}; 112 my $tess_id = $imfile->{ path_base};112 my $tess_id = $imfile->{tess_id}; 113 113 114 114 # Parse the results to determine if there are any problems that prevent this from … … 220 220 my $ppStackMedian = can_run('ppStackMedian') or 221 221 &my_die("Can't find ppStackMedian",$stage,$stage_id,$PS_EXIT_UNKNOWN_ERROR); 222 222 223 # Get the information about this run 224 my $st_command = "$stacktool -sumskyfile -stack_id $stack_id"; 225 $st_command .= " -dbname $dbname " if defined $dbname; 226 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 227 run(command => $st_command, verbose => $verbose); 228 unless($success) { 229 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 230 &my_die("Unable to perform stacktool -sumskyfile",$stage,$stage_id,$error_code); 231 } 232 if (@$stdout_buf == 0) { 233 # Nothing to do; 234 } 235 my $in_md = $mdcParser->parse(join "", @$stdout_buf) or 236 &my_die("Unable to parse metadata config doc", $stage, $stage_id, $PS_EXIT_PROG_ERROR); 237 my $stacks = parse_md_list($in_md) or 238 &my_die("Unable to parse metadata", $stage, $stage_id, $PS_EXIT_PROG_ERROR); 239 my $stack = shift(@$stacks); 240 my $path_base = $stack->{path_base}; 223 241 224 242 # Get inputs … … 226 244 my $command = "$stacktool -inputskyfile -stack_id $stack_id"; 227 245 $command .= " -dbname $dbname " if defined $dbname; 228 my( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =246 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 229 247 run(command => $command, verbose => $verbose); 230 248 unless($success) { … … 235 253 # Nothing to do; 236 254 } 237 my $in_md = $mdcParser->parse_list(join "", @$stdout_buf) or255 $in_md = $mdcParser->parse(join "", @$stdout_buf) or 238 256 &my_die("Unable to parse metadata config doc", $stage, $stage_id, $PS_EXIT_PROG_ERROR); 239 257 $imfiles = parse_md_list($in_md) or 240 258 &my_die("Unable to parse metadata", $stage, $stage_id, $PS_EXIT_PROG_ERROR); 241 259 242 260 my $num = 0; 243 my $path_base = '/tmp/x'; 244 my $expTime = 60; 245 261 my $expTime; 246 262 my ($inputMDC_file, $inputMDC_name) = tempfile("/tmp/bkgreg.stack.mdc.${stage_id}.XXXX", 247 263 UNLINK => !$save_temps); … … 260 276 print $inputMDC_file "END\n\n"; 261 277 $num++; 278 279 $expTime = $imfile->{exp_time}; # I need something here. 262 280 } 263 281 close($inputMDC_file); 264 282 265 my $bkgOut_log = prepare_output("LOG. IMFILE",$path_base . "BKG_REG",$skycell_id,1);266 267 my $ppStack_command = "$ppStackMedian -input $inputMDC_name $ path_base";283 my $bkgOut_log = prepare_output("LOG.EXP",$path_base . ".BKG_REG",1); 284 285 my $ppStack_command = "$ppStackMedian -input $inputMDC_name ${path_base}.mdl "; 268 286 $ppStack_command .= " -recipe PPSTACK STACK -recipe PPSUB STACK -recipe PSPHOT STACK "; 269 287 $ppStack_command .= " -recipe PPSTATS STACKSTATS -stack-type DEEP_STACK "; 270 $ppStack_command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE ";271 $ppStack_command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF ";272 $ppStack_command .= " -F SOURCE.PLOT.MOMENTS SOURCE.PLOT.SKY.MOMENTS ";273 $ppStack_command .= " -F SOURCE.PLOT.PSFMODEL SOURCE.PLOT.SKY.PSFMODEL ";274 $ppStack_command .= " -F SOURCE.PLOT.APRESID SOURCE.PLOT.SKY.APRESID ";288 # $ppStack_command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE "; 289 # $ppStack_command .= " -F PSPHOT.OUTPUT PSPHOT.OUT.CMF.MEF -F PSPHOT.BACKMDL PSPHOT.BACKMDL.MEF "; 290 # $ppStack_command .= " -F SOURCE.PLOT.MOMENTS SOURCE.PLOT.SKY.MOMENTS "; 291 # $ppStack_command .= " -F SOURCE.PLOT.PSFMODEL SOURCE.PLOT.SKY.PSFMODEL "; 292 # $ppStack_command .= " -F SOURCE.PLOT.APRESID SOURCE.PLOT.SKY.APRESID "; 275 293 $ppStack_command .= " -Db PHOTOMETRY F -Db VARIANCE F -Db CONVOLVE F "; 276 294 $ppStack_command .= " -Df DEFAULT.EXPTIME $expTime "; 277 295 $ppStack_command .= " -threads 1 -log $bkgOut_log "; 278 296 $ppStack_command .= " -dbname $dbname " if defined $dbname; 297 298 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 299 run(command => $ppStack_command, verbose => $verbose); 300 unless($success) { 301 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 302 &my_die("Unable to perform ppStackMedian",$stage,$stage_id,$error_code); 303 } 304 305 my $update_command = "$stacktool "; 306 $update_command .= " -updatesumskyfile -stack_id $stack_id "; 307 $update_command .= " -set_background_model 1 -fault 0 "; 308 $update_command .= " -dbname $dbname " if defined $dbname; 309 310 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 311 run(command => $update_command, verbose => $verbose); 312 unless ($success) { 313 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 314 &my_die("Unable to perform stacktool: $error_code", $stage, $stage_id, $error_code); 315 } 316 317 279 318 280 319 } -
branches/czw_branch/20120906/ippTools/share/stacktool_inputskyfile.sql
r32937 r34780 4 4 rawExp.exp_id, 5 5 rawExp.exp_name, 6 rawExp.exp_time, 6 7 rawExp.object, 7 8 rawExp.dateobs, -
branches/czw_branch/20120906/ippTools/src/stacktool.c
r34772 r34780 1766 1766 psMetadata *values = psMetadataAlloc(); 1767 1767 PXOPT_COPY_S16(config->args, values, "-set_background_model", "background_model", "=="); 1768 long rows = psDBUpdateRows(config->dbh," warpSkyfile", where, values);1768 long rows = psDBUpdateRows(config->dbh,"stackSumSkyfile", where, values); 1769 1769 psFree(values); 1770 1770 if (!rows) {
Note:
See TracChangeset
for help on using the changeset viewer.
