Changeset 35236 for branches/eam_branches/ipp-20130207/ippScripts
- Timestamp:
- Mar 5, 2013, 2:24:05 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130207
- Files:
-
- 14 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/automate_stacks.pl (modified) (3 diffs)
-
ippScripts/scripts/background_chip.pl (modified) (7 diffs)
-
ippScripts/scripts/background_warp.pl (modified) (3 diffs)
-
ippScripts/scripts/camera_exp.pl (modified) (1 diff)
-
ippScripts/scripts/chip_imfile.pl (modified) (1 prop)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/diff_skycell.pl (modified) (1 diff)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (2 diffs)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippScripts/scripts/publish_file.pl (modified) (7 diffs, 1 prop)
-
ippScripts/scripts/skycalibration.pl (modified) (1 diff)
-
ippScripts/scripts/warp_skycell.pl (modified) (1 diff, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130207
- Property svn:mergeinfo changed
/trunk (added) merged: 35127-35128,35130,35133-35135,35141-35142,35148,35150-35159,35162-35167,35169-35200,35203-35218,35221-35228,35230,35232-35233
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130207/ippScripts/scripts/automate_stacks.pl
r34010 r35236 117 117 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 118 118 pod2usage( 119 -msg => "Choose a mode: --check_registration --check_burntool --queue_chips --queue_stacks ",119 -msg => "Choose a mode: --check_registration --check_burntool --queue_chips --queue_stacks --dbname", 120 120 -exitval => 3, 121 121 ) unless … … 124 124 defined $check_chips or defined $check_stacks or $check_sweetspot or $check_detrends or $check_dqstats or 125 125 defined $test_mode or defined $clean_old or defined $check_mode or 126 defined $confirm_stacks or defined $burntool_stats ;126 defined $confirm_stacks or defined $burntool_stats or defined $dbname; 127 127 128 128 # Configurable parameters from our config file. … … 282 282 unless(defined($camera)) { 283 283 $camera = 'GPC1'; 284 }285 unless(defined($dbname)) {286 $dbname = 'gpc1';287 284 } 288 285 -
branches/eam_branches/ipp-20130207/ippScripts/scripts/background_chip.pl
r35118 r35236 43 43 # Parse the command-line arguments 44 44 my ( $chip_bg_id, $class_id, $camera, $outroot, $dbname, $reduction, $verbose, 45 $threads, $no_update, $save_temps, $no_op, $redirect, $chip_path_base, $ magicked );45 $threads, $no_update, $save_temps, $no_op, $redirect, $chip_path_base, $cam_path_base, $magicked ); 46 46 GetOptions( 47 47 'chip_bg_id=s' => \$chip_bg_id, # chipBackgroundRun identifier … … 53 53 'threads=s' => \$threads, # Number of threads to use 54 54 'chip_path_base=s' => \$chip_path_base, # optional chip_path_base 55 'cam_path_base=s' => \$cam_path_base, # optional camera stage path_base 55 56 'magicked=s' => \$magicked, # magicked status of input 56 57 'verbose' => \$verbose, # Print to stdout … … 94 95 my $dump_config; 95 96 if ($chip_path_base and $no_update) { 97 # XXX: this path through the code has not been excercized in awhile and probably does not work 98 96 99 # we are running outside of a chip_bg_run (perhaps by the postage stamp server) don't dump config 97 100 # or do stats. Get path to input from command line. … … 119 122 my $input = $$inputs[0]; # Input of interest 120 123 $in_path = $input->{path_base}; 124 $cam_path_base = $input->{cam_path_base}; 121 125 $magicked = $input->{magicked}; 122 126 } 123 127 124 128 my $in_image = $ipprc->filename("PPIMAGE.CHIP", $in_path, $class_id); 125 my $in_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $in_path, $class_id); 129 my $in_mask; 130 if ($cam_path_base) { 131 $in_mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 132 } else { 133 $in_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $in_path, $class_id); 134 } 126 135 my $in_wt = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $in_path, $class_id); 127 136 my $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id); … … 177 186 178 187 my $apply_auxiliary_mask = 1; 188 # XXX Temporary lookup of auxiliary mask file from static location. 189 # At some point I'll convert this to register the masks in the database and use detselect 179 190 if ($apply_auxiliary_mask) { 180 191 my @auxmask_start_date = qw( … … 238 249 print "Auxililary mask file is $auxmask\n"; 239 250 } 240 241 251 242 252 … … 272 282 &my_die("Couldn't find expected output file: $out_stats", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($out_stats); 273 283 274 my $command = "$ppStatsFromMetadata $out_stats - BACKGROUND_CHIP"; 284 my $resolved_stats = $ipprc->file_resolve($out_stats); 285 my $command = "$ppStatsFromMetadata $resolved_stats - BACKGROUND_CHIP"; 275 286 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 276 287 run(command => $command, verbose => $verbose); -
branches/eam_branches/ipp-20130207/ippScripts/scripts/background_warp.pl
r35118 r35236 119 119 my $tempOutRoot = "/tmp/background.warp.$warp_bg_id.$skycell_id"; 120 120 121 # XXX: get this from recipe122 my $alternate_astrometry_label = 'M31.test.20130206.bgsub';123 # XXX: get exp_id from command line124 my $exp_id = 196758;125 126 121 if (!defined $imageName) { 127 122 # go find our inputs 128 my $astrom_path_base;129 if (defined $alternate_astrometry_label) {130 my $command = "$camtool -processedexp -exp_id $exp_id -label $alternate_astrometry_label";131 $command .= " -dbname $dbname" if $dbname;132 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =133 run(command => $command, verbose => $verbose);134 unless ($success) {135 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);136 &my_die("Unable to perform camtool -processedexp: $error_code", $warp_bg_id, $error_code);137 }138 my $entries = $mdcParser->parse_list(join "", @$stdout_buf) or139 &my_die("Unable to parse metadata config doc", $warp_bg_id, $PS_EXIT_PROG_ERROR);140 my $entry = $entries->[0];141 $astrom_path_base = $entry->{path_base};142 }143 144 123 my ($imageFile, $maskFile, $weightFile); 145 124 ($imageFile, $imageName) = tempfile( "$tempOutRoot.image.list.XXXX", UNLINK => !$save_temps); … … 174 153 $magicked = $file->{magicked}; 175 154 176 if (!$astrom_path_base) { 177 my $cam_path = $file->{cam_path_base}; 178 my $astrom = $ipprc->filename($astromSource, $cam_path); 179 &my_die("Astrometry files don't match: $astrom vs $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) if defined $astrometry and $astrom ne $astrometry; 180 $astrometry = $astrom; 181 } elsif (!$astrometry) { 182 # using alternate astrometry 183 $astrometry = $ipprc->filename($astromSource, $astrom_path_base); 184 } 155 my $cam_path = $file->{cam_path_base}; 156 my $astrom = $ipprc->filename($astromSource, $cam_path); 157 &my_die("Astrometry files don't match: $astrom vs $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) if defined $astrometry and $astrom ne $astrometry; 158 $astrometry = $astrom; 185 159 } 186 160 close $imageFile; … … 238 212 &my_die("Couldn't find expected output file: $out_stats", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($out_stats); 239 213 240 my $command = "$ppStatsFromMetadata $out_stats - BACKGROUND_WARP"; 214 my $real_stats = $ipprc->file_resolve($out_stats); 215 216 my $command = "$ppStatsFromMetadata $real_stats - BACKGROUND_WARP"; 241 217 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 242 218 run(command => $command, verbose => $verbose); -
branches/eam_branches/ipp-20130207/ippScripts/scripts/camera_exp.pl
r35081 r35236 379 379 check_output($bkgModel, $replicateOutputs); 380 380 } 381 $cmdflags = $cmdflags . " -background_model 1 "; 381 382 } 382 383 } -
branches/eam_branches/ipp-20130207/ippScripts/scripts/chip_imfile.pl
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20130207/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130207/ippScripts/scripts/diff_skycell.pl
r32665 r35236 299 299 my $jpeg1Name = prepare_output("PPSUB.OUTPUT.JPEG1", $outroot, 1); 300 300 my $jpeg2Name = prepare_output("PPSUB.OUTPUT.JPEG2", $outroot, 1); 301 302 # do we always need to prepare this file? 303 if ($reduction ne 'NOCONVDIFF') { 304 my $refConv = prepare_output("PPSUB.REF.CONV", $outroot, 1); 305 } 301 306 302 307 my ($inverseName, $inverseMask, $inverseVariance, $inverseSources); -
branches/eam_branches/ipp-20130207/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130207/ippScripts/scripts/ipp_cleanup.pl
r35028 r35236 1957 1957 addFilename (\@files, "PPBACKGROUND.OUTPUT", $path_base, $class_id); 1958 1958 addFilename (\@files, "PPBACKGROUND.OUTPUT.MASK", $path_base, $class_id); 1959 addFilename (\@files, "PPBACKGROUND.OUTPUT.VARIANCE", $path_base, $class_id); 1959 1960 if ($mode eq "goto_purged") { 1960 1961 # additional files to remove for 'purge' mode … … 2100 2101 addFilename (\@files, "PSWARP.OUTPUT", $path_base, $skycell_id); 2101 2102 addFilename (\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id); 2103 addFilename (\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id); 2102 2104 if ($mode eq "goto_purged") { 2103 2105 # additional files to remove for 'purge' mode -
branches/eam_branches/ipp-20130207/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130207/ippScripts/scripts/publish_file.pl
- Property svn:mergeinfo set to
r34485 r35236 92 92 93 93 my $comment; # Comment for exposure 94 my $exp_name_1; # Name of exposure 1 95 my $exp_name_2; # Name of exposure 2 94 96 if ($stage eq 'camera') { 95 97 my $command = "camtool -processedexp -cam_id $stage_id"; … … 168 170 my %negative; # Data for negative diff detections 169 171 foreach my $comp ( @$components ) { 170 my $path_base = $comp->{path_base}; # Base name for file172 my $path_base = $comp->{path_base}; # Base name for file 171 173 if (!$need_magic and $comp->{magicked}) { 172 174 # This client is authorized to receive uncensored detections … … 178 180 print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment}; 179 181 $comment = $comp->{comment} unless defined $comment; 182 $exp_name_1 = $comp->{exp_name_1} unless defined $exp_name_1; 183 $exp_name_2 = $comp->{exp_name_2} unless defined $exp_name_2; 180 184 181 185 (carp "Bad zpt_obs or exp_time for component" and next) if not defined $comp->{zpt_obs} or not defined $comp->{exp_time}; … … 192 196 &my_die("input file does not exist: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$ipprc->file_exists($filename); 193 197 my $resolved = $ipprc->file_resolve($filename); 194 198 195 199 &my_die("unable to resolve input file: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$resolved; 196 200 197 201 $filename = $resolved; 198 202 199 my $cam_id = $comp->{cam_id_1};200 #print "Getting info from camera stage $cam_id\n";201 my $cam_command = "$camtool -processedexp -cam_id $cam_id";202 $cam_command .= " -dbname $dbname" if defined $dbname;203 my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) =204 run(command => $cam_command, verbose => $verbose);205 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success;206 my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or207 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);208 my $cam_components = parse_md_list($cam_metadata) or209 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);210 &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1;211 my $cam_comp = $$cam_components[0];212 213 my $exp_id = $comp->{exp_id_1};214 #print "Getting info from raw stage $exp_id\n";215 my $reg_command = "$regtool -processedimfile -exp_id $exp_id";216 $reg_command .= " -dbname $dbname" if defined $dbname;217 my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) =218 run(command => $reg_command, verbose => $verbose);219 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success;220 my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or221 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);222 my $reg_components = parse_md_list($reg_metadata) or223 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);224 my $reg_comp = $$reg_components[0];225 226 # Now get the difftype value from diff->{diff_mode}227 my $difftype = "";228 if ($comp->{diff_mode} == 1) {229 $difftype = "WW";230 } elsif ($comp->{diff_mode} == 2) {231 $difftype = "WS";232 } elsif ($comp->{diff_mode} == 3) {233 $difftype = "SW"; # Not used yet234 } elsif ($comp->{diff_mode} == 4) {235 $difftype = "SS";236 } else {237 $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]";238 }203 my $cam_id = $comp->{cam_id_1}; 204 #print "Getting info from camera stage $cam_id\n"; 205 my $cam_command = "$camtool -processedexp -cam_id $cam_id"; 206 $cam_command .= " -dbname $dbname" if defined $dbname; 207 my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) = 208 run(command => $cam_command, verbose => $verbose); 209 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success; 210 my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or 211 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 212 my $cam_components = parse_md_list($cam_metadata) or 213 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 214 &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1; 215 my $cam_comp = $$cam_components[0]; 216 217 my $exp_id = $comp->{exp_id_1}; 218 #print "Getting info from raw stage $exp_id\n"; 219 my $reg_command = "$regtool -processedimfile -exp_id $exp_id"; 220 $reg_command .= " -dbname $dbname" if defined $dbname; 221 my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) = 222 run(command => $reg_command, verbose => $verbose); 223 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success; 224 my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or 225 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 226 my $reg_components = parse_md_list($reg_metadata) or 227 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 228 my $reg_comp = $$reg_components[0]; 229 230 # Now get the difftype value from diff->{diff_mode} 231 my $difftype = ""; 232 if ($comp->{diff_mode} == 1) { 233 $difftype = "WW"; 234 } elsif ($comp->{diff_mode} == 2) { 235 $difftype = "WS"; 236 } elsif ($comp->{diff_mode} == 3) { 237 $difftype = "SW"; # Not used yet 238 } elsif ($comp->{diff_mode} == 4) { 239 $difftype = "SS"; 240 } else { 241 $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]"; 242 } 239 243 240 244 my $data = { zp => $zp, … … 250 254 output_format => $comp->{output_format}, 251 255 direction => 1, 252 comment => $reg_comp->{comment},253 obsmode => $reg_comp->{obs_mode},254 difftype => $difftype,255 sky => $cam_comp->{bg},256 shutoutc => $reg_comp->{dateobs},256 comment => $reg_comp->{comment}, 257 obsmode => $reg_comp->{obs_mode}, 258 difftype => $difftype, 259 sky => $cam_comp->{bg}, 260 shutoutc => $reg_comp->{dateobs}, 257 261 }; 258 262 259 #warn("Checking for positive");263 #warn("Checking for positive"); 260 264 diff_check(\%positive, $data, "positive"); 261 265 … … 288 292 diff_id => $comp->{diff_id}, 289 293 direction => 0, 290 comment => $reg_comp->{comment},291 obsmode => $reg_comp->{obs_mode},292 difftype => $difftype,293 sky => $cam_comp->{bg},294 shutoutc => $reg_comp->{dateobs},294 comment => $reg_comp->{comment}, 295 obsmode => $reg_comp->{obs_mode}, 296 difftype => $difftype, 297 sky => $cam_comp->{bg}, 298 shutoutc => $reg_comp->{dateobs}, 295 299 }; 296 300 297 #warn("Checking for negative");301 #warn("Checking for negative"); 298 302 diff_check(\%negative, $data, "negative"); 299 303 … … 326 330 my $command = "$dsreg --add pub.$pub_id.$stage.$stage_id --copy --abspath --product $product --type $dsType --list $dsFileName"; 327 331 $command .= " --ps0 \"$comment\"" if defined $comment; 332 $command .= " --ps1 \"$exp_name_1\"" if defined $exp_name_1; 333 $command .= " --ps2 \"$exp_name_2\"" if defined $exp_name_2; 328 334 329 335 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = -
branches/eam_branches/ipp-20130207/ippScripts/scripts/skycalibration.pl
r34792 r35236 231 231 $command .= " -F PSASTRO.OUTPUT $output_sources_filerule"; 232 232 $command .= " -stats $stats"; 233 $command .= " -recipe PPSTATS CAMSTATS"; 233 # $command .= " -recipe PPSTATS CAMSTATS"; 234 $command .= " -recipe PPSTATS SKYCALSTATS"; 234 235 $command .= " -dumpconfig $configuration" if $configuration; 235 236 $command .= " -tracedest $traceDest"; -
branches/eam_branches/ipp-20130207/ippScripts/scripts/warp_skycell.pl
- Property svn:mergeinfo set to
r34800 r35236 245 245 print $weightFile "$weight\n"; 246 246 my $bkg; 247 if ($doBackground) { 248 $bkg = $ipprc->filename("PSPHOT.BACKMDL", $imfile->{chip_path_base}, $imfile->{class_id}); 247 if (($doBackground)) { 248 # &&($imfile->{background_model} == 1) 249 if ($imfile->{cam_background_model}) { 250 $bkg = $ipprc->filename("PPIMAGE.BACKMDL", $imfile->{cam_path_base}, $imfile->{class_id}); 251 } 252 else { 253 $bkg = $ipprc->filename("PPIMAGE.BACKMDL", $imfile->{chip_path_base}, $imfile->{class_id}); 254 } 249 255 print $bkgFile "$bkg\n"; 250 256 }
Note:
See TracChangeset
for help on using the changeset viewer.
