gnome.environment.timeseries_objects_base
Attributes
Classes
Base class for data with a single dimension: time |
|
Base class for multiple data sources aligned along the same single time dimension |
Module Contents
- 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
- units = None
- property data
- property time
- extrapolate = True
- classmethod constant(name=None, units=None, data=None)
- property timeseries
Creates a representation of the time series
- Return type:
list of (datetime, double) tuples
- at(points, time, *, units=None, extrapolate=False, 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
- variables = None
- property units
Units of underlying data
- Return type:
string
- property time
Time axis of data. I
- Return type:
gnome.environment.property.Time
- property varnames
Names of underlying variables
- Return type:
[] of strings
- at(points, time, *, units=None, extrapolate=False, **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