:py:mod:`gnome.movers.py_wind_movers` ===================================== .. py:module:: gnome.movers.py_wind_movers .. autoapi-nested-parse:: Wind Movers and associated helper functions. This module has no compiled C dependency Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.movers.py_wind_movers.WindMover Functions ~~~~~~~~~ .. autoapisummary:: gnome.movers.py_wind_movers.grid_wind_mover Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.movers.py_wind_movers.PyWindMoverSchema gnome.movers.py_wind_movers.PyWindMover .. py:data:: PyWindMoverSchema .. py:class:: WindMover(wind=None, time_offset=0, uncertain_duration=3.0 * 3600, uncertain_time_delay=0, uncertain_speed_scale=2.0, uncertain_angle_scale=0.4, scale_value=1, default_num_method='RK2', filename=None, **kwargs) Bases: :py:obj:`gnome.movers.movers.PyMover` WindMover implemented in Python. Uses the .wind attribute to move particles. The .at() interface is expected on the .wind attribute Initialize a WindMover :param wind: Environment object representing wind to be used. :type wind: Any Wind or Wind-like that implements the .at() function :param active_range: Range of datetimes for when the mover should be active :type active_range: 2-tuple of datetimes :param scale_value: Value to scale wind data :param uncertain_duration: how often does a given uncertain element get reset :param uncertain_time_delay: when does the uncertainly kick in. :param uncertain_speed_scale: Scale for uncertainty of wind speed :param uncertain_angle_scale: Scale for uncertainty of wind angle :param time_offset: Time zone shift if data is in GMT :param num_method: Numerical method for calculating movement delta. Choices:('Euler', 'RK2', 'RK4') Default: RK2 .. py:property:: data_start .. py:property:: data_stop .. py:attribute:: _schema .. py:attribute:: _ref_as :value: 'py_wind_movers' .. py:attribute:: _req_refs .. py:method:: from_netCDF(filename=None, time_offset=0, scale_value=1, uncertain_duration=3 * 3600, uncertain_time_delay=0, uncertain_speed_scale=2.0, uncertain_angle_scale=0.4, default_num_method='RK2', **kwargs) :classmethod: .. py:method:: prepare_for_model_run() reset uncertainty .. py:method:: prepare_for_model_step(sc, time_step, model_time_datetime) Call base class method using super Also updates windage for this timestep :param sc: an instance of gnome.spill_container.SpillContainer class :param time_step: time step in seconds :param model_time_datetime: current time of model as a date time object .. py:method:: model_step_is_done(sc) remove any off map les .. py:method:: get_bounds() Return a bounding box surrounding the grid data. This function exists because it is part of the top level Mover API .. py:method:: update_uncertainty(num_les, elapsed_time) update uncertainty :param num_les: the number released so far :param elapsed_time: time in seconds since model run started .. py:method:: update_uncertainty_values(elapsed_time) update uncertainty values :param elapsed_time: time in seconds since model run started .. py:method:: allocate_uncertainty(num_les) add uncertainty :param num_les: the number of les released so far .. py:method:: add_uncertainty(deltas, time_step) add uncertainty :param deltas: the movement for the current time step .. py:method:: get_move(sc, time_step, model_time_datetime, num_method=None) Compute the move in (long,lat,z) space. It returns the delta move for each element of the spill as a numpy array of size (number_elements X 3) and dtype = gnome.basic_types.world_point_type Base class returns an array of numpy.nan for delta to indicate the get_move is not implemented yet. Each class derived from Mover object must implement it's own get_move :param sc: an instance of gnome.spill_container.SpillContainer class :param time_step: time step in seconds :param model_time_datetime: current model time as datetime object All movers must implement get_move() since that's what the model calls .. py:data:: PyWindMover .. py:function:: grid_wind_mover(filename, wind_kwargs=None, *args, **kwargs) Helper function to load a gridded wind from a file and create a WindMover :param filename: File to create the GridWind object from :type filename: string or Path-like' :param wind_kwargs: keyword arguments for the GridWind object. OPTIONAL :type wind_kwargs: dict