Changeset 12043
- Timestamp:
- Feb 23, 2007, 6:07:01 PM (19 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 3 edited
-
diff_skycell.pl (modified) (4 diffs)
-
warp_imfile.pl (modified) (12 diffs)
-
warp_overlap.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/diff_skycell.pl
r12021 r12043 65 65 my $files; 66 66 { 67 my $command = "$difftool -inputs cfile -diff_id $diff_id";67 my $command = "$difftool -inputskyfile -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 -inputs cfile: $error_code", $diff_id, $error_code);73 &my_die("Unable to perform difftool -inputskyfile: $error_code", $diff_id, $error_code); 74 74 } 75 75 … … 160 160 # Add the subtraction result 161 161 { 162 my $command = "$difftool -adddiffs cfile -diff_id $diff_id -uri $outputName -b1_uri $outputRoot";162 my $command = "$difftool -adddiffskyfile -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 -adddiffs cfile: $error_code", $diff_id, $error_code);170 &my_die("Unable to perform difftool -adddiffskyfile: $error_code", $diff_id, $error_code); 171 171 } 172 172 -
trunk/ippScripts/scripts/warp_imfile.pl
r12021 r12043 16 16 use PS::IPP::Metadata::Config; 17 17 use PS::IPP::Metadata::Stats; 18 use PS::IPP::Metadata::List qw( parse_md_list ); 18 19 19 20 use PS::IPP::Config qw( … … 32 33 use Pod::Usage qw( pod2usage ); 33 34 34 my ($warp_id, $skycell_id, $ camera, $dbname, $workdir, $no_update, $no_op);35 my ($warp_id, $skycell_id, $tess_id, $camera, $dbname, $workdir, $no_update, $no_op); 35 36 GetOptions( 36 37 'warp_id|i=s' => \$warp_id, # Warp identifier 37 38 'skycell_id|s=s' => \$skycell_id, # Skycell identifier 39 'tess_id|s=s' => \$tess_id, # Tesselation identifier 38 40 'camera|c=s' => \$camera, # Camera name 39 41 'dbname|d=s' => \$dbname, # Database name … … 45 47 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 46 48 pod2usage( 47 -msg => "Required options: --warp_id --skycell_id -- camera",49 -msg => "Required options: --warp_id --skycell_id --tess_id --camera", 48 50 -exitval => 3, 49 51 ) unless defined $warp_id 50 52 and defined $skycell_id 53 and defined $tess_id 51 54 and defined $camera; 52 55 … … 66 69 my $imfiles; 67 70 { 68 my $command = "$warptool - imfile -warp_id $warp_id -skycell_id $skycell_id";71 my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id"; 69 72 $command .= " -dbname $dbname" if defined $dbname; 70 73 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 72 75 unless ($success) { 73 76 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 74 &my_die("Unable to perform warptool - imfile: $error_code", $warp_id, $skycell_id, $error_code);77 &my_die("Unable to perform warptool -scmap: $error_code", $warp_id, $skycell_id, $tess_id, $error_code); 75 78 } 76 79 77 80 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 78 &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $ PS_EXIT_PROG_ERROR);81 &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR); 79 82 $imfiles = parse_md_list($metadata) or 80 &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $ PS_EXIT_PROG_ERROR);83 &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR); 81 84 } 82 85 … … 85 88 $workdir = $ipprc->convert_filename_absolute( $workdir ); 86 89 } else { 87 my ($vol, $dir, $file) = File::Spec->splitpath( $$imfiles[0]->{uri} ); 90 my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} ); 91 my ($vol, $dir, $file) = File::Spec->splitpath( $example ); 88 92 $workdir = $dir; 89 93 } … … 97 101 98 102 # Get list of filenames 99 open my $listFile, '>' . $listName;103 open my $listFile, "> $listName" or &my_die("Unable to open $listName", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR); 100 104 foreach my $imfile (@$imfiles) { 101 105 my $uri = $ipprc->convert_filename_absolute( $imfile->{uri} ); … … 115 119 &my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $error_code); 116 120 } 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 &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage; 122 &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats; 123 &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1; 124 &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $tess_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2; 121 125 122 126 # Get the statistics on the warped image … … 126 130 close $statsFile; 127 131 my $metadata = $mdcParser->parse(join "", @contents) 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);132 or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR); 133 $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $tess_id, $PS_EXIT_PROG_ERROR); 130 134 } 131 135 … … 140 144 # Add the processed file to the database 141 145 unless ($no_update) { 142 my $command = "$warptool - warped -warp_id $warp_id -skycell_id $skycell_id" .143 " -uri $outputImage -b1_uri $outputRoot"; # Command to run dettool146 my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id" . 147 " -uri $outputImage"; # -b1_uri $outputRoot"; # Command to run dettool 144 148 $command .= " -bg $bg -bg_stdev $bg_stdev"; 145 149 $command .= " -dbname $dbname" if defined $dbname; … … 149 153 unless ($success) { 150 154 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 151 warn("Unable to perform warptool -addwarped imfile: $error_code\n");155 warn("Unable to perform warptool -addwarped: $error_code\n"); 152 156 exit($error_code); 153 157 } … … 161 165 my $warp_id = shift; # Warp identifier 162 166 my $skycell_id = shift; # Skycell identifier 167 my $tess_id = shift; # Tesselation identifier 163 168 my $exit_code = shift; # Exit code to add 164 169 165 170 warn($msg); 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";171 if ($warp_id and $skycell_id and $tess_id and not $no_update) { 172 my $command = "$warptool -addwarped -warp_id $warp_id -skycell_id $skycell_id -tess_id $tess_id -code $exit_code"; 168 173 $command .= " -dbname $dbname" if defined $dbname; 169 174 system ($command); -
trunk/ippScripts/scripts/warp_overlap.pl
r12021 r12043 16 16 use PS::IPP::Metadata::Config; 17 17 use PS::IPP::Metadata::Stats; 18 use PS::IPP::Metadata::List qw( parse_md_list ); 18 19 19 20 use PS::IPP::Config qw( … … 84 85 $imfile->{skycell_id} = 'default'; 85 86 $imfile->{tess_id} = 'default'; 87 $imfile->{fault} = 0; 86 88 } 87 89 } 88 90 91 if (defined $workdir) { 92 $workdir = $ipprc->convert_filename_absolute( $workdir ); 93 } else { 94 my $example = $ipprc->convert_filename_absolute( $$imfiles[0]->{uri} ); 95 my ($vol, $dir, $file) = File::Spec->splitpath( $example ); 96 $workdir = $dir; 97 } 89 98 90 99 # Generate a MDC file with the overlaps 91 $workdir = $ipprc->convert_filename_absolute( $workdir ); 92 my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' ); 93 open my $overlapFile, "> $overlapName" or 94 &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR); 100 my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' ); 101 open my $overlapFile, "> $overlapName" or die "Unable to open mdc file $overlapName"; 95 102 print $overlapFile "warpSkyCellMap MULTI\n\n"; 96 103 foreach my $imfile (@$imfiles) { 97 print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n"; 98 print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n"; 99 print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n"; 100 print $overlapFile "exp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n"; 101 print $overlapFile "p3_version\tS32\t" . $imfile->{p3_version} . "\n"; 102 print $overlapFile "class_id\t\tSTR\t" . $imfile->{class_id} . "\n"; 104 print $overlapFile "warpSkyCellMap\tMETADATA\n"; 105 print $overlapFile "\twarp_id\tS32\t" . $warp_id . "\n"; 106 print $overlapFile "\tskycell_id\tSTR\t" . $imfile->{skycell_id} . "\n"; 107 print $overlapFile "\ttess_id\t\tSTR\t" . $imfile->{tess_id} . "\n"; 108 print $overlapFile "\texp_tag\t\tSTR\t" . $imfile->{exp_tag} . "\n"; 109 print $overlapFile "\tcam_version\tS32\t" . $imfile->{cam_version} . "\n"; 110 print $overlapFile "\tclass_id\t\tSTR\t" . $imfile->{class_id} . "\n"; 111 print $overlapFile "\tfault\tS16\t" . $imfile->{fault} . "\n"; 112 print $overlapFile "END\n\n"; 103 113 } 104 114 close $overlapFile; … … 106 116 # Add the processed file to the database 107 117 unless ($no_update) { 108 my $command = "$warptool -addoverlap - warp_id $warp_id -info$overlapName"; # Command to run warptool118 my $command = "$warptool -addoverlap -mapfile $overlapName"; # Command to run warptool 109 119 $command .= " -dbname $dbname" if defined $dbname; 110 120 … … 129 139 130 140 warn($msg); 131 if ($warp_id and not $no_update) { 132 my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code"; 133 $command .= " -dbname $dbname" if defined $dbname; 134 system ($command); 135 } 141 142 # No failure option on warptool for this mode, so just die. 136 143 exit $exit_code; 137 144 }
Note:
See TracChangeset
for help on using the changeset viewer.
