Skip to content

Commit

Permalink
Fix RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
stefraynaud committed Jul 17, 2023
1 parent 15354c2 commit 64129cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/plot_hycom_gdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# ---------------

import numpy as np
import pandas as pd
import xarray as xr
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
Expand Down Expand Up @@ -108,14 +109,15 @@
#
# The drifter comes as a `csv` file and we read it as :class:`pandas.DataFrame` instance.

drifter = xoa.open_data_sample(
"gdp-6203641.csv", header=0, skiprows=[1], parse_dates=[2], index_col=2
csv_name = xoa.get_data_sample("gdp-6203641.csv")
drifter = pd.read_csv(
csv_name, header=0, skiprows=[1], parse_dates=[0], index_col=0, usecols=[2, 3, 4, 5, 6, 7]
)

# %%
# Since the sampling is not that nice, we resample it to 3-hour intervals.

drifter = drifter.resample("3H").mean()
drifter = drifter.resample("3H").mean(numeric_only=True)

# %%
# We convert it to and :class:`xarray.Dataset`, fix the time coordinate and decode it.
Expand Down Expand Up @@ -204,7 +206,7 @@
)
plt.quiverkey(qv, 0.1, 1.06, 0.1, r"0.1 $m\,s^{-1}$", color="k", alpha=1, labelpos="E")
plt.legend()
plot_double_minimap(drifter);
plot_double_minimap(drifter)

# %%
# The discrepancies between the lagrangian and mean eulerian currents highlight
Expand Down

0 comments on commit 64129cf

Please sign in to comment.