In this notebook, we will visualize a WISE 12µm image towards the Westerhout 5 star forming region, and we will take a look at some of the advanced visualization options.
We first import the WWTJupyterWidget
class:
from pywwt.jupyter import WWTJupyterWidget
and we use this class to create the widget (note that the second wwt
is needed to actually show the contents of the widget):
wwt = WWTJupyterWidget()
wwt
We are now ready to add the image data to WWT. We start off by calling add_image_layer
to create the layer, and specify the name of the file:
import os
layer = wwt.layers.add_image_layer(os.path.join('..', 'data', 'w5.fits'))
WWT will automatically pan to the image. We can now show some controls to help us fine tune the appearance of the image:
layer.controls
Here you can change the colormap, stretch, opacity (which you can use to compare the image to the background, or to another image). You can then also set the min/max of the stretch, and use the slider at the bottom to fine tune these values.
If you prefer, you can also change these parameters programmatically:
layer.cmap = 'plasma'
layer.vmin = 400
layer.vmax = 2000
layer.stretch = 'sqrt'
layer.opacity = 0.9
Note that when you make the change programmatically, the control widgets update to mirror what you did. Fancy!