Changeset 20762
- Timestamp:
- Nov 16, 2008, 1:39:04 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_tree.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_tree.pl
r20674 r20762 167 167 # my $naxis1 = $$header{'NAXIS1'} or &my_die("Can't find NAXIS1", $magic_id, $PS_EXIT_SYS_ERROR); 168 168 my $naxis1 = $$header{'NAXIS1'}; 169 if (!$naxis1) { 170 # XXX: if the skyfile is compressed then the WCS won't be in the primary header 169 my $naxis2; 170 if ($naxis1) { 171 $naxis2 = $$header{'NAXIS2'} or &my_die("Can't find NAXIS2", $magic_id, $PS_EXIT_SYS_ERROR); 172 } else { 173 # if the skyfile is compressed then the WCS won't be in the primary header, move to the 174 # extension 171 175 my $hdutype; 172 176 $fits->movrel_hdu(1, $hdutype, $status); … … 175 179 ($header, $status) = Astro::FITS::CFITSIO::fits_read_header( $fits ); 176 180 &my_die("Unable to read extension header: $status", $magic_id, $PS_EXIT_SYS_ERROR) if $status; 177 $naxis1 = $$header{'NAXIS1'} or &my_die("Can't find NAXIS1", $magic_id, $PS_EXIT_SYS_ERROR); 178 } 179 my $naxis2 = $$header{'NAXIS2'} or &my_die("Can't find NAXIS2", $magic_id, $PS_EXIT_SYS_ERROR); 181 my $xtension = $$header{'XTENSION'} or &my_die("Can't find XTENSION", $magic_id, $PS_EXIT_SYS_ERROR); 182 &my_die("XTENSION found: $xtension", $magic_id, $PS_EXIT_SYS_ERROR) if $xtension ne "'BINTABLE'"; 183 $naxis1 = $$header{'ZNAXIS1'} or &my_die("Can't find ZNAXIS1", $magic_id, $PS_EXIT_SYS_ERROR); 184 $naxis2 = $$header{'ZNAXIS2'} or &my_die("Can't find ZNAXIS2", $magic_id, $PS_EXIT_SYS_ERROR); 185 } 180 186 my $ctype1 = $$header{'CTYPE1'} or &my_die("Can't find CTYPE1", $magic_id, $PS_EXIT_SYS_ERROR); 181 187 my $ctype2 = $$header{'CTYPE2'} or &my_die("Can't find CTYPE2", $magic_id, $PS_EXIT_SYS_ERROR); … … 347 353 my $contents = $node->{contents} or die "Can't find contents of node."; # Contents of node 348 354 355 if ($position eq 'root' and scalar @$contents <= 4) { 356 # don't need to divide, but do we need to sort? 357 return; 358 } 359 349 360 my ($lower, $upper) = divide_list($contents, 'xi'); 350 361
Note:
See TracChangeset
for help on using the changeset viewer.
