Visualizing EMIT data interactively with HyperCoast¶
This notebook demonstrates how to visualize Earth Surface Mineral Dust Source Investigation (EMIT) data interactively with HyperCoast. This notebook is inspired by the EMIT data visualization tutorial - Exploring_EMIT_L2A_Reflectance.ipynb. We have made it much easier to visualize the data interactively with HyperCoast.
# %pip install hypercoast
import hypercoast
Download a sample EMIT data file from here.
url = "https://github.com/opengeos/datasets/releases/download/netcdf/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
filepath = "data/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
hypercoast.download_file(url, filepath)
'/home/runner/work/HyperCoast/HyperCoast/docs/examples/data/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc'
Load the dataset as a xarray.Dataset
object.
dataset = hypercoast.read_emit(filepath)
Visualize the data interactively with HyperCoast. By default, the plot will show all the bands in the dataset.
m = hypercoast.Map()
m.add_basemap("SATELLITE")
m.add_emit(dataset, wavelengths=[1000, 600, 500], vmin=0, vmax=0.3, layer_name="EMIT")
m.add("spectral")
m
To visualize a certain wavelength range, you can specify the xlim
parameter as follows:
m = hypercoast.Map()
m.add_basemap("SATELLITE")
m.add_emit(dataset, wavelengths=[1000, 600, 500], vmin=0, vmax=0.3, layer_name="EMIT")
m.add("spectral", xlim=(400, 1200))
m
To access the selected spectral profiles from the mouse clicked location as a Pandas DataFrame, use the Map.spectral_to_df()
method.
m.spectral_to_df()
To access the selected spectral profiles from the mouse clicked location as a GeoPandas GeoDataFrame, use the Map.spectral_to_gdf()
method.
m.spectral_to_gdf()