Visualizing Hypoxia Cruise Sampling Locations in the Gulf of Mexico¶
In [ ]:
Copied!
# %pip install -U openpyxl hypercoast
# %pip install -U openpyxl hypercoast
In [ ]:
Copied!
import pandas as pd
import hypercoast
import pandas as pd
import hypercoast
In [ ]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/Hypoxia_Data_Sheet.xlsx"
xls_path = "data/Hypoxia_Data_Sheet.xlsx"
hypercoast.download_file(url, xls_path, overwrite=True)
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/Hypoxia_Data_Sheet.xlsx"
xls_path = "data/Hypoxia_Data_Sheet.xlsx"
hypercoast.download_file(url, xls_path, overwrite=True)
In [ ]:
Copied!
df = pd.read_excel(xls_path)
df.head()
df = pd.read_excel(xls_path)
df.head()
In [ ]:
Copied!
df_filtered = df.dropna(subset=["Lon", "Lat"]).reset_index(drop=True)
df_filtered.head()
df_filtered = df.dropna(subset=["Lon", "Lat"]).reset_index(drop=True)
df_filtered.head()
In [ ]:
Copied!
url = (
"https://github.com/opengeos/datasets/releases/download/hypercoast/Hypoxia_Path.kml"
)
kml_path = "data/Hypoxia_Path.kml"
hypercoast.download_file(url, kml_path)
url = (
"https://github.com/opengeos/datasets/releases/download/hypercoast/Hypoxia_Path.kml"
)
kml_path = "data/Hypoxia_Path.kml"
hypercoast.download_file(url, kml_path)
In [ ]:
Copied!
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
filepath = "data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
hypercoast.download_file(url, filepath)
url = "https://github.com/opengeos/datasets/releases/download/hypercoast/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
filepath = "data/PACE_OCI.20240730T181157.L2.OC_AOP.V2_0.NRT.nc"
hypercoast.download_file(url, filepath)
In [ ]:
Copied!
dataset = hypercoast.read_pace(filepath)
# dataset
dataset = hypercoast.read_pace(filepath)
# dataset
In [ ]:
Copied!
m = hypercoast.Map()
m.add_basemap("Hybrid")
wavelengths = [450, 550, 650]
m.add_pace(
dataset, wavelengths, indexes=[3, 2, 1], vmin=0, vmax=0.02, layer_name="PACE"
)
m.add("spectral")
style = {"weight": 2, "color": "red"}
m.add_kml(kml_path, style=style, layer_name="Hypoxia Path", info_mode=None)
m.add_points_from_xy(
df_filtered,
x="Lon",
y="Lat",
max_cluster_radius=50,
layer_name="Hypoxia Data Points",
)
m.set_center(-91.46118, 28.89758, zoom=8)
m
m = hypercoast.Map()
m.add_basemap("Hybrid")
wavelengths = [450, 550, 650]
m.add_pace(
dataset, wavelengths, indexes=[3, 2, 1], vmin=0, vmax=0.02, layer_name="PACE"
)
m.add("spectral")
style = {"weight": 2, "color": "red"}
m.add_kml(kml_path, style=style, layer_name="Hypoxia Path", info_mode=None)
m.add_points_from_xy(
df_filtered,
x="Lon",
y="Lat",
max_cluster_radius=50,
layer_name="Hypoxia Data Points",
)
m.set_center(-91.46118, 28.89758, zoom=8)
m