24. Hyperspectral Data Visualization with HyperCoast#

24.1. Introduction#

24.2. Learning Objectives#

24.3. Environment Setup#

# %pip install hypercoast pygis
import hypercoast
hypercoast.nasa_earth_login()

24.4. Finding Hyperspectral Data#

24.5. Downloading Hyperspectral Data#

url = "https://github.com/opengeos/datasets/releases/download/hypercoast/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
filepath = "data/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
hypercoast.download_file(url, filepath, quiet=True)

24.6. Reading Hyperspectral Data#

dataset = hypercoast.read_emit(filepath)
dataset

24.7. Visualizing Hyperspectral Data#

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

24.8. Creating Image Cubes#

ds = dataset.sel(longitude=slice(-90.1482, -89.7321), latitude=slice(30.0225, 29.7451))
p = hypercoast.image_cube(
    ds,
    variable="reflectance",
    cmap="jet",
    clim=(0, 0.4),
    rgb_wavelengths=[1000, 700, 500],
    rgb_gamma=2,
    title="EMIT Reflectance",
)
p.show()

24.9. Interactive Slicing#

ds = dataset.sel(longitude=slice(-90.05, -89.99), latitude=slice(30.00, 29.93))
p = hypercoast.image_cube(
    ds,
    variable="reflectance",
    cmap="jet",
    clim=(0, 0.5),
    rgb_wavelengths=[1000, 700, 500],
    rgb_gamma=2,
    title="EMIT Reflectance",
    widget="plane",
)
p.add_text("Band slicing", position="upper_right", font_size=14)
p.show()

24.10. Interactive Thresholding#

p = hypercoast.image_cube(
    ds,
    variable="reflectance",
    cmap="jet",
    clim=(0, 0.5),
    rgb_wavelengths=[1000, 700, 500],
    rgb_gamma=2,
    title="EMIT Reflectance",
    widget="threshold",
)
p.add_text("Thresholding", position="upper_right", font_size=14)
p.show()

24.11. Key Takeaways#

24.12. Exercises#

24.12.1. Exercise 1: Data Discovery and Acquisition#

24.12.2. Exercise 2: Spectral Profile Analysis#

24.12.3. Exercise 3: Band Combination Exploration#

24.12.4. Exercise 4: Interactive Visualization#

24.12.5. Exercise 5: 3D Cube Analysis#