:py:mod:`gnome.maps.tideflat_map` ================================= .. py:module:: gnome.maps.tideflat_map .. autoapi-nested-parse:: tideflat_map.py A map that handles tide flats: It sets the oil_status code to "on_tideflat" when particles are on a tide flat. Then the movers will not move the particles while that flag is set. It is set back to in_water when the water depth indicates the tide flat is no longer a tide flat. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.maps.tideflat_map.TideflatMap gnome.maps.tideflat_map.TideflatBase gnome.maps.tideflat_map.SimpleTideflat .. py:class:: TideflatMap(land_map, tideflat) Bases: :py:obj:`gnome.gnomeobject.GnomeId` Checks for tidal flats, and sets and unsets the on_tidalflat oil_status code appropriately. Not sub-classed from a GnomeMap, as it delegates to the passed-in map instead initialize a TideflatMap :param land_map: A usual GnomeMap object -- for land-water, etc. It will be used to do beaching/refloating before the tidal flat is checked :type land_map: :class: GnomeMap :param tideflat: A tide-flat object that indicates when the water depth is zero -- or other indicator that the element is on a tideflat :type tideflat: :class: TideFlatBase object .. py:method:: __getattr__(name) Delegate everything that is not overridden to the enclosed GnomeMap .. py:method:: beach_elements(spill_container, model_time=None) .. py:method:: refloat_elements(spill_container, time_step, model_time=None) Checks whether elements that were on a tidal flat still are. If not, removes the flag Then passes off the the enclosed map to do the refloat logic :param spill_container: current SpillContainer :type spill_container: :class:`gnome.spill_container.SpillContainer` .. py:class:: TideflatBase(name=None, _appearance=None, *args, **kwargs) Bases: :py:obj:`gnome.gnomeobject.GnomeId` Base class for a Tideflat object to be used with TideflatBase Subclasses should override the ``is_dry()`` method. .. py:method:: is_dry(points, time) :param points: locations for testing if the locations are dry.are :type points: Nx3 numpy array or equivalent. :param time: time at which to check for wet/dry :return: numpy array of bools one for each point This should be over-ridden -- this version always returns FAlse for all points .. py:method:: is_wet(points, time) .. py:class:: SimpleTideflat(bounds, dry_start, dry_end) Bases: :py:obj:`TideflatBase` Simple Tideflat implementation for testing and demo For a real case, a subclass of TideflatBase should be made that implements these methods in a meaningful way This provides a single polygon describing a tidal flat The flat is initially wet, then dry at a given time, then wet again after that. Just enough for testing. :param bounds: polygon around the tidal flat :dry_start: initial time of flat being dry :dry_end: end time of flat being dry .. py:method:: is_dry(points, model_time) :param points: locations for testing if the locations are dry. :type points: Nx3 numpy array or equivalent. :param time: time at which to check for wet/dry :return: numpy array of bools one for each point