Introduction¶
Learning Objectives¶
Environment Setup¶
# %pip install hypercoast pygisimport hypercoasthypercoast.nasa_earth_login()Finding Hyperspectral Data¶
Programmatic Search¶
results, gdf = hypercoast.search_emit(
bbox=(-83, 25, -81, 28),
temporal=("2024-04-01", "2024-05-16"),
count=10, # use -1 to return all datasets
return_gdf=True,
)gdf.explore()hypercoast.download_emit(results[:1], out_dir="data")Interactive Search¶
m = hypercoast.Map(center=[30.0262, -90.1345], zoom=8)
m.search_emit()
mif hasattr(m, "_NASA_DATA_GDF"):
display(m._NASA_DATA_GDF.head())hypercoast.download_emit(results[:1], out_dir="data")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)Reading Hyperspectral Data¶
dataset = hypercoast.read_emit(filepath)
datasetVisualizing 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")
mCreating 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()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()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()