Changeset 34800 for trunk/ippScripts
- Timestamp:
- Dec 11, 2012, 2:04:31 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
- 1 copied
-
. (modified) (1 prop)
-
ippScripts/Build.PL (modified) (1 diff)
-
ippScripts/MANIFEST (modified) (1 diff)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/detrend_process_imfile.pl (modified) (2 diffs)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippScripts/scripts/regenerate_background.pl (copied) (copied from branches/czw_branch/20120906/ippScripts/scripts/regenerate_background.pl )
-
ippScripts/scripts/skycell_jpeg.pl (modified) (2 diffs)
-
ippScripts/scripts/stack_skycell.pl (modified) (2 diffs)
-
ippScripts/scripts/warp_skycell.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/ippScripts/Build.PL
r33627 r34800 128 128 scripts/listvideocells.pl 129 129 scripts/skycalibration.pl 130 scripts/regenerate_background.pl 130 131 )], 131 132 dist_abstract => 'Scripts for running the Pan-STARRS IPP', -
trunk/ippScripts/MANIFEST
r31435 r34800 46 46 scripts/skycell_jpeg.pl 47 47 scripts/lap_science.pl 48 scripts/regenerate_background.pl 48 49 t/00_distribution.t -
trunk/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/destreak_restore_camera.pl (added) merged: 34772
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/detrend_process_imfile.pl
r33666 r34800 27 27 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 28 28 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 29 my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1); 30 29 31 if ($missing_tools) { 30 32 warn("Can't find required tools."); … … 124 126 # Run ppImage 125 127 unless ($no_op) { 128 my $repair_cmd = "$nebrepair $input_uri"; 129 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose); 130 unless ($repair_success) { 131 &my_die("Unable to attempt repair: $input_uri $repair_error_code", $det_id, $exp_id, $class_id $PS_EXIT_SYS_ERROR); 132 } 133 134 126 135 my $command = "$ppImage -file $input_uri $outroot"; 127 136 $command .= " -recipe PPIMAGE $ppimage_recipe"; -
trunk/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 34772,34786
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/magic_destreak.pl (added) merged: 34772
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/skycell_jpeg.pl
r28403 r34800 268 268 269 269 my %tangents = (); 270 271 my %products = ('image' => "PPSTACK.UNCONV", 272 'mask' => "PPSTACK.UNCONV.MASK", 273 'variance' => "PPSTACK.UNCONV.VARIANCE", 274 'exp' => "PPSTACK.UNCONV.EXP", 275 'num' => "PPSTACK.UNCONV.EXPNUM", 276 'bkg' => "PPSTACK.OUTPUT.BKGMODEL" 277 ); 270 278 271 279 foreach my $imfile (@$imfiles) { … … 281 289 282 290 $projection_cell =~ s/^(.*)\..*$/$1/; 283 291 284 292 unless (exists($tangents{$projection_cell})) { 285 293 # Make a temp file and fill, but be sure to save 286 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 287 UNLINK => !$save_temps); 288 $tangents{$projection_cell}{FILE} = $tempFile; 289 $tangents{$projection_cell}{NAME} = $tempName; 290 if ($masks) { 291 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 292 UNLINK => !$save_temps); 293 $tangents{$projection_cell}{MFILE} = $maskFile; 294 $tangents{$projection_cell}{MNAME} = $maskName; 295 } 296 } 297 print "$skycell_id $projection_cell\n"; 298 my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id); 299 print "$file $state $quality\n"; 300 my $f_fh = $tangents{$projection_cell}{FILE}; 301 print $f_fh "$file\n"; 302 if ($masks) { 303 my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id); 304 print "$mask\n"; 305 my $m_fh = $tangents{$projection_cell}{MFILE}; 306 print $m_fh "$mask\n"; 294 foreach my $key (keys %products) { 295 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.$key.XXXX", 296 UNLINK => !$save_temps); 297 $tangents{$projection_cell}{$key}{FILE} = $tempFile; 298 $tangents{$projection_cell}{$key}{NAME} = $tempName; 299 } 300 } 301 foreach my $key (keys %products) { 302 print "$skycell_id $projection_cell\n"; 303 my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id); 304 print "$file $state $quality\n"; 305 my $f_fh = $tangents{$projection_cell}{$key}{FILE}; 306 print $f_fh "$file\n"; 307 307 } 308 308 } 309 309 foreach my $projection_cell (keys %tangents) { 310 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 311 if ($masks) { 312 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 313 } 314 $command .= " ${outroot}.${projection_cell} "; 315 print "$command\n"; 316 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 317 unless ($success) { 318 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 319 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 320 } 310 ## Loop over results here. 311 # Images 312 # Masks 313 # Variances 314 # Nexptime 315 # Nexp 316 # Backgrounds 317 318 foreach my $key (keys %products) { 319 $command = "$ppSkycell -images $tangents{$projection_cell}{$key}{NAME}"; 320 $command .= " ${outroot}.${projection_cell}.${key} "; 321 if ($key eq 'bkg') { 322 $command .= " -Di BIN1 1 -Di BIN2 1 "; 323 } 324 elsif ($key eq 'image') { 325 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} "; 326 } 327 elsif ($key eq 'mask') { 328 next; # This should be made with the images. 329 } 330 print "$command\n"; 331 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 332 unless ($success) { 333 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 334 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 335 } 336 } 337 321 338 # Update database: 322 339 $command = "$stacktool -addsummary -sass_id $stage_id -projection_cell $projection_cell -path_base $outroot"; -
trunk/ippScripts/scripts/stack_skycell.pl
r32562 r34800 229 229 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 230 230 231 my $bkgmodel = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL", $file->{path_base}); 232 231 233 &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $image ); 232 234 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask ); … … 240 242 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 241 243 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 244 print $listFile "\tBKGMODEL\tSTR\t" . $bkgmodel . "\n" if $ipprc->file_exists( $bkgmodel ); 242 245 243 246 print $listFile "END\n\n"; -
trunk/ippScripts/scripts/warp_skycell.pl
r33053 r34800 128 128 # Where do we get the astrometry source from? 129 129 my $astromSource; # The astrometry source 130 my $doBackground; # Do we want to make background models? 130 131 { 131 132 my $command = "$ppConfigDump -camera $camera -recipe PSWARP $recipe_pswarp -dump-recipe PSWARP -"; … … 139 140 &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR); 140 141 $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE'); 142 $doBackground = metadataLookupBool($metadata, 'BACKGROUND.MODEL'); 141 143 } 142 144 … … 168 170 if ($do_stats) { 169 171 $outputStats = prepare_output ("SKYCELL.STATS", $outroot, $skycell_id, 1) if $do_stats; 172 } 173 my $outputBKGs; 174 if ($doBackground) { 175 $outputBKGs = prepare_output ("PSWARP.OUTPUT.BKGMODEL", $outroot, $skycell_id, 1); 170 176 } 171 177 my $configuration; … … 209 215 my ($weightFile, $weightName) = tempfile( "$tempOutRoot.weight.list.XXXX", UNLINK => !$save_temps); 210 216 my ($astromFile, $astromName) = tempfile( "$tempOutRoot.astrom.list.XXXX", UNLINK => !$save_temps); 211 217 my ($bkgFile, $bkgName); 218 if ($doBackground) { 219 ($bkgFile, $bkgName) = tempfile( "$tempOutRoot.bkg.list.XXXX", UNLINK => !$save_temps); 220 } 212 221 my $wrote_astrom = 0; 213 222 foreach my $imfile (@$imfiles) { … … 235 244 print $maskFile "$mask\n"; 236 245 print $weightFile "$weight\n"; 246 my $bkg; 247 if ($doBackground) { 248 $bkg = $ipprc->filename("PSPHOT.BACKMDL", $imfile->{chip_path_base}, $imfile->{class_id}); 249 print $bkgFile "$bkg\n"; 250 } 237 251 238 252 if (!$wrote_astrom) { … … 245 259 close $weightFile; 246 260 close $astromFile; 247 261 if ($doBackground) { 262 close($bkgFile); 263 } 248 264 # We need the recipe to determine if we care whether the PSF is generated or not 249 265 my $recipe; … … 269 285 $command .= " -variancelist $weightName"; 270 286 $command .= " -astromlist $astromName"; 287 $command .= " -bkglist $bkgName" if ($doBackground); 271 288 $command .= " $outroot $skyFile"; 272 289 $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE";
Note:
See TracChangeset
for help on using the changeset viewer.
