Visualizing PACE data interactively with HyperCoastĀ¶
This notebook demonstrates how to visualize Plankton, Aerosol, Cloud, ocean Ecosystem (PACE) data interactively with HyperCoast.
InĀ [1]:
Copied!
# %pip install "hypercoast[extra]"
# %pip install "hypercoast[extra]"
InĀ [2]:
Copied!
import hypercoast
import hypercoast
Download a sample PACE data file from here.
InĀ [3]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
InĀ [4]:
Copied!
filepath = "data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
hypercoast.download_file(url, filepath)
filepath = "data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
hypercoast.download_file(url, filepath)
data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc already exists. Skip downloading. Set overwrite=True to overwrite.
Out[4]:
'/home/runner/work/HyperCoast/HyperCoast/docs/examples/data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc'
Let's make a scatter plot of the pixel locations so we can see the irregular spacing.
InĀ [5]:
Copied!
plot = hypercoast.view_pace_pixel_locations(filepath, step=20)
plot = hypercoast.view_pace_pixel_locations(filepath, step=20)
Load the dataset as a xarray.Dataset
object.
InĀ [6]:
Copied!
dataset = hypercoast.read_pace(filepath)
dataset = hypercoast.read_pace(filepath)
Visualize selected bands of the dataset.
InĀ [7]:
Copied!
hypercoast.viz_pace(dataset, wavelengths=[500, 510, 520, 530], ncols=2)
hypercoast.viz_pace(dataset, wavelengths=[500, 510, 520, 530], ncols=2)
Add projection.
InĀ [8]:
Copied!
hypercoast.viz_pace(dataset, wavelengths=[500, 510, 520, 530], ncols=2, crs="default")
hypercoast.viz_pace(dataset, wavelengths=[500, 510, 520, 530], ncols=2, crs="default")