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/NEON_D02_SERC_DP3_368000_4306000_reflectance.h5"
filepath = "data/neon.h5"
hypercoast.download_file(url, filepath)
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/NEON_D02_SERC_DP3_368000_4306000_reflectance.h5"
filepath = "data/neon.h5"
hypercoast.download_file(url, filepath)
Out[3]:
'/home/runner/work/HyperCoast/HyperCoast/docs/examples/data/neon.h5'
Load the dataset as a xarray.Dataset
object.
In [4]:
Copied!
dataset = hypercoast.read_neon(filepath)
dataset
dataset = hypercoast.read_neon(filepath)
dataset
Out[4]:
<xarray.Dataset> Size: 3GB Dimensions: (y: 1000, x: 1000, wavelength: 426) Coordinates: * y (y) float64 8kB 4.307e+06 4.307e+06 ... 4.306e+06 4.306e+06 * x (x) float64 8kB 3.68e+05 3.68e+05 ... 3.69e+05 3.69e+05 * wavelength (wavelength) float64 3kB 383.9 388.9 ... 2.507e+03 2.512e+03 Data variables: reflectance (y, x, wavelength) float64 3GB 0.1569 0.1206 0.1034 ... nan nan Attributes: scale_factor: 10000.0 no_data_value: -9999.0 crs: EPSG:32618 transform: (1.0, 0.0, 368000.0, 0.0, -1.0, 4307000.0)
Visualize the data interactively with HyperCoast.
In [5]:
Copied!
m = hypercoast.Map()
m.add_neon(filepath, wavelengths=[1000, 700, 500], vmin=0, vmax=0.5)
m
m = hypercoast.Map()
m.add_neon(filepath, wavelengths=[1000, 700, 500], vmin=0, vmax=0.5)
m
Out[5]:
In [6]:
Copied!
m.set_center(-76.5134, 38.8973, 16)
m.set_center(-76.5134, 38.8973, 16)
In [7]:
Copied!
m.add("spectral")
m.add("spectral")