pyacs.lib.gmtpoint.gmt_point

GMT_Point class: position and optional velocity (GMT psvelo style).

class pyacs.lib.gmtpoint.gmt_point.GMT_Point(code=None, lon=None, lat=None, he=0, Ve=None, Vn=None, Vu=0, SVe=0, SVn=0, SVu=0, SVen=0, Cv_xyz=None, Cv_enu=None, index=None)[source]

Bases: object

Simple point with position and optional velocity (GMT psvelo style).

lon

Longitude in decimal degrees.

Type:

float

lat

Latitude in decimal degrees.

Type:

float

code

4-letter site code.

Type:

str, optional

he

Height above ellipsoid (m). Default is 0.

Type:

float, optional

Ve, Vn

East and north velocity components (mm/yr).

Type:

float, optional

Vu

Up component (mm/yr). Default is 0.

Type:

float, optional

SVe, SVn, SVu

Standard deviations on velocity components. Default is 0.

Type:

float, optional

SVen

Correlation or covariance term for Ve/Vn. Default is 0.

Type:

float, optional

add_to_gmt_psvelo(fname, overwrite=False, verbose=False)

Add the current GMT_Point to a GMT psvelo file.

Parameters:
  • fname (str) – Path to the GMT psvelo file (created if missing).

  • overwrite (bool, optional) – If True, replace existing line with same code. Default is False.

  • verbose (bool, optional) – If True, print progress. Default is False.

assign_index(index)

Assign an index to the current GMT_Point (for linear systems).

Parameters:

index (int) – Index value.

Returns:

self.

Return type:

GMT_Point

copy()

Return a copy of the current GMT_Point.

get_index()

Return the index of the current GMT_Point.

Returns:

Assigned index.

Return type:

int

get_info(display=False, legend=False, verbose=False)

Print information for the current GMT_Point.

Parameters:
  • display (bool, optional) – If True, print to stdout. Default is False.

  • legend (bool, optional) – If True, print column legend. Default is False.

  • verbose (bool, optional) – If True, print verbose message. Default is False.

Returns:

Formatted info string.

Return type:

str

magaz()

Return magnitude and azimuth of velocity for the current GMT_Point.

Returns:

  • mag (float) – Velocity magnitude in mm/yr.

  • az (float) – Azimuth in decimal degrees, clockwise from North.

Notes

Uncertainty on magnitude/azimuth is not implemented.

midpoint(point, code='Mm')

Return the midpoint between this point and another.

Parameters:
  • point (GMT_Point) – Other point.

  • code (str, optional) – Code for the new point. Default is ‘Mm’.

Returns:

Midpoint (lon, lat, he set; velocity not set).

Return type:

GMT_Point

pole(W=None, SW=None, type_euler='rot', option='predict')

Apply or remove an Euler pole prediction to this point’s velocity.

Parameters:
  • W (array_like) – Euler pole: [lon, lat, omega] (deg/Myr) or [wx, wy, wz] (rad/yr).

  • SW (array_like, optional) – Variance-covariance of pole (3x3). If provided, updates SVe, SVn.

  • type_euler (str, optional) – ‘euler’ (geographic) or ‘rot’ (cartesian rad/yr). Default is ‘rot’.

  • option (str, optional) – ‘predict’ (velocity = pole only), ‘remove’ (subtract), ‘add’. Default is ‘predict’.

Returns:

New point with modified velocity.

Return type:

GMT_Point

rotate_vel(angle, unit='radians')

Rotate velocity components by an angle (clockwise).

Parameters:
  • angle (float) – Rotation angle.

  • unit (str, optional) – ‘radians’ or ‘degrees’. Default is ‘radians’.

Returns:

New point with rotated Ve, Vn.

Return type:

GMT_Point

spherical_distance(M)

Return spherical distance between this point and another (meters).

Parameters:

M (GMT_Point) – Other point.

Returns:

Distance along the sphere in meters.

Return type:

float