opendrift.readers.reader_global_landmask

Attributes

logger

__roaring_mask__

__polys__

Classes

LandmaskFeature

An interface to the GSHHS dataset.

Reader

The global landmask reader is based on the coastline data from

Functions

get_mask()

Returns an instance of the landmask type and landmask. The mask data is

plot_land(ax, lonmin, latmin, lonmax, latmax, fast[, ...])

Plot the landmask or the shapes from GSHHG.

Module Contents

opendrift.readers.reader_global_landmask.logger
opendrift.readers.reader_global_landmask.__roaring_mask__ = None
opendrift.readers.reader_global_landmask.__polys__ = None
opendrift.readers.reader_global_landmask.get_mask()[source]

Returns an instance of the landmask type and landmask. The mask data is usually shared between threads.

class opendrift.readers.reader_global_landmask.LandmaskFeature(scale='auto', globe=None, **kwargs)[source]

Bases: cartopy.feature.GSHHSFeature

An interface to the GSHHS dataset.

See https://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html

Parameters

scale

The dataset scale. One of ‘auto’, ‘coarse’, ‘low’, ‘intermediate’, ‘high, or ‘full’ (default is ‘auto’).

levels

A list of integers 1-6 corresponding to the desired GSHHS feature levels to draw (default is [1] which corresponds to coastlines).

Other Parameters

**kwargs

Keyword arguments to be used when drawing the feature. Defaults are edgecolor=’black’ and facecolor=’none’.

geometries()[source]

Return an iterator of (shapely) geometries for this feature.

intersecting_geometries(extent)[source]

Return an iterator of shapely geometries that intersect with the given extent. The extent is assumed to be in the CRS of the feature. If extent is None, the method returns all geometries for this dataset.

opendrift.readers.reader_global_landmask.plot_land(ax, lonmin, latmin, lonmax, latmax, fast, ocean_color='white', land_color=cfeature.COLORS['land'], lscale='auto', globe=None)[source]

Plot the landmask or the shapes from GSHHG.

class opendrift.readers.reader_global_landmask.Reader[source]

Bases: opendrift.readers.basereader.BaseReader, opendrift.readers.basereader.ContinuousReader

The global landmask reader is based on the coastline data from GSHHG (https://www.ngdc.noaa.gov/mgg/shorelines/) optimized for checking against landmasks.

Common constructor for all readers

name = 'global_landmask'
variables = ['land_binary_mask']
proj4 = None
crs = None
z = None
mask = None
__on_land__(x, y)[source]
get_variables(requestedVariables, time=None, x=None, y=None, z=None)[source]

Get binary mask of whether elements are on land or not.

Args:

x (deg[]): longitude (decimal degrees) y (deg[]): latitude (decimal degrees) …

x, y is given in reader local projection.

Returns:

Binary mask of point x, y on land.