dug_seis.coordinate_transforms module#

Coordinate transformations for use within DUGSeis.

Input and output files for DUGSeis utilize coordinates in the WGS84 reference frame also known as EPSG 4326.

Internally DUGSeis operates in a Cartesian x,y,z reference frame in meters. The conversions between WGS84 and the local reference frame happen with the functions defined in this module.

The global reference system for all functions in this module will thus usually be "WGS84"; the local one must a be Cartesian one. A translation vector that is applied to the data in the Cartesian reference system concludes the definition of the internally use DUGSeis reference system.

The vertical coordinate is the negative depth in the QuakeML and StationXML files.

Coordinates in QuakeML files

The used coordinates are fully valid in QuakeML files with latitude and longitude being specified with respect to the WGS84 reference system. The depth is with respect to the nominal sea level given by the WGS84 ellipsoid.

Coordinates in StationXML files

Coordinates in StationXML files always have to be specified at the channel level. Latitude and longitude values are according to the WGS84 reference system. The elevation must be set to zero and the depth is thus with respect to the nominal sea level given by the WGS84 ellipsoid. This is slightly different from the usual convention in StationXML files to set the elevation to the height of the local surface and the depth the burial beneath that.

dug_seis.coordinate_transforms.global_to_local(*, local_crs: Union[int, str], global_crs: Union[int, str], translation_vector: Optional[Union[Tuple[float, float, float], List[float], ndarray]] = None, point: Union[Tuple[float, float, float], List[float], ndarray]) Tuple[float, float, float]#

Convert global coordinates to a local CRS system and substract an optional translation vector.

This will perform global_to_local(point) - translation_vector.

Parameters:
  • local_crs – The local coordinate reference system either as a string or a EPSG code.

  • global_crs – The local coordinate reference system either as a string or a EPSG code.

  • translation_vector – The translation vector.

  • point – The point to convert.

dug_seis.coordinate_transforms.local_to_global(*, local_crs: Union[int, str], global_crs: Union[int, str], translation_vector: Optional[Union[Tuple[float, float, float], List[float], ndarray]] = None, point: Union[Tuple[float, float, float], List[float], ndarray]) Tuple[float, float, float]#

Convert local coordinates (plus an optional translation vector) to a global CRS system.

This will perform transform_local_to_global(point + translation_vector).

Parameters:
  • local_crs – The local coordinate reference system either as a string or a EPSG code.

  • global_crs – The local coordinate reference system either as a string or a EPSG code.

  • translation_vector – The translation vector.

  • point – The point to convert.