In [1]:
Copied!
# %pip install "hypercoast[extra]"
# %pip install "hypercoast[extra]"
In [2]:
Copied!
import hypercoast
import hypercoast
In [3]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/desis.tif"
filepath = "data/desis.tif"
hypercoast.download_file(url, filepath)
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/desis.tif"
filepath = "data/desis.tif"
hypercoast.download_file(url, filepath)
Out[3]:
'/home/runner/work/HyperCoast/HyperCoast/docs/examples/data/desis.tif'
Load the dataset as a xarray.Dataset object.
In [4]:
Copied!
dataset = hypercoast.read_desis(filepath)
dataset = hypercoast.read_desis(filepath)
Plot the spectral signature of a pixel.
In [5]:
Copied!
hypercoast.filter_desis(dataset, lat=29.4315, lon=91.2927, return_plot=True)
hypercoast.filter_desis(dataset, lat=29.4315, lon=91.2927, return_plot=True)
Visualize a single band of the hyperspectral image.
In [6]:
Copied!
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_desis(filepath, wavelengths=[1000], vmin=0, vmax=5000, nodata=0, colormap="jet")
m.add_colormap(cmap="jet", vmin=0, vmax=0.5, label="Reflectance")
m
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_desis(filepath, wavelengths=[1000], vmin=0, vmax=5000, nodata=0, colormap="jet")
m.add_colormap(cmap="jet", vmin=0, vmax=0.5, label="Reflectance")
m
Out[6]:
Plot the spectral signature of a pixel interactively.
In [7]:
Copied!
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_desis(filepath, wavelengths=[900, 600, 525], vmin=0, vmax=1000, nodata=0)
m.add("spectral")
m
m = hypercoast.Map()
m.add_basemap("Hybrid")
m.add_desis(filepath, wavelengths=[900, 600, 525], vmin=0, vmax=1000, nodata=0)
m.add("spectral")
m
Out[7]: