Changeset 12021
- Timestamp:
- Feb 23, 2007, 3:12:46 PM (19 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 8 edited
-
camera_exp.pl (modified) (2 diffs)
-
chip_imfile.pl (modified) (2 diffs)
-
diff_skycell.pl (modified) (13 diffs)
-
register_exp.pl (modified) (8 diffs)
-
register_imfile.pl (modified) (5 diffs)
-
stack_skycell.pl (modified) (12 diffs)
-
warp_imfile.pl (modified) (10 diffs)
-
warp_overlap.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/camera_exp.pl
r12013 r12021 58 58 # Look for programs we need 59 59 my $missing_tools; 60 my $camtool = can_run(' p3tool') or (warn "Can't find p3tool" and $missing_tools = 1);60 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 61 61 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 62 62 … … 134 134 135 135 # Generate the file list, and get the statistics 136 my $outputFile = "$exp_tag. p3";136 my $outputFile = "$exp_tag.cam"; 137 137 my $outputRoot = File::Spec->catfile( $workdir, $outputFile ); 138 138 -
trunk/ippScripts/scripts/chip_imfile.pl
r12013 r12021 65 65 # Look for programs we need 66 66 my $missing_tools; 67 my $chiptool = can_run(' p2tool') or (warn "Can't find p2tool" and $missing_tools = 1);67 my $chiptool = can_run('chiptool') or (warn "Can't find chiptool" and $missing_tools = 1); 68 68 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 69 69 if ($missing_tools) { … … 86 86 87 87 ### Output file name --- must match camera configuration! 88 my $outputFile = "$exp_tag. p2";88 my $outputFile = "$exp_tag.chip"; 89 89 my $outputRoot = File::Spec->catfile( $workdir, $outputFile ); 90 90 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id); -
trunk/ippScripts/scripts/diff_skycell.pl
r12013 r12021 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($ p5_id, $camera, $dbname, $workdir, $no_update, $no_op);35 my ($diff_id, $camera, $dbname, $workdir, $no_update, $no_op); 36 36 GetOptions( 37 ' p5_id|d=s' => \$p5_id, # Phase 5identifier37 'diff_id|d=s' => \$diff_id, # Diff identifier 38 38 'camera|c=s' => \$camera, # Camera name 39 39 'dbname|d=s' => \$dbname, # Database name … … 45 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 46 pod2usage( 47 -msg => "Required options: -- p5_id --camera",47 -msg => "Required options: --diff_id --camera", 48 48 -exitval => 3, 49 ) unless defined $ p5_id49 ) unless defined $diff_id 50 50 and defined $camera; 51 51 … … 54 54 # Look for programs we need 55 55 my $missing_tools; 56 my $difftool = can_run(' p5tool') or (warn "Can't find p5tool" and $missing_tools = 1);56 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 57 57 my $pois = can_run('pois') or (warn "Can't find pois" and $missing_tools = 1); 58 58 if ($missing_tools) { … … 65 65 my $files; 66 66 { 67 my $command = "$difftool -inputscfile - p5_id $p5_id";67 my $command = "$difftool -inputscfile -diff_id $diff_id"; 68 68 $command .= " -dbname $dbname" if defined $dbname; 69 69 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 71 71 unless ($success) { 72 72 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 73 &my_die("Unable to perform difftool -inputscfile: $error_code", $ p5_id, $error_code);73 &my_die("Unable to perform difftool -inputscfile: $error_code", $diff_id, $error_code); 74 74 } 75 75 76 76 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 77 &my_die("Unable to parse metadata config doc", $ p5_id, $PS_EXIT_PROG_ERROR);77 &my_die("Unable to parse metadata config doc", $diff_id, $PS_EXIT_PROG_ERROR); 78 78 $files = parse_md_list($metadata) or 79 &my_die("Unable to parse metadata list", $ p5_id, $PS_EXIT_PROG_ERROR);80 } 81 82 &my_die("Subtraction list contains more than two elements", $ p5_id, $PS_EXIT_SYS_ERROR) unless79 &my_die("Unable to parse metadata list", $diff_id, $PS_EXIT_PROG_ERROR); 80 } 81 82 &my_die("Subtraction list contains more than two elements", $diff_id, $PS_EXIT_SYS_ERROR) unless 83 83 scalar @$files == 2; 84 84 … … 95 95 } 96 96 if (defined $skycell_id) { 97 &my_die("Skycell identifiers don't match", $ p5_id, $PS_EXIT_SYS_ERROR) unless97 &my_die("Skycell identifiers don't match", $diff_id, $PS_EXIT_SYS_ERROR) unless 98 98 $file->{skycell_id} eq $skycell_id; 99 99 } else { … … 102 102 } 103 103 104 &my_die("Unable to identify template", $ p5_id, $PS_EXIT_SYS_ERROR) unless defined $template;105 &my_die("Unable to identify input", $ p5_id, $PS_EXIT_SYS_ERROR) unless defined $input;104 &my_die("Unable to identify template", $diff_id, $PS_EXIT_SYS_ERROR) unless defined $template; 105 &my_die("Unable to identify input", $diff_id, $PS_EXIT_SYS_ERROR) unless defined $input; 106 106 107 107 ### Working directory … … 114 114 115 115 # Get the output filenames 116 my $outputFile = "$skycell_id.sub.$ p5_id"; # Root name116 my $outputFile = "$skycell_id.sub.$diff_id"; # Root name 117 117 my $outputRoot = File::Spec->catfile( $workdir, $outputFile ); 118 118 … … 131 131 unless ($success) { 132 132 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 133 &my_die("Unable to perform ppImage: $error_code", $ p5_id, $error_code);134 } 135 &my_die("Couldn't find expected output file: $outputName", $ p5_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;136 # &my_die("Couldn't find expected output file: $bin1Name", $ p5_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;137 # &my_die("Couldn't find expected output file: $bin2Name", $ p5_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;138 # &my_die("Couldn't find expected output file: $outputStats", $ p5_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;133 &my_die("Unable to perform ppImage: $error_code", $diff_id, $error_code); 134 } 135 &my_die("Couldn't find expected output file: $outputName", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $outputName; 136 # &my_die("Couldn't find expected output file: $bin1Name", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name; 137 # &my_die("Couldn't find expected output file: $bin2Name", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name; 138 # &my_die("Couldn't find expected output file: $outputStats", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats; 139 139 140 140 # Get the statistics on the residual image 141 141 if (0) { ### Disabled because pois doesn't output stats yet 142 142 my $statsFile; # File handle 143 open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $ p5_id, $PS_EXIT_SYS_ERROR);143 open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $diff_id, $PS_EXIT_SYS_ERROR); 144 144 my @contents = <$statsFile>; # Contents of file 145 145 close $statsFile; 146 146 my $metadata = $mdcParser->parse(join "", @contents) or 147 &my_die("Unable to parse metadata config doc", $ p5_id, $PS_EXIT_PROG_ERROR);148 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $ p5_id, $PS_EXIT_PROG_ERROR);147 &my_die("Unable to parse metadata config doc", $diff_id, $PS_EXIT_PROG_ERROR); 148 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $diff_id, $PS_EXIT_PROG_ERROR); 149 149 } 150 150 } … … 160 160 # Add the subtraction result 161 161 { 162 my $command = "$difftool -adddiffscfile - p5_id $p5_id -uri $outputName -b1_uri $outputRoot";162 my $command = "$difftool -adddiffscfile -diff_id $diff_id -uri $outputName -b1_uri $outputRoot"; 163 163 $command .= " -bg $bg -bg_stdev $bg_stdev"; 164 164 $command .= " -dbname $dbname" if defined $dbname; … … 168 168 unless ($success) { 169 169 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 170 &my_die("Unable to perform difftool -adddiffscfile: $error_code", $ p5_id, $error_code);170 &my_die("Unable to perform difftool -adddiffscfile: $error_code", $diff_id, $error_code); 171 171 } 172 172 … … 176 176 # Register the run as completed 177 177 { 178 my $command = "$difftool -updaterun - p5_id $p5_id -state stop"; # Command to run p5tool178 my $command = "$difftool -updaterun -diff_id $diff_id -state stop"; # Command to run difftool 179 179 $command .= " -dbname $dbname" if defined $dbname; 180 180 … … 193 193 { 194 194 my $msg = shift; # Warning message on die 195 my $ p5_id = shift; # Phase 5identifier195 my $diff_id = shift; # Diff identifier 196 196 my $exit_code = shift; # Exit code to add 197 197 198 198 warn($msg); 199 if ($ p5_id and not $no_update) {200 my $command = "$difftool -updaterun - p5_id $p5_id -state stop -code $exit_code";199 if ($diff_id and not $no_update) { 200 my $command = "$difftool -updaterun -diff_id $diff_id -state stop -code $exit_code"; 201 201 $command .= " -dbname $dbname" if defined $dbname; 202 202 system ($command); -
trunk/ippScripts/scripts/register_exp.pl
r12013 r12021 52 52 use constant DETREND_FLAG => "-detrend"; # Flag to use to mark detrend exposure 53 53 54 use constant PHASE0_URI => 'uri'; # Key for the URI55 use constant PHASE0_CLASSID => 'class_id'; # Key for the class id56 use constant PHASE0_BG => 'bg'; # Key for the background57 use constant PHASE0_BG_STDEV => 'bg_stdev'; # Key for the background standard deviation58 use constant PHASE0_BG_MEAN_STDEV => 'bg_mean_stdev'; # Key for the mean of the background standard deviation54 use constant REGISTER_URI => 'uri'; # Key for the URI 55 use constant REGISTER_CLASSID => 'class_id'; # Key for the class id 56 use constant REGISTER_BG => 'bg'; # Key for the background 57 use constant REGISTER_BG_STDEV => 'bg_stdev'; # Key for the background standard deviation 58 use constant REGISTER_BG_MEAN_STDEV => 'bg_mean_stdev'; # Key for the mean of the background standard deviation 59 59 60 60 # These values should be constant for all components … … 81 81 # Look for commands we need 82 82 my $missing_tools; 83 my $regtool = can_run(' p0tool')83 my $regtool = can_run('regtool') 84 84 or (warn "can't find regtool" and $missing_tools = 1); 85 85 my $ppStats = can_run('ppStats') … … 109 109 unless ($success) { 110 110 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 111 warn ("Unable to perform regtool on exposure id $exptag: $error_code");111 warn ("Unable to perform regtool -processedimfile on exposure id $exptag: $error_code"); 112 112 exit ($error_code); 113 113 } … … 137 137 } 138 138 if ($values{$constant} ne $value) { 139 warn ("Value of $constant for $imfile->{ PHASE0_CLASSID} doesn't match previous value");139 warn ("Value of $constant for $imfile->{REGISTER_CLASSID} doesn't match previous value"); 140 140 &my_die ($exptag, $PS_EXIT_PROG_ERROR); 141 141 } … … 148 148 } 149 149 150 my $bg = get_value($imfile, PHASE0_BG());150 my $bg = get_value($imfile, REGISTER_BG()); 151 151 push @backgrounds, $bg; 152 152 153 my $stdev = get_value($imfile, PHASE0_BG_MEAN_STDEV());153 my $stdev = get_value($imfile, REGISTER_BG_MEAN_STDEV()); 154 154 push @variances, $stdev**2; 155 155 } … … 184 184 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 185 185 $stats->add_data(@backgrounds); 186 push @command, ( '-' . PHASE0_BG() ), $stats->mean();187 push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )186 push @command, ( '-' . REGISTER_BG() ), $stats->mean(); 187 push @command, ( '-' . REGISTER_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 ) 188 188 } 189 189 { 190 190 my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator 191 191 $stats->add_data(@variances); 192 push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );192 push @command, ( '-' . REGISTER_BG_STDEV() ), sqrt( $stats->mean() ); 193 193 } 194 194 … … 214 214 unless ($success) { 215 215 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 216 warn ("Unable to run phase0 updatefor $exptag: $error_code");216 warn ("Unable to run regtool -addprocessedexp for $exptag: $error_code"); 217 217 exit($error_code); 218 218 } … … 226 226 my $name = shift; # The name of the value to check 227 227 228 my $source = $imfile->{ PHASE0_CLASSID()}; # Where it comes from228 my $source = $imfile->{REGISTER_CLASSID()}; # Where it comes from 229 229 230 230 unless (defined $imfile->{$name}) { -
trunk/ippScripts/scripts/register_imfile.pl
r12013 r12021 89 89 90 90 # Switches for regtool 91 use constant P0TOOL_MODE => '-addprocessedimfile'; # Mode for regtool92 use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id93 use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id94 use constant P0TOOL_BG_MEAN => '-bg'; # Switch to add the background95 use constant P0TOOL_BG_STDEV => '-bg_stdev'; # Switch to add the bg stdev96 use constant P0TOOL_BG_MEAN_STDEV => '-bg_mean_stdev'; # Switch to add the bg mean stdev91 use constant REGTOOL_MODE => '-addprocessedimfile'; # Mode for regtool 92 use constant REGTOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id 93 use constant REGTOOL_CLASSID => '-class_id'; # Switch to specify the class id 94 use constant REGTOOL_BG_MEAN => '-bg'; # Switch to add the background 95 use constant REGTOOL_BG_STDEV => '-bg_stdev'; # Switch to add the bg stdev 96 use constant REGTOOL_BG_MEAN_STDEV => '-bg_mean_stdev'; # Switch to add the bg mean stdev 97 97 98 98 # Look for programs we need 99 99 my $missing_tools; 100 my $regtool = can_run(' p0tool')100 my $regtool = can_run('regtool') 101 101 or (warn "Can't find regtool" and $missing_tools = 1); 102 102 my $ppStats = can_run('ppStats') … … 159 159 unless ($no_update) { 160 160 my @command; 161 push @command, $regtool, P0TOOL_MODE(), P0TOOL_EXPTAG(), $exp_tag, P0TOOL_CLASSID(), $class_id; # Command to run p0tool161 push @command, $regtool, REGTOOL_MODE(), REGTOOL_EXPTAG(), $exp_tag, REGTOOL_CLASSID(), $class_id; # Command to run regtool 162 162 163 163 foreach my $constant (keys %{CONSTANTS()}) { … … 170 170 } 171 171 172 push @command, P0TOOL_BG_MEAN();172 push @command, REGTOOL_BG_MEAN(); 173 173 if (defined $stats->bg_mean()) { 174 174 push @command, $stats->bg_mean(); … … 176 176 push @command, "NAN"; 177 177 } 178 push @command, P0TOOL_BG_STDEV();178 push @command, REGTOOL_BG_STDEV(); 179 179 if (defined($stats->bg_stdev())) { 180 180 push @command, $stats->bg_stdev(); … … 183 183 push @command, 0; 184 184 } 185 push @command, P0TOOL_BG_MEAN_STDEV();185 push @command, REGTOOL_BG_MEAN_STDEV(); 186 186 if (defined $stats->bg_mean_stdev()) { 187 187 push @command, $stats->bg_mean_stdev(); -
trunk/ippScripts/scripts/stack_skycell.pl
r12013 r12021 33 33 use Pod::Usage qw( pod2usage ); 34 34 35 my ($ p6_id, $camera, $dbname, $workdir, $no_update, $no_op);35 my ($stack_id, $camera, $dbname, $workdir, $no_update, $no_op); 36 36 GetOptions( 37 ' p6_id|d=s' => \$p6_id, # Phase 6identifier37 'stack_id|d=s' => \$stack_id, # Stack identifier 38 38 'camera|c=s' => \$camera, # Camera name 39 39 'dbname|d=s' => \$dbname, # Database name … … 45 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 46 pod2usage( 47 -msg => "Required options: -- p6_id --camera",47 -msg => "Required options: --stack_id --camera", 48 48 -exitval => 3, 49 ) unless defined $ p6_id49 ) unless defined $stack_id 50 50 and defined $camera; 51 51 … … 54 54 # Look for programs we need 55 55 my $missing_tools; 56 my $stacktool = can_run(' p6tool') or (warn "Can't find p6tool" and $missing_tools = 1);56 my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1); 57 57 my $ppStac = can_run('ppStac') or (warn "Can't find ppStac" and $missing_tools = 1); 58 58 if ($missing_tools) { … … 65 65 my $files; 66 66 { 67 my $command = "$stacktool -inputscfile - p6_id $p6_id";67 my $command = "$stacktool -inputscfile -stack_id $stack_id"; 68 68 $command .= " -dbname $dbname" if defined $dbname; 69 69 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 71 71 unless ($success) { 72 72 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 73 &my_die("Unable to perform stacktool -inputscfile: $error_code", $ p6_id, $error_code);73 &my_die("Unable to perform stacktool -inputscfile: $error_code", $stack_id, $error_code); 74 74 } 75 75 76 76 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 77 &my_die("Unable to parse metadata config doc", $ p6_id, $PS_EXIT_PROG_ERROR);77 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 78 78 $files = parse_md_list($metadata) or 79 &my_die("Unable to parse metadata list", $ p6_id, $PS_EXIT_PROG_ERROR);80 } 81 82 &my_die("Subtraction list contains more than two elements", $ p6_id, $PS_EXIT_SYS_ERROR) unless79 &my_die("Unable to parse metadata list", $stack_id, $PS_EXIT_PROG_ERROR); 80 } 81 82 &my_die("Subtraction list contains more than two elements", $stack_id, $PS_EXIT_SYS_ERROR) unless 83 83 scalar @$files >= 2; 84 84 … … 90 90 $inputList .= "$uri "; 91 91 if (defined $skycell_id) { 92 &my_die("Skycell identifiers don't match", $ p6_id, $PS_EXIT_SYS_ERROR) unless92 &my_die("Skycell identifiers don't match", $stack_id, $PS_EXIT_SYS_ERROR) unless 93 93 $file->{skycell_id} eq $skycell_id; 94 94 } else { … … 106 106 107 107 # Get the output filenames 108 my $outputFile = "$skycell_id.sub.$ p6_id"; # Root name108 my $outputFile = "$skycell_id.sub.$stack_id"; # Root name 109 109 my $outputRoot = File::Spec->catfile( $workdir, $outputFile ); 110 110 … … 123 123 unless ($success) { 124 124 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 125 &my_die("Unable to perform ppImage: $error_code", $ p6_id, $error_code);126 } 127 &my_die("Couldn't find expected output file: $outputName", $ p6_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;128 # &my_die("Couldn't find expected output file: $bin1Name", $ p6_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;129 # &my_die("Couldn't find expected output file: $bin2Name", $ p6_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;130 # &my_die("Couldn't find expected output file: $outputStats", $ p6_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;125 &my_die("Unable to perform ppImage: $error_code", $stack_id, $error_code); 126 } 127 &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $outputName; 128 # &my_die("Couldn't find expected output file: $bin1Name", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name; 129 # &my_die("Couldn't find expected output file: $bin2Name", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name; 130 # &my_die("Couldn't find expected output file: $outputStats", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats; 131 131 132 132 # Get the statistics on the residual image 133 133 if (0) { ### Disabled because ppStac doesn't output stats yet 134 134 my $statsFile; # File handle 135 open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $ p6_id, $PS_EXIT_SYS_ERROR);135 open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $stack_id, $PS_EXIT_SYS_ERROR); 136 136 my @contents = <$statsFile>; # Contents of file 137 137 close $statsFile; 138 138 my $metadata = $mdcParser->parse(join "", @contents) or 139 &my_die("Unable to parse metadata config doc", $ p6_id, $PS_EXIT_PROG_ERROR);140 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $ p6_id, $PS_EXIT_PROG_ERROR);139 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 140 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $stack_id, $PS_EXIT_PROG_ERROR); 141 141 } 142 142 } … … 152 152 # Add the subtraction result 153 153 { 154 my $command = "$stacktool -addsumscfile - p6_id $p6_id -uri $outputName -b1_uri $outputRoot";154 my $command = "$stacktool -addsumscfile -stack_id $stack_id -uri $outputName -b1_uri $outputRoot"; 155 155 $command .= " -bg $bg -bg_stdev $bg_stdev"; 156 156 $command .= " -dbname $dbname" if defined $dbname; … … 160 160 unless ($success) { 161 161 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 162 &my_die("Unable to perform stacktool -adddiffscfile: $error_code", $ p6_id, $error_code);162 &my_die("Unable to perform stacktool -adddiffscfile: $error_code", $stack_id, $error_code); 163 163 } 164 164 … … 168 168 # Register the run as completed 169 169 { 170 my $command = "$stacktool -updaterun - p6_id $p6_id -state stop"; # Command to run p6tool170 my $command = "$stacktool -updaterun -stack_id $stack_id -state stop"; # Command to run stacktool 171 171 $command .= " -dbname $dbname" if defined $dbname; 172 172 … … 185 185 { 186 186 my $msg = shift; # Warning message on die 187 my $ p6_id = shift; # Phase 5identifier187 my $stack_id = shift; # Stack identifier 188 188 my $exit_code = shift; # Exit code to add 189 189 190 190 warn($msg); 191 if ($ p6_id and not $no_update) {192 my $command = "$stacktool -updaterun - p6_id $p6_id -state stop -code $exit_code";191 if ($stack_id and not $no_update) { 192 my $command = "$stacktool -updaterun -stack_id $stack_id -state stop -code $exit_code"; 193 193 $command .= " -dbname $dbname" if defined $dbname; 194 194 system ($command); -
trunk/ippScripts/scripts/warp_imfile.pl
r12013 r12021 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($ p4_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);34 my ($warp_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op); 35 35 GetOptions( 36 ' p4_id|i=s' => \$p4_id, # Phase 4identifier36 'warp_id|i=s' => \$warp_id, # Warp identifier 37 37 'skycell_id|s=s' => \$skycell_id, # Skycell identifier 38 38 'camera|c=s' => \$camera, # Camera name … … 45 45 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 46 pod2usage( 47 -msg => "Required options: -- p4_id --skycell_id --camera",47 -msg => "Required options: --warp_id --skycell_id --camera", 48 48 -exitval => 3, 49 ) unless defined $ p4_id49 ) unless defined $warp_id 50 50 and defined $skycell_id 51 51 and defined $camera; … … 55 55 # Look for programs we need 56 56 my $missing_tools; 57 my $warptool = can_run(' p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);57 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 58 58 my $pswarp = can_run('pswarp') or (warn "Can't find pswarp" and $missing_tools = 1); 59 59 if ($missing_tools) { … … 66 66 my $imfiles; 67 67 { 68 my $command = "$warptool -imfile - p4_id $p4_id -skycell_id $skycell_id";68 my $command = "$warptool -imfile -warp_id $warp_id -skycell_id $skycell_id"; 69 69 $command .= " -dbname $dbname" if defined $dbname; 70 70 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 72 72 unless ($success) { 73 73 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 74 &my_die("Unable to perform warptool -imfile: $error_code", $ p4_id, $skycell_id, $error_code);74 &my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $skycell_id, $error_code); 75 75 } 76 76 77 77 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 78 &my_die("Unable to parse metadata config doc", $ p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);78 &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 79 79 $imfiles = parse_md_list($metadata) or 80 &my_die("Unable to parse metadata list", $ p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);80 &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 81 81 } 82 82 … … 88 88 $workdir = $dir; 89 89 } 90 my $outputFile = "$skycell_id.warp.$ p4_id"; # Root name90 my $outputFile = "$skycell_id.warp.$warp_id"; # Root name 91 91 my $outputRoot = File::Spec->catfile( $workdir, $outputFile ); 92 92 my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outputRoot, $skycell_id ); … … 113 113 unless ($success) { 114 114 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 115 &my_die("Unable to perform pswarp: $error_code", $ p4_id, $skycell_id, $error_code);115 &my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $error_code); 116 116 } 117 &my_die("Couldn't find expected output file: $outputImage", $ p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage;118 &my_die("Couldn't find expected output file: $outputStats", $ p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;119 &my_die("Couldn't find expected output file: $outputBin1", $ p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;120 &my_die("Couldn't find expected output file: $outputBin2", $ p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;117 &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage; 118 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats; 119 &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1; 120 &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2; 121 121 122 122 # Get the statistics on the warped image … … 126 126 close $statsFile; 127 127 my $metadata = $mdcParser->parse(join "", @contents) 128 or &my_die("Unable to parse metadata config", $ p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);129 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $ p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);128 or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 129 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 130 130 } 131 131 … … 140 140 # Add the processed file to the database 141 141 unless ($no_update) { 142 my $command = "$warptool -warped - p4_id $p4_id -skycell_id $skycell_id" .142 my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id" . 143 143 " -uri $outputImage -b1_uri $outputRoot"; # Command to run dettool 144 144 $command .= " -bg $bg -bg_stdev $bg_stdev"; … … 159 159 { 160 160 my $msg = shift; # Warning message on die 161 my $ p4_id = shift; # Phase 4identifier161 my $warp_id = shift; # Warp identifier 162 162 my $skycell_id = shift; # Skycell identifier 163 163 my $exit_code = shift; # Exit code to add 164 164 165 165 warn($msg); 166 if ($ p4_id and $skycell_id and not $no_update) {167 my $command = "$warptool -warped - p4_id $p4_id -skycell_id $skycell_id -code $exit_code";166 if ($warp_id and $skycell_id and not $no_update) { 167 my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id -code $exit_code"; 168 168 $command .= " -dbname $dbname" if defined $dbname; 169 169 system ($command); -
trunk/ippScripts/scripts/warp_overlap.pl
r12013 r12021 32 32 use Pod::Usage qw( pod2usage ); 33 33 34 my ($ p4_id, $dbname, $workdir, $no_update, $no_op);34 my ($warp_id, $dbname, $workdir, $no_update, $no_op); 35 35 GetOptions( 36 ' p4_id|i=s' => \$p4_id, # Phase 4identifier36 'warp_id|i=s' => \$warp_id, # Warp identifier 37 37 'dbname|d=s' => \$dbname, # Database name 38 38 'workdir|w=s' => \$workdir, # Working directory, for output files … … 43 43 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 44 44 pod2usage( 45 -msg => "Required options: -- p4_id",45 -msg => "Required options: --warp_id", 46 46 -exitval => 3, 47 ) unless defined $ p4_id;47 ) unless defined $warp_id; 48 48 49 49 # Look for programs we need 50 50 my $missing_tools; 51 my $warptool = can_run(' p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);51 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 52 52 #my $overlap = can_run('overlap') or (warn "Can't find overlap" and $missing_tools = 1); 53 53 if ($missing_tools) { … … 59 59 my $imfiles; 60 60 { 61 my $command = "$warptool -imfile - p4_id $p4_id";61 my $command = "$warptool -imfile -warp_id $warp_id"; 62 62 $command .= " -dbname $dbname" if defined $dbname; 63 63 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 65 65 unless ($success) { 66 66 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 67 &my_die("Unable to perform warptool -imfile: $error_code", $ p4_id, $error_code);67 &my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $error_code); 68 68 } 69 69 70 70 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 71 71 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 72 &my_die("Unable to parse metadata config doc", $ p4_id, $PS_EXIT_PROG_ERROR);72 &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_PROG_ERROR); 73 73 $imfiles = parse_md_list($metadata) or 74 &my_die("Unable to parse metadata list", $ p4_id, $PS_EXIT_PROG_ERROR);74 &my_die("Unable to parse metadata list", $warp_id, $PS_EXIT_PROG_ERROR); 75 75 } 76 76 … … 90 90 # Generate a MDC file with the overlaps 91 91 $workdir = $ipprc->convert_filename_absolute( $workdir ); 92 my $overlapName = File::Spec->catfile( $workdir, $ p4_id . '.overlap.mdc' );92 my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' ); 93 93 open my $overlapFile, "> $overlapName" or 94 &my_die("Unable to open mdc file $overlapName", $ p4_id, $PS_EXIT_DATA_ERROR);95 print $overlapFile " p4SkyCellMap MULTI\n\n";94 &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR); 95 print $overlapFile "warpSkyCellMap MULTI\n\n"; 96 96 foreach my $imfile (@$imfiles) { 97 print $overlapFile " p4_id\t\tS32\t" . $imfile->{p4_id} . "\n";97 print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n"; 98 98 print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n"; 99 99 print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n"; … … 106 106 # Add the processed file to the database 107 107 unless ($no_update) { 108 my $command = "$warptool -addoverlap - p4_id $p4_id -info $overlapName"; # Command to run p4tool108 my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool 109 109 $command .= " -dbname $dbname" if defined $dbname; 110 110 … … 125 125 { 126 126 my $msg = shift; # Warning message on die 127 my $ p4_id = shift; # Phase 4identifier127 my $warp_id = shift; # Warp identifier 128 128 my $exit_code = shift; # Exit code to add 129 129 130 130 warn($msg); 131 if ($ p4_id and not $no_update) {132 my $command = "$warptool -addoverlap - p4_id $p4_id -code $exit_code";131 if ($warp_id and not $no_update) { 132 my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code"; 133 133 $command .= " -dbname $dbname" if defined $dbname; 134 134 system ($command);
Note:
See TracChangeset
for help on using the changeset viewer.
