I am being stupid. Either that, or less likely, the documentation in PDL::IO::FITS is wrong.
I have a FITS image in which each pixel is a 32-bit float. That is, BITPIX == -32. I wish to convert it to 32-bit fixed-point format, where BITPIX == 16.
This is my script.
#! /usr/bin/perl
use strict;
use warnings;
use PDL;
use PDL::IO::FITS;
my $x = rfits('foo.fits');
$x->wfits('bar.fits', 16);
And here is what happens:
pcl@nut:~/Astro/Code$ imhead foo.fits | grep BITPIX BITPIX = -32 / pcl@nut:~/Astro/Code$ perl to_int.pl pcl@nut:~/Astro/Code$ imhead bar.fits | grep BITPIX BITPIX = -32
The output file is not converted to 16-bit unsigned format, despite what the documentation appears to say.
What am I not understanding and how do I get data conversion?
In reply to Data conversion of FITS images in PDL by Xilman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |