In [ ]:
Copied!
# %pip install "hypercoast[extra]"
# %pip install "hypercoast[extra]"
In [ ]:
Copied!
import hypercoast
import hypercoast
Visualize NEON AOP Hyperspectral Data¶
Download a sample NEON AOP hyperspectral data.
In [ ]:
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)
Load the dataset as a xarray.Dataset
object.
In [ ]:
Copied!
dataset = hypercoast.read_neon(filepath)
dataset
dataset = hypercoast.read_neon(filepath)
dataset
Visualize the NEON AOP hyperspectral data in 3D with a selected band overlaid on top of the 3D plot.
In [ ]:
Copied!
cube = hypercoast.image_cube(
dataset,
variable="reflectance",
cmap="jet",
clim=(0, 0.5),
rgb_wavelengths=[700],
title="Reflectance",
)
cube.show()
cube = hypercoast.image_cube(
dataset,
variable="reflectance",
cmap="jet",
clim=(0, 0.5),
rgb_wavelengths=[700],
title="Reflectance",
)
cube.show()
Visualize the NEON AOP hyperspectral data in 3D with an RGB image overlaid on top of the 3D plot.
In [ ]:
Copied!
cube2 = hypercoast.image_cube(
dataset,
variable="reflectance",
cmap="jet",
clim=(0, 0.5),
rgb_wavelengths=[1000, 700, 500],
rgb_gamma=2,
title="Reflectance",
)
cube2.show()
cube2 = hypercoast.image_cube(
dataset,
variable="reflectance",
cmap="jet",
clim=(0, 0.5),
rgb_wavelengths=[1000, 700, 500],
rgb_gamma=2,
title="Reflectance",
)
cube2.show()
In [ ]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/netcdf/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
filepath = "EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
hypercoast.download_file(url)
url = "https://github.com/opengeos/datasets/releases/download/netcdf/EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
filepath = "EMIT_L2A_RFL_001_20240404T161230_2409511_009.nc"
hypercoast.download_file(url)
In [ ]:
Copied!
dataset = hypercoast.read_emit(filepath)
dataset
dataset = hypercoast.read_emit(filepath)
dataset
Select a subset of the data to avoid nodata areas.
In [ ]:
Copied!
ds = dataset.sel(longitude=slice(-90.1482, -89.7321), latitude=slice(30.0225, 29.7451))
ds
ds = dataset.sel(longitude=slice(-90.1482, -89.7321), latitude=slice(30.0225, 29.7451))
ds
Visualize the EMIT data in 3D with an RGB image overlaid on top of the 3D plot.
In [ ]:
Copied!
cube = hypercoast.image_cube(
ds,
variable="reflectance",
cmap="jet",
clim=(0, 0.4),
rgb_wavelengths=[1000, 700, 500],
rgb_gamma=2,
title="EMIT Reflectance",
)
cube.show()
cube = hypercoast.image_cube(
ds,
variable="reflectance",
cmap="jet",
clim=(0, 0.4),
rgb_wavelengths=[1000, 700, 500],
rgb_gamma=2,
title="EMIT Reflectance",
)
cube.show()