pyrocko.gato.grid.location

Classes

CartesianLocationGrid(**kwargs)

Regular Cartesian grid anchored at a reference point with optional rotation.

LocationGrid(**kwargs)

Base class for location grids.

UnstructuredLocationGrid(**kwargs)

Representation of a set of scattered locations.

class LocationGrid(**kwargs)[source]

Bases: Grid

Base class for location grids.

class CartesianLocationGrid(**kwargs)[source]

Bases: LocationGrid

Regular Cartesian grid anchored at a reference point with optional rotation.

Unrotated coordinate system is NED (north-east-down).

3D-indexing is ordered from z (slow dimension) to x (fast dimension) f[iz, iy, ix]. 1D-indexing uses numpy.unravel_index() on (nz, ny, nx).

If any attribute is changed after initialization, update() must be called.

origin

pyrocko.model.location.Location

Anchor point of the grid.

azimuth

float, default: 0.0

Angle of x against north [deg].

dip

float, default: 0.0

Angle of y against horizontal [deg], rotation around x

x_min

float, default: 0.0

X axis minimum [m].

x_max

float, default: 0.0

X axis maximum [m].

y_min

float, default: 0.0

Y axis minimum [m].

y_max

float, default: 0.0

Y axis maximum [m].

z_min

float, default: 0.0

Z axis minimum [m].

z_max

float, default: 0.0

Z axis maximum [m].

x_delta

float, default: 1.0

X axis spacing [m].

y_delta

float, default: 1.0

Y axis spacing [m].

z_delta

float, default: 1.0

Z axis spacing [m].

snap

str (pyrocko.gato.grid.base.GridSnap), default: 'both'

Flag to indicate how grid inconsistencies are handled.

property shape

Logical shape of the grid.

property size

Number of grid nodes.

property effective_dimension

Number of non-flat dimensions.

get_nodes(system)[source]

Get node coordinates.

Parameters:

system (str) – Coordinate system: 'latlondepth', world coordinates as (latitude, longitude, depth), 'xyz', unrotated coordinate system, 'ned', rotated coordinate system in (north, east, down) relative to origin.

Returns:

Point coordinates in requested coordinate system.

Return type:

numpy.ndarray of shape (size, 3), where size is the number of nodes

class UnstructuredLocationGrid(**kwargs)[source]

Bases: LocationGrid

Representation of a set of scattered locations.

This class is useful to represent e.g. sensor locations in a seismic array or other collections of locations with irregular structure.

origin

pyrocko.model.location.Location, optional

Anchor point of the grid.

coordinates

numpy.ndarray (pyrocko.guts_array.Array)

6C-Coordinates of grid nodes as (lat, lon, north_shift, east_shift, depth, elevation)

property shape

Logical shape of the grid.

property size

Number of grid nodes.

get_nodes(system)[source]

Get node coordinates.

Parameters:

system (str) – Coordinate system: 'latlondepth', world coordinates as (latitude, longitude, depth), 'ned', coordinate system in (north, east, down) relative to origin.

Returns:

Point coordinates in requested coordinate system.

Return type:

numpy.ndarray of shape (size, 3), where size is the number of nodes