Hi John,
There was indeed an issue with the Image
object returned from FITS files for specific data types, but that issue is fixed and will be available with the soonest update.
Let me show you, what it looks like now.
The file that you have attached has a data type of "UnsignedInteger32"
.
In[1]:= f = FindFile["~/Downloads/test.fits"];
Import[f, {"DataType", 1}]
Out[2]= "UnsignedInteger32"
Now, if we look at what types does Image
object support:
We can't fit one into another, thus we try to put the data into the largest possible container; that is Real64
.
It is really easy to test that result is actually what it should be (let's forget about data types for a second):
In[3]:= d = Import[f, {"Data", 1}];
i = Import[f, {"Image", 1}] // ImageData;
AllTrue[Flatten[i - d], PossibleZeroQ]
Out[5]= True
The above is exactly what was broken in V12; Out[5]= False
Since we don't have any restriction on raw data type, you can import it as-is:
In[6]:= Import[f, {"Data", 1}]
Out[6]= {{4803970, 4803214, 4804757, 4805016, 4804905, 4805127,
4805053, 4805090, 4805164, 4805201}, {4805314, 4726765, 4726804,
4726687, 4726687, 4726609, 4726570, 4726494, 4726456,
4726190}, {4724560, 4727196, 4751536, 4752196, 4753859, 4753970,
4754007, 4754081, 4754007, 4753896}, {4754044, 4754081, 4754156,
4451552, 4451636, 4451594, 4451510, 4451468, 4451552,
4451468}, {4451510, 4451384, 4449760, 4450967, 4924137, 4929428,
4915686, 4905894, 4904530, 4905646}, {4903174, 4903051, 4903789,
4903174, 4902559, 4904158, 4905026, 4902928, 4902070,
4903420}, {4903174, 4903420, 4903174, 4902928, 4903420, 4902314,
4897832, 4900122, 4918296, 4923869}, {4903543, 4909155, 4913102,
4907144, 4909029, 4909281, 4925754, 4965549, 4998644,
5014451}, {4921998, 4894503, 4893913, 4893327, 4894857, 4892157,
4897712, 4960496, 5177710, 5027593}, {4900728, 4889152, 4889727,
4891809, 4890997, 4890417, 4894621, 4893093, 4886646, 4884844}}
This is also the way to a workaround for the issue in V12:
In[7]:= iManual = ImageData[Image[%, "Real64"]];
AllTrue[Flatten[iManual - d], PossibleZeroQ]
Out[8]= True
Hope this helps. Please feel free to get back if you have more questions.
Best,
Mikayel