Visualizing Planet Tanager Data Interactively with HyperCoast¶
This notebook demonstrates how to visualize the Planet Tanager hyperspectral data interactively with HyperCoast.
Tanager-1 (launched August 2024) carries a high-precision Dyson imaging spectrometer onboard Planet’s next-generation smallsat bus. Tanager provides high spectral resolution (~5 nm) across the full 380–2500 nm VSWIR spectral range. For more details, please refer to the Planet Tanager data release page.
Install packages¶
Uncomment the following line to install the packages.
# %pip install hypercoast
Import libraries¶
import hypercoast
Find Tanager data¶
Browse the Tanager data on the Planet STAC browser. Find the data you want to visualize.
For example, we want to visualize the data of the coastal water bodies in the San Francisco Bay area. Click on the "Copy URL" button to get the direct URL of the data.
Download Tanager data¶
Once you have the URL of the data, you can download the data using the following code:
url = "https://storage.googleapis.com/open-cogs/planet-stac/release1-basic-radiance/20250514_193937_64_4001_basic_radiance.h5"
file_path = hypercoast.download_file(url)
Read Tanager data¶
We can read the Tanager data using the read_tanager
function. It will return a xarray.Dataset
object. The toa_radiance
variable is the top of atmosphere radiance. It has 426 spectral bands. Note that the dataset is not gridded. We will need to interpolate the data to a regular grid for visualization on an interactive map.
dataset = hypercoast.read_tanager(file_path)
dataset
Visualize Tanager data¶
Let's visualize the Tanager data on an interactive map. Specify the bands to visualize. You can visualize the data in the spectral space or the RGB space.
m = hypercoast.Map()
m.add_tanager(dataset, bands=[100, 60, 50], vmin=0, vmax=120, layer_name="Tanager")
m
Alternatively, you can visualize a single band of the Tanager data and specify a colormap.
m = hypercoast.Map()
m.add_tanager(dataset, bands=[100], colormap="jet", layer_name="Tanager")
m
Change band combinations interactively¶
To change the band combinations interactively, you can use spectral tool to select the bands you want to visualize.
m = hypercoast.Map()
m.add_tanager(dataset, bands=[100, 60, 50])
m.add("spectral")
m
Visualize spectral signatures¶
To visualize the spectral signatures, you can use the spectral
tool. Simply click on the map to visualize the spectral signatures.
m = hypercoast.Map()
m.add_tanager(dataset, bands=[100, 60, 50])
m.add("spectral")
m
Save spectral signatures¶
To save the spectral signatures, click on the Save button in the spectral tool.