5 Setting the intensity range#

Display the image#

Load and display the image:

f = io.imread("hdfs.tiff")
plt.figure(figsize=(6,6))
plt.imshow(f, cmap="gray")
plt.show()
../_images/9c9c6c372aa57710a3da947fc5c0bc83a8317ac6adb8110115832bcafda66ed3.png

This image corresponds to a portion of the sky in the southern hemisphere called the Hubble Deep Field South. It was acquired by the MUSE sensor installed on the VLT in Chile. It is obtained by averaging around 4000 bands of the original image: we speak of a hyperspectral image (source: Bacon et al., “The MUSE 3D view of the Hubble Deep Field South”, Astronomy & Astrophysics, 2015).

Although only a small star can be seen, there are many other astronommimcal objects. Since these objects are very distant, they are very faint. In astronomy, as in many other science fields, the pixel intensity is not limited to 256 values. In this case, the intensities lie over the range given below:

print("Mininmal intensity: %d" % f.min())
print("Maximal intensity: %d" % f.max())
Mininmal intensity: 625722
Maximal intensity: 628454834

Choose a better colormap#

Therefore, to observe the other objects, we will adjust the colormap so that the gray levels will lie between vmin and vmax. Intensities less than vmin will be displayed in black, intensities greater than vmax will be displayed in white, and intensities in between will be displayed with the different levels or gray. It’s up to you to find these values to get an image like the one below, where other stars and galaxies are clearly visible (and the brightest star is saturated).

../_images/25ce0a3b3f559b2c5488c8decf525fe0e9a7d5d988d68a69d2806701b6f1982d.png

Another possibility is to use colors to increase the dynamics of the intensities observed. The jet colormap is used in the example below, with the the same vmin and vmax as before. We observe a few more objects.

../_images/ba4a2e56163c54166da6904f826c72b052fdce5c2e33f6f496b2c1a3fbe75e17.png