Example: Mars rover#
Learn how to create a Trelliscope display of images from the Mars rover Curiosity.

Pre-Generated Images#
The basic principle behind the Trelliscope package is that you specify a data frame that contains figures or images. We refer to each plot (row) of a given visualization (column) as a panel, and hence will often refer to a visualization column as a collection of panels.
The simplest way to illustrate what is meant by a data frame of visualizations is to start with an example where the images have already been generated.
An example dataset that comes with the package contains images captured by the Mars rover Curiosity.
Creating a Trelliscope#
This data frame has a column that references images on the web, img_src. The other columns contain metadata about these images. We can create a Trelliscope object, write its display information out to the file system, and view it in a browser with the following:
[1]:
from trelliscope import Trelliscope
from trelliscope.examples.get_data import get_example_data
# load example data
df_mars = get_example_data("mars_rover")
# Create Trelliscope and open it in a new browser tab
tr = (
Trelliscope(df_mars, name="Mars Rover")
.write_display()
.view_trelliscope()
)
INFO:root:Using ['camera', 'earth_date', 'class', 'img_src'] to uniquely identify each row of the data.
INFO:root:Saving to /tmp/tmp4gbjnrht/mars_rover
INFO:root:No layout definition supplied. Using Default.
INFO:root:No labels definition supplied. Using Default.
INFO:root:Trelliscope written to `/tmp/tmp4gbjnrht/mars_rover`
[2]:
df_mars.head()
[2]:
| camera | sol | earth_date | class | img_src | |
|---|---|---|---|---|---|
| 0 | Mars Hand Lens Imager | 565 | 2014-03-09 | horizon | http://mars.jpl.nasa.gov/msl-raw-images/msss/0... |
| 1 | Mars Hand Lens Imager | 565 | 2014-03-09 | horizon | http://mars.jpl.nasa.gov/msl-raw-images/msss/0... |
| 2 | Mars Hand Lens Imager | 568 | 2014-03-12 | wheel | http://mars.jpl.nasa.gov/msl-raw-images/msss/0... |
| 3 | Mars Hand Lens Imager | 568 | 2014-03-12 | wheel | http://mars.jpl.nasa.gov/msl-raw-images/msss/0... |
| 4 | Mars Hand Lens Imager | 568 | 2014-03-12 | wheel | http://mars.jpl.nasa.gov/msl-raw-images/msss/0... |
[ ]: