In [1]:
import gridgeo


gridgeo.__version__


Out[1]:
'1.4.0+5.g9d6f2a1.dirty'

In [2]:
url = 'http://colossus.dl.stevens-tech.edu:8080/thredds/dodsC/latest/Complete_gcmplt.nc'

grid = gridgeo.GridGeo(
    url,
    standard_name='sea_water_temperature'
)

In [3]:
grid.mesh


Out[3]:
'unknown_2d'

In [4]:
print(f'The grid has {len(grid.polygons)} polygons, showing the first 5.')

grid.geometry[:5]


The grid has 12706 polygons, showing the first 5.
Out[4]:

In [5]:
grid.outline


Out[5]:

In [6]:
%matplotlib inline
import cartopy.crs as ccrs
import matplotlib.pyplot as plt


fig, ax = plt.subplots(
    figsize=(9, 9),
    subplot_kw={'projection': ccrs.PlateCarree()}
)

ax.plot(
    grid.x, grid.y, 'darkgray',
    grid.x.T, grid.y.T, 'darkgray',
    alpha=0.25,
)

ax.coastlines(resolution='10m');



In [7]:
import folium


x, y = grid.outline.centroid.xy

m = folium.Map(location=[y[0], x[0]])
folium.GeoJson(grid.outline.__geo_interface__).add_to(m)
m.fit_bounds(m.get_bounds())

m


Out[7]: