Changeset 22430 for trunk/ippScripts/scripts/magic_tree.pl
- Timestamp:
- Feb 24, 2009, 12:00:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_tree.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_tree.pl
r20762 r22430 31 31 32 32 use constant MAX_FIELDS => 4; # Maximum number of fields to be in a node 33 34 # Look for programs we need 35 my $missing_tools; 36 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1); 37 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 38 if ($missing_tools) { 39 warn("Can't find required tools."); 40 exit($PS_EXIT_CONFIG_ERROR); 41 } 33 42 34 43 # Parse the command-line arguments … … 61 70 defined $outroot; 62 71 72 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 73 $SIG{__DIE__} = sub { die @_ if $^S; 74 my_die( $_[0], $magic_id, $PS_EXIT_UNKNOWN_ERROR ); }; 75 63 76 $ipprc->define_camera($camera); 64 77 65 78 $ipprc->redirect_output($logfile) if $logfile; 66 67 # Look for programs we need68 my $missing_tools;69 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1);70 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);71 if ($missing_tools) {72 warn("Can't find required tools.");73 exit($PS_EXIT_CONFIG_ERROR);74 }75 79 76 80 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 96 100 &my_die("Unable to parse metadata list", $magic_id, $PS_EXIT_PROG_ERROR); 97 101 98 # make a hash indexed by skycell_id 102 # make a hash indexed by skycell_id 99 103 foreach my $warp ( @$warps ) { 100 104 my $skycell_id = $warp->{skycell_id}; … … 156 160 157 161 my ($header, $status) = (undef, 0); 158 my $fits = Astro::FITS::CFITSIO::open_file( $skyfileResolved, READONLY, $status ); 162 my $fits = Astro::FITS::CFITSIO::open_file( $skyfileResolved, READONLY, $status ); 159 163 &my_die("failed to open skycell file: $skyfileResolved: $status", $magic_id, $PS_EXIT_SYS_ERROR) if $status; 160 164 161 165 ($header, $status) = Astro::FITS::CFITSIO::fits_read_header( $fits ); 162 166 163 167 &my_die("Unable to read skycell header: $status", $magic_id, $PS_EXIT_SYS_ERROR) if $status; 164 168 … … 171 175 $naxis2 = $$header{'NAXIS2'} or &my_die("Can't find NAXIS2", $magic_id, $PS_EXIT_SYS_ERROR); 172 176 } else { 173 # if the skyfile is compressed then the WCS won't be in the primary header, move to the 177 # if the skyfile is compressed then the WCS won't be in the primary header, move to the 174 178 # extension 175 179 my $hdutype; … … 257 261 my $node = shift @tasks; 258 262 divide_node($node, \@tasks); 259 } 263 } 260 264 261 265 ### Format tree for magictool
Note:
See TracChangeset
for help on using the changeset viewer.
