64-bit floating point numbers

I have a FITS file with array data type listed as
BITPIX = -64
This should be read as 64-bit float, but instead the message “FITS images with 64 bits signed integer per pixel.channel are not supported” when I try to convert it to SIRIL format.

Thank you for reading.

Hi, sorry, this is probably a programming error… We’ll try to fix it soon.

Please, could you share your file.
This message should only occur for images that are LONGLONG_IMG as set by cfitsio specs.

powerspecstf848_Light_001.fits (132.2 KB)

Thank you!

OK. I can open the file but the data is incorrectly read.
But no error message. Which tool gives you the error?

Oh ok I get it.
It is double but… not in the range [0, 1] as siril expects. Those are kind of files I never know what I have to do with.

The file is created via python-numpy-astropy fits.PrimaryHDU from an array computed from an image input as integers (from ZWO 16 bit camera).

If I cast to single precision, siril converts without complaint. But the values are not scaled to [0,1). Should they be?

powerspecstf848_Light_001.fits (67.5 KB)

OK. I will take a look tonight to apply same workaround we did use for float images.

OK. It is not read as it should be.
In fact the issue is how we can know about the range of your files. There is no standardand your header has not a lof of information.
Could you save your file in the [0, 1] range ? Because this is the assumption of siril and that would be the best option.
Here I don’t know what I can do in fact. If I fix for your file it will be broken for [0, 1] files.

We could compute the maximum value before opening the file but that would kill performance.

Argh! I’m afraid I was being a bit mindless. I had been using Siril to stack images, but it’s really a different matter to average their power spectra despite the formal similarity.

I will think at a solution.

Mark, the problem is that we had to normalize images somehow, to be able to display them correctly and to convert from integer values (like raw images). A max value of seemed good enough because it’s simple, a quarter of the precision offered by 32-bit representation is available between 0 and 1, and that’s also what other software do.
If you have an idea what the maximum power you could ever handle is, just divide your spectral radiance or whatever this is by it and it should work?

1 Like

The problem is that FLOAT images are either in the [0, 1] range or in a [0.0, 65535.0] range (with float values).
Here, the max value seems to be very high!!! outside from this range.
It is possible to read the image, PI and ds9 are doing this. But I need to understand what is the best way to do it without killing performance.

Yes, with the images I was using, power spectra, the values are positive and the maximum is at the origin (before shifting). Scaling by this value and rounding to 32 bits results in acceptable input for Siril.

Good to know. Thank you!