I have an image of a field of stars in the night sky as captured by Unistellar's eVscope2. I've downloaded it in .fits format. It opens fine in irfanView (mostly gray scale). But when I read it into a matlab two dimensional data array using
data=fitsread('stars.fits');
and use
imagesc(data)
it has a blue hue to it.
The numbers range from 0 to 2^15 -1, with most of them being in the range 4000 to 12000
I'm not quite sure what color mapping Unistellar uses, but IrfanView appears to be able to figure it out. I'm guessing it is 16 bit RGB.
If data
is a 2D array, as in your case, imagesc
scales the values and uses whichever colormap you have specified in the figure, or parula
by default.
The documentation of the colormap
function illustrates other readily avaialble colormaps that you can use; and explains how to define a custom one in terms of RGB values. For example, if you want a grey colormap with 256
levels use
colormap(gray(256))
Another nice collection of colormaps is ColorCET
. These have the desirable feature of being perceptually uniform, as are some of Matlab's native colormaps such as parula
.