Group Abstract Group Abstract

Message Boards Message Boards

1
|
8K Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Read FITS unsigned integers with Mathematica 12?

Posted 5 years ago

I've been using Mathematica to process FITS for years, but it has changed in version 12. Import now yields an Association rather than an Image. OK, extract item 1 from the Association, that's an Image. But it isn't right. A small test file shows the problem:

ImageData[Import["test.fits"][[1]]]

yields a matrix full of tiny numbers like 2.81374*10^-307. This is impossible. The header has:

BITPIX = 32 / array data type

BSCALE = 1

BZERO = 2147483648

This is the conventional declaration of 32 bit unsigned integers. Apparently, these are misinterpreted as floating point.

Is this a bug, or have I missed another change?

Attachments:
POSTED BY: John Doty
2 Replies
POSTED BY: Mikayel Egibyan

Thank you Mikayel. It works. The only problem is that extracts exact integers, making calculations slow, but N[] fixes that.

POSTED BY: John Doty
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard