:py:mod:`opendrift.readers.reader_global_landmask` ================================================== .. py:module:: opendrift.readers.reader_global_landmask Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: opendrift.readers.reader_global_landmask.LandmaskFeature opendrift.readers.reader_global_landmask.Reader Functions ~~~~~~~~~ .. autoapisummary:: opendrift.readers.reader_global_landmask.get_mask opendrift.readers.reader_global_landmask.plot_land Attributes ~~~~~~~~~~ .. autoapisummary:: opendrift.readers.reader_global_landmask.logger opendrift.readers.reader_global_landmask.__roaring_mask__ opendrift.readers.reader_global_landmask.__polys__ .. py:data:: logger .. py:data:: __roaring_mask__ .. py:data:: __polys__ .. py:function:: get_mask() Returns an instance of the landmask type and landmask. The mask data is usually shared between threads. .. py:class:: LandmaskFeature(scale='auto', globe=None, **kwargs) Bases: :py:obj:`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'. .. py:method:: geometries() Return an iterator of (shapely) geometries for this feature. .. py:method:: intersecting_geometries(extent) 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. .. py:function:: plot_land(ax, lonmin, latmin, lonmax, latmax, fast, ocean_color='white', land_color=cfeature.COLORS['land'], lscale='auto', globe=None) Plot the landmask or the shapes from GSHHG. .. py:class:: Reader Bases: :py:obj:`opendrift.readers.basereader.BaseReader`, :py:obj:`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 .. py:attribute:: name :value: 'global_landmask' .. py:attribute:: variables :value: ['land_binary_mask'] .. py:attribute:: proj4 .. py:attribute:: crs .. py:method:: __on_land__(x, y) .. py:method:: get_variables(requestedVariables, time=None, x=None, y=None, z=None) 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.