pygplates.GpmlConstantValue

class pygplates.GpmlConstantValue

Bases: pygplates.PropertyValue

The most basic case of a time-dependent property value is one that is constant for all time. The other two types are GpmlIrregularSampling and GpmlPiecewiseAggregation. The GPlates Geological Information Model (GPGIM) defines those properties that are time-dependent (see http://www.gplates.org/gpml.html) and those that are not. For example, a GpmlPlateId property value is used in gpml:reconstructionPlateId properties, of general feature types, and also in gpml:relativePlate properties of motion path features. In the former case it is expected to be wrapped in a GpmlConstantValue while in the latter case it is not.
reconstruction_plate_id = pygplates.Property(
    pygplates.PropertyName.gpml_reconstruction_plate_id,
    pygplates.GpmlConstantValue(pygplates.GpmlPlateId(701)))

relative_plate_id = pygplates.Property(
    pygplates.PropertyName.gpml_relative_plate,
    pygplates.GpmlPlateId(701))

If a property is created without a time-dependent wrapper where one is expected, or vice versa, then you can still save it to a GPML file and a subsequent read of that file will attempt to correct the property when it is created during the reading phase (by the GPML file format reader). This usually works for the simpler GpmlConstantValue time-dependent wrapper but does not always work for the more advanced GpmlIrregularSampling and GpmlPiecewiseAggregation time-dependent wrapper types.

__init__(property_value[, description])

Wrap a property value in a time-dependent wrapper that identifies the property value as constant for all time.

Parameters
  • property_value (PropertyValue) – arbitrary property value

  • description (string or None) – description of this constant value wrapper

Optionally provide a description string. If description is not specified then get_description() will return None.

constant_property_value = pygplates.GpmlConstantValue(property_value)

Methods

__init__(property_value, [description])

Wrap a property value in a time-dependent wrapper that identifies the property value as constant for all time.

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_description()

Returns the optional description of this constant value wrapper, or None.

get_geometry()

Extracts the geometry if this property value contains a geometry.

get_value([time=0])

Extracts the constant value contained within.

set_description([description])

Sets the description of this constant value wrapper, or removes it if none specified.

set_value(property_value)

Sets the property value of this constant value wrapper.

get_description()

Returns the optional description of this constant value wrapper, or None.

Return type

string or None

get_value([time=0])

Extracts the constant value contained within.

Parameters

time (float or GeoTimeInstant) – the time to extract value (defaults to present day)

Return type

PropertyValue or None

Since the contained property value is constant, the time parameter is ignored.

This method overrides PropertyValue.get_value().

set_description([description])

Sets the description of this constant value wrapper, or removes it if none specified.

Parameters

description (string or None) – description of this constant value wrapper

set_value(property_value)

Sets the property value of this constant value wrapper.

Parameters

property_value (PropertyValue) – arbitrary property value

This 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.