gnome.environment.timeseries_objects_base

Module Contents

Classes

TimeseriesData

Base class for data with a single dimension: time

TimeseriesVector

Base class for multiple data sources aligned along the same single time dimension

Attributes

TimeSeriesProp

class gnome.environment.timeseries_objects_base.TimeseriesData(data=None, time=None, units=None, extrapolate=True, *args, **kwargs)

Bases: gnome.gnomeobject.GnomeId

Base class for data with a single dimension: time

A class that represents a natural phenomenon and provides an interface to get the value of the phenomenon at a position in space and time. EnvProp is the base class, and returns only a single value regardless of the time.

Parameters:
  • name (string) – Name

  • units (string) – Units

  • time ([] of datetime.datetime, netCDF4.Variable, or Time object) – Time axis of the data

  • data (array-like) – Value of the property

property timeseries

Creates a representation of the time series

Return type:

list of (datetime, double) tuples

property data
property time
_schema
_gnome_unit
classmethod constant(name=None, units=None, data=None)
at(points, time, units=None, extrapolate=None, auto_align=True, **kwargs)

Interpolates this property to the given points at the given time with the units specified.

Parameters:
  • points – A Nx2 array of lon,lat points

  • time – A datetime object. May be None; if this is so, the variable is assumed to be gridded but time-invariant

  • units – The units that the result would be converted to

in_units(unit)

Returns a full cpy of this property in the units specified. WARNING: This will cpy the data of the original property!

Parameters:

units (string) – Units to convert to

Returns:

Copy of self converted to new units

Return type:

Same as self

is_constant()
gnome.environment.timeseries_objects_base.TimeSeriesProp
class gnome.environment.timeseries_objects_base.TimeseriesVector(variables=None, time=None, units=None, *args, **kwargs)

Bases: gnome.gnomeobject.GnomeId

Base class for multiple data sources aligned along the same single time dimension

A class that represents a vector natural phenomenon and provides an interface to get the value of the phenomenon at a position in space and time.

Parameters:
  • name (string) – Name of the Property

  • units (string) – Unit of the underlying data

  • time ([] of datetime.datetime, netCDF4.Variable, or Time object) – Time axis of the data

  • variables ([] of TimeseriesData or numpy.array (Max len=2)) – component data arrays

property time

Time axis of data. I

Return type:

gnome.environment.property.Time

property units

Units of underlying data

Return type:

string

property varnames

Names of underlying variables

Return type:

[] of strings

_schema
_gnome_unit
abstract _check_consistency()

Checks that the attributes of each GriddedProp in varlist are the same as the GridVectorProp

at(points, time, units=None, *args, **kwargs)

Find the value of the property at positions P at time T

TODO: What are the argument names for time and time level really?

Parameters:
  • points (Nx2 array of double) – Coordinates to be queried (P)

  • time (integer) – The time at which to query these points (T)

  • time – Specifies the time level of the variable

  • units (string such as ('m/s', 'knots', etc)) – units the values will be returned in (or converted to)

  • extrapolate (boolean (True or False)) – if True, extrapolation will be supported

Returns:

returns a Nx2 array of interpolated values

Return type:

double