opendrift.readers.reader_global_landmask

Module Contents

Classes

Reader

The global landmask reader is based on the coastline data from

Functions

get_mask_type()

Returns whether the landmask is provided by the opendrift_landmask_data

get_mask(skippoly=False, extent=None)

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

plot_land(ax, lonmin, latmin, lonmax, latmax, fast, ocean_color='white', land_color=cfeature.COLORS['land'], lscale='auto')

Plot the landmask or the shapes from GSHHG.

opendrift.readers.reader_global_landmask.logger
opendrift.readers.reader_global_landmask.__roaring_mask__
opendrift.readers.reader_global_landmask.get_mask_type()[source]

Returns whether the landmask is provided by the opendrift_landmask_data package (0), or the roaring-landmask package (1).

opendrift.readers.reader_global_landmask.get_mask(skippoly=False, extent=None)[source]

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

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

Plot the landmask or the shapes from GSHHG.

class opendrift.readers.reader_global_landmask.Reader(extent=None, llcrnrlon=None, llcrnrlat=None, urcrnrlon=None, urcrnrlat=None, skippoly=False)[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.

Args:
param extent

minx, miny, maxx, maxy bounding box in source CRS for which to include geometries. Default None (all geometries).

type extent

array of floats, optional

param llcrnrlon

minx.

type llcrnrlon

float, optional, deprecated in favor of extent.

param llcrnrlat

miny.

type llcrnrlat

float, optional, deprecated in favor of extent.

param urcrnrlon

maxx.

type urcrnrlon

float, optional, deprecated in favor of extent.

param urcrnrlat

maxy.

type urcrnrlat

float, optional, deprecated in favor of extent.

param skippoly

use only rasterized landmask to determine whether points are on land.

type skippoly

bool, optional, default False.

Common constructor for all readers

name = global_landmask
variables = ['land_binary_mask']
proj4
crs
skippoly = False
extent
mask_type = 0
__on_land__(self, x, y)[source]
get_variables(self, 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.