gnome.environment.grid

grid for wind or current data

Module Contents

Classes

Grid

Defines a grid for a current or wind

class gnome.environment.grid.Grid(filename, topology_file=None, grid_type=1, extrapolate=False, time_offset=0, **kwargs)

Bases: gnome.environment.environment.Environment

Defines a grid for a current or wind

Initializes a grid object from a file and a grid type.

Maybe allow a grid to be passed in eventually, otherwise filename required

All other keywords are optional. Optional parameters (kwargs):

Parameters:

grid_type – default is 1 - regular grid (eventually figure this out from file)

property grid_type
_schema
extrapolate
time_offset
__repr__()

Return repr(self).

__str__()

Return str(self).

prepare_for_model_run(model_time)

Not sure we need to do anything here

prepare_for_model_step(model_time)

Make sure we have the right data loaded

get_value(time, location)

Return the value at specified time and location.

get_values(model_time, positions, velocities)

Return the values for the given positions

serialize(json_='webapi')

Returns a json serialization of this object (“webapi” mode only)

classmethod deserialize(json_)

classmethod takes json structure as input, deserializes it using a colander schema then invokes the new_from_dict method to create an instance of the object described by the json schema.

We also need to accept sparse json objects, in which case we will not treat them, but just send them back.