FITS.pm (PDL-2.082) | : | FITS.pm (PDL-2.083) | ||
---|---|---|---|---|
skipping to change at line 306 | skipping to change at line 306 | |||
Read only the header of a FITS file or an extension within it. | Read only the header of a FITS file or an extension within it. | |||
This is syntactic sugar for the C<data=E<gt>0> option to L<rfits|/rfits()>. | This is syntactic sugar for the C<data=E<gt>0> option to L<rfits|/rfits()>. | |||
See L<rfits|/rfits()> for details on header handling. rfitshdr() runs | See L<rfits|/rfits()> for details on header handling. rfitshdr() runs | |||
the same code to read the header, but returns it rather than | the same code to read the header, but returns it rather than | |||
reading in a data structure as well. | reading in a data structure as well. | |||
=cut | =cut | |||
our $rfits_options = new PDL::Options( { bscale=>1, data=>1, hdrcpy=>0, expand=> 1, afh=>1 } ); | our $rfits_options = PDL::Options->new( { bscale=>1, data=>1, hdrcpy=>0, expand= >1, afh=>1 } ); | |||
sub PDL::rfitshdr { | sub PDL::rfitshdr { | |||
my $class = shift; | my $class = shift; | |||
my $file = shift; | my $file = shift; | |||
my $u_opt = ifhref(shift); | my $u_opt = ifhref(shift); | |||
$u_opt->{data} = 0; | $u_opt->{data} = 0; | |||
PDL::rfits($class,$file,$u_opt); | PDL::rfits($class,$file,$u_opt); | |||
} | } | |||
sub PDL::rfits { | sub PDL::rfits { | |||
skipping to change at line 1799 | skipping to change at line 1799 | |||
if(length($k) > 8 or | if(length($k) > 8 or | |||
$k !~ m/^[A-Z_][A-Z\d\_]*$/i | $k !~ m/^[A-Z_][A-Z\d\_]*$/i | |||
) { | ) { | |||
$all_valid_fits = 0; | $all_valid_fits = 0; | |||
last; | last; | |||
} | } | |||
} | } | |||
if($all_valid_fits) { | if($all_valid_fits) { | |||
# All the keys look like valid FITS header keywords -- so | # All the keys look like valid FITS header keywords -- so | |||
# create a tied FITS header object and use that instead. | # create a tied FITS header object and use that instead. | |||
my $afh = new Astro::FITS::Header( ); | my $afh = Astro::FITS::Header->new; | |||
my %hh; | my %hh; | |||
tie %hh, "Astro::FITS::Header", $afh; | tie %hh, "Astro::FITS::Header", $afh; | |||
for (keys %$h) { | for (keys %$h) { | |||
$hh{$_} = $h->{$_}; | $hh{$_} = $h->{$_}; | |||
} | } | |||
$h = \%hh; | $h = \%hh; | |||
} | } | |||
} | } | |||
# ordered hash with type and comment capability | # ordered hash with type and comment capability | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |