Changeset 12043 for trunk/ippScripts/scripts/warp_overlap.pl
- Timestamp:
- Feb 23, 2007, 6:07:01 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/warp_overlap.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
