pygplates.GpmlTimeWindow¶
-
class
pygplates.GpmlTimeWindow¶ Bases:
Boost.Python.instanceA time window associates an arbitrary property value with a specific time period. The property value does not vary over the time period of the window. Typically a sequence of time windows are used in a
GpmlPiecewiseAggregationwhere the sequence of windows form a piecewise-constant (staircase function) property value over time (since each time window has a constant property value) assuming the windows do not have overlaps or gaps in time.Time windows are equality (
==,!=) comparable (but not hashable - cannot be used as a key in adict). This includes comparing the property value in the two time windows being compared (seePropertyValue) as well as the time period.-
__init__(property_value, begin_time, end_time)¶ Create a time window given a property value and time range.
Parameters: - property_value (
PropertyValue) – arbitrary property value - begin_time (float or
GeoTimeInstant) – the begin time of the time window - end_time (float or
GeoTimeInstant) – the end time of the time window
Raises: GmlTimePeriodBeginTimeLaterThanEndTimeError if begin time is later than end time
time_window = pygplates.GpmlTimeWindow(property_value, begin_time, end_time)
Note that begin_time must be further in the past than the end_time
begin_time > end_time.- property_value (
Methods
__init__(property_value, begin_time, end_time)Create a time window given a property value and time range. get_begin_time()Returns the begin time of this time window. get_end_time()Returns the end time of this time window. get_value()Returns the property value of this time window. get_value_type()Returns the type of property value returned by get_value().set_begin_time(time)Sets the begin time of this time window. set_end_time(time)Sets the end time of this time window. set_value(property_value)Sets the property value associated with this time window. -
get_begin_time()¶ Returns the begin time of this time window.
Return type: float You can use
GeoTimeInstantwith the returnedfloatto check for distant past or distant future for example. SeeGmlTimeInstant.get_time()for more details.
-
get_end_time()¶ Returns the end time of this time window.
Return type: float You can use
GeoTimeInstantwith the returnedfloatto check for distant past or distant future for example. SeeGmlTimeInstant.get_time()for more details.
-
get_value()¶ Returns the property value of this time window.
Return type: PropertyValue
-
get_value_type()¶ Returns the type of property value returned by
get_value().For example, it might return
pygplates.GmlLineStringwhich is a class object (not an instance).Return type: a class object of the property type (derived from PropertyValue)New in version 21.
-
set_begin_time(time)¶ Sets the begin time of this time window.
Parameters: time (float or GeoTimeInstant) – the begin time of this time windowRaises: GmlTimePeriodBeginTimeLaterThanEndTimeError if begin time is later than end time
-
set_end_time(time)¶ Sets the end time of this time window.
Parameters: time (float or GeoTimeInstant) – the end time of this time windowRaises: GmlTimePeriodBeginTimeLaterThanEndTimeError if begin time is later than end time
-
set_value(property_value)¶ Sets the property value associated with this time window.
Parameters: property_value ( PropertyValue) – arbitrary property valueThis essentially replaces the previous property value. Note that an alternative is to directly modify the property value returned by
get_value()using its property value methods.
-