In [ ]:
Copied!
# %pip install "hypercoast[extra]"
# %pip install "hypercoast[extra]"
In [ ]:
Copied!
import hypercoast
import hypercoast
Download a sample Wyvern dataset. It is a subset of the full dataset.
In [ ]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/wyvern_dragonette-001_20240608T144036_fa4c4f71.tif"
filepath = "data/wyvern.tif"
hypercoast.download_file(url, filepath)
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/wyvern_dragonette-001_20240608T144036_fa4c4f71.tif"
filepath = "data/wyvern.tif"
hypercoast.download_file(url, filepath)
Load the dataset as a xarray.Dataset object.
In [ ]:
Copied!
dataset = hypercoast.read_wyvern(filepath)
dataset
dataset = hypercoast.read_wyvern(filepath)
dataset
In [ ]:
Copied!
dataset.sel(wavelength=780, method="nearest")
dataset.sel(wavelength=780, method="nearest")
Plot the spectral signature of a pixel.
In [ ]:
Copied!
hypercoast.filter_wyvern(dataset, lat=40.72, lon=-73.95, return_plot=True)
hypercoast.filter_wyvern(dataset, lat=40.72, lon=-73.95, return_plot=True)
Visualize a single band of the hyperspectral image.
In [ ]:
Copied!
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_wyvern(
dataset,
wavelengths=[799],
indexes=[1],
vmin=0,
vmax=100,
colormap="jet",
nodata=-9999,
)
m.add_colormap(cmap="jet", vmin=0, vmax=100, label="Reflectance")
m
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_wyvern(
dataset,
wavelengths=[799],
indexes=[1],
vmin=0,
vmax=100,
colormap="jet",
nodata=-9999,
)
m.add_colormap(cmap="jet", vmin=0, vmax=100, label="Reflectance")
m
Plot the spectral signature of a pixel interactively.
In [ ]:
Copied!
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_wyvern(filepath, wavelengths=[799, 679, 570], vmin=0, vmax=100, nodata=-9999)
m.add("spectral")
m
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_wyvern(filepath, wavelengths=[799, 679, 570], vmin=0, vmax=100, nodata=-9999)
m.add("spectral")
m