:py:mod:`gnome.environment.timeseries_objects_base` =================================================== .. py:module:: gnome.environment.timeseries_objects_base Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.environment.timeseries_objects_base.TimeseriesData gnome.environment.timeseries_objects_base.TimeseriesVector Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.environment.timeseries_objects_base.TimeSeriesProp .. py:class:: TimeseriesData(data=None, time=None, units=None, extrapolate=True, *args, **kwargs) Bases: :py:obj:`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. :param name: Name :type name: string :param units: Units :type units: string :param time: Time axis of the data :type time: [] of datetime.datetime, netCDF4.Variable, or Time object :param data: Value of the property :type data: array-like .. py:property:: timeseries Creates a representation of the time series :rtype: list of (datetime, double) tuples .. py:property:: data .. py:property:: time .. py:attribute:: _schema .. py:attribute:: _gnome_unit .. py:method:: constant(name=None, units=None, data=None) :classmethod: .. py:method:: 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. :param points: A Nx2 array of lon,lat points :param time: A datetime object. May be None; if this is so, the variable is assumed to be gridded but time-invariant :param units: The units that the result would be converted to .. py:method:: in_units(unit) Returns a full cpy of this property in the units specified. WARNING: This will cpy the data of the original property! :param units: Units to convert to :type units: string :return: Copy of self converted to new units :rtype: Same as self .. py:method:: is_constant() .. py:data:: TimeSeriesProp .. py:class:: TimeseriesVector(variables=None, time=None, units=None, *args, **kwargs) Bases: :py:obj:`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. :param name: Name of the Property :type name: string :param units: Unit of the underlying data :type units: string :param time: Time axis of the data :type time: [] of datetime.datetime, netCDF4.Variable, or Time object :param variables: component data arrays :type variables: [] of TimeseriesData or numpy.array (Max len=2) .. py:property:: time Time axis of data. I :rtype: gnome.environment.property.Time .. py:property:: units Units of underlying data :rtype: string .. py:property:: varnames Names of underlying variables :rtype: [] of strings .. py:attribute:: _schema .. py:attribute:: _gnome_unit .. py:method:: _check_consistency() :abstractmethod: Checks that the attributes of each GriddedProp in varlist are the same as the GridVectorProp .. py:method:: 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? :param points: Coordinates to be queried (P) :type points: Nx2 array of double :param time: The time at which to query these points (T) :type time: datetime.datetime object :param time: Specifies the time level of the variable :type time: integer :param units: units the values will be returned in (or converted to) :type units: string such as ('m/s', 'knots', etc) :param extrapolate: if True, extrapolation will be supported :type extrapolate: boolean (True or False) :return: returns a Nx2 array of interpolated values :rtype: double