Using data layers to plot points on the surface of planets

This notebook shows how to plot tabular data on the surface of a planet using the AAS WorldWide Telescope through pywwt. You can find out more about using pywwt in the documentation.

First, we need to connect to the WWT app. If WWT isn't running yet, activate the JupyterLab command palette from the View menu, and select "AAS WorldWide Telescope". Then all we need to do is run:

In [ ]:
from pywwt.jupyter import connect_to_app
wwt = await connect_to_app().becomes_ready()

Now the wwt variable will let us talk to the WWT app.

In [ ]:
wwt.set_view('Earth')

Finally we load a dataset and add a data layer in WWT:

In [ ]:
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)
In [ ]:
layer = wwt.layers.add_data_layer(table=table, frame='Earth', lon_att='longitude', lat_att='latitude', color='red')

Credits

This notebook was prepared by Thomas Robitaille.