pygplates.GmlTimeInstant

class pygplates.GmlTimeInstant

Bases: pygplates.PropertyValue

A property value representing an instant in geological time.

__init__(time_position)

Create a property value representing a specific time instant.

Parameters

time_position (float or GeoTimeInstant) – the time position

begin_time_instant = pygplates.GmlTimeInstant(pygplates.GeoTimeInstant.create_distant_past())
end_time_instant = pygplates.GmlTimeInstant(0)

Methods

__init__(time_position)

Create a property value representing a specific time instant.

accept_visitor(visitor)

Accept a property value visitor so that it can visit this property value.

clone()

Create a duplicate of this property value (derived) instance, including a recursive copy of any nested property values that this instance might contain.

get_geometry()

Extracts the geometry if this property value contains a geometry.

get_time()

Returns the time position of this property value.

get_value([time=0])

Extracts the value, of this possibly time-dependent property value, at the reconstruction time.

set_time(time_position)

Sets the time position of this property value.

get_time()

Returns the time position of this property value.

Return type

float

You can use GeoTimeInstant with the returned float to check for distant past or distant future for example:

float_time = time_instant.get_time()
print 'Time instant is distant past: %s' % pygplates.GeoTimeInstant(float_time).is_distant_past()

…or just test directly using float comparisons…

float_time = time_instant.get_time()
print 'Time instant is distant past: %s' % (float_time == float('inf'))
set_time(time_position)

Sets the time position of this property value.

Parameters

time_position (float or GeoTimeInstant) – the time position