This notebook shows how to show data in the WorldWide Telescope Jupyter widget, specifically on the surface of a planet. You can find out more about using pywwt in the documentation.
We start off by importing the WWTJupyterWidget
class:
from pywwt.jupyter import WWTJupyterWidget
We then 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
Once the widget appears, you can then use the wwt
object to change the current view to the Earth:
wwt.set_view('Earth')
Finally we load a dataset and add a data layer in WWT:
from astropy.table import Table
EARTHQUAKES = 'https://worldwidetelescope.github.io/pywwt/data/earthquakes_2010.csv'
table = Table.read(EARTHQUAKES, delimiter=',', format='ascii.basic', fast_reader=False)
layer = wwt.layers.add_data_layer(table=table, frame='Earth', lon_att='longitude', lat_att='latitude', color='red')