# lasif.domain¶

Classes handling the domain definition and associated functionality for LASIF. It can handle complex domains defined by HDF5 Salvus meshes. Otherwise it uses more simple domains which are just defined as min/max lat/lon coordinates.

Solvi Thrastarson, (soelvi.thrastarson@erdw.ethz.ch) 2019

GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html)

class lasif.domain.HDF5Domain(mesh_file: Union[str, pathlib.Path], absorbing_boundary_length: float)[source]

A class which handles domains based on HDF5 Salvus meshes

find_outside_point()tuple[source]

Find a point which is not inside the domain

Returns

Points in normalized x, y, z coordinates

Return type

tuple

get_sorted_edge_coords()[source]

Gets the indices of a sorted array of domain edge nodes, this method should work, as long as the top surfaces of the elements are approximately square

plot(ax=None, plot_inner_boundary: bool = False)[source]

Plots the domain Global domain is plotted using an equal area Mollweide projection. Smaller domains have eihter Orthographic projections or PlateCarree.

Parameters
• ax (matplotlib.axes.Axes, optional) – matplotlib axes, defaults to None

• plot_inner_boundary (bool, optional) – plot the convex hull of the mesh surface nodes that lie inside the domain. Defaults to False

Returns

The created GeoAxes instance.

point_in_domain(longitude: float, latitude: float, depth: Optional[float] = None)[source]

Test whether a point lies inside the domain. It is done in a step by step process of elimination:

• First one checks depth and sees whether the point is too deep and falls into the absorbing boundaries at depth.

• Second is a box check seeing whether point falls outside of minimum and maximum latitude.

• Third one uses the edge polygon to see whether point is inside it or not.

• Last one checks whether the point is too close to the edge meaning that it would fall into the absorbing boundaries.

Parameters
• longitude (float) – longitude in degrees

• latitude (float) – latitude in degrees

• depth (float) – depth of event in meters

class lasif.domain.SimpleDomain(info: Dict[str, Union[str, float]])[source]

A class handling more simplistic domains than the HDF5Domain class

get_sorted_corner_coords()numpy.ndarray[source]

Return an array which can be used to plot the edges of the domain

Returns

Properly ordered corner coordinates for plotting

Return type

numpy.ndarray

plot(ax=None, plot_inner_boundary: bool = False)[source]

Plots the domain Global domain is plotted using an equal area Mollweide projection. Smaller domains have eihter Orthographic projections or PlateCarree.

Parameters
• ax (matplotlib.axes.Axes, optional) – matplotlib axes, defaults to None

• plot_inner_boundary (bool, optional) – plot the convex hull of the mesh surface nodes that lie inside the domain. Defaults to False

Returns

The created GeoAxes instance.

point_in_domain(longitude: float, latitude: float, depth: Optional[float] = None)bool[source]

Check whether point is located inside or outside domain

Parameters
• longitude (float) – Longitude coordinate

• latitude (float) – Latitude coordinate

• depth (float, optional) – Depth in meters, defaults to None

Return type

bool