Required
x0| Type: | salvus._core.types.float_ |
| Description: | Minimum x-coordinate. |
class BoxDomain(salvus.project.domain.Domain):
def __init__(
self,
x0: salvus._core.types.float_,
x1: salvus._core.types.float_,
y0: salvus._core.types.float_,
y1: salvus._core.types.float_,
z0: salvus._core.types.float_,
z1: salvus._core.types.float_,
) -> None: ...| Type: | salvus._core.types.float_ |
| Description: | Minimum x-coordinate. |
| Type: | salvus._core.types.float_ |
| Description: | Maximum x-coordinate. |
| Type: | salvus._core.types.float_ |
| Description: | Minimum y-coordinate. |
| Type: | salvus._core.types.float_ |
| Description: | Maximum y-coordinate. |
| Type: | salvus._core.types.float_ |
| Description: | Minimum z-coordinate. |
| Type: | salvus._core.types.float_ |
| Description: | Maximum z-coordinate. |
np.ndarray)-Domain bounding box.DomainBounds)-Get the 3-D domain bounds.CoordinateSystem)-Coordinate system of the domain.int)-Dimensions of the domain.# Create a box domain with a width of 1.0, a depth of 2.0, and height # of 3.0. d = sn.domain.dim3.BoxDomain.from_bounds(1.0, 2.0, 3.0) # Create a box domain from -1 to 2 in x, 3 to 4 in y, and 5 to 6 in z. d = sn.domain.dim3.BoxDomain.from_bounds( x=(-1.0, 2.0), y=(3.0, 4.0), z=(5.0, 6.0), )
def from_bounds() -> BoxDomain: ...def from_json_data(d: dict) -> Domain: ...| Type: | dict |
| Description: | Dictionary with the JSON data. |
def from_material(m: typing.Any) -> Domain: ...| Type: | typing.Any |
| Description: | The material model. |
xarray.Dataset object, or in a
NetCDF file on disk conforming to the Salvus XY file format.def from_salvus_xyz(
model: Path | str | xr.Dataset,
shrink_domain: salvus._core.types.float_ = 0.0,
) -> BoxDomain: ...| Type: | Path | str | xr.Dataset |
| Description: | Model file, either stored in memory (as an xarray.Dataset) or on disk (as a NetCDF file). |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Reduce the size of the domain w.r.t. the size as defined in the Salvus model. |
def from_volume_model(model: volume._VolumeBase) -> Domain: ...| Type: | volume._VolumeBase |
| Description: | The volumetric model from which to create the domain. |
def from_xarray(
d: xr.Dataset | xr.DataArray,
) -> dim2.BoxDomain | dim3.BoxDomain: ...| Type: | xr.Dataset | xr.DataArray |
| Description: | The xarray Dataset or DataArray. |
def load(filename: pathlib.Path) -> Domain: ...| Type: | pathlib.Path |
| Description: | File from which to load. |
def unit() -> BoxDomain: ...def dim_enum(self) -> Dim: ...def estimate_max_travel_distance_in_m(self) -> float: ...def is_point_inside_domain(
self,
x: salvus._core.types.float_,
y: salvus._core.types.float_,
z: salvus._core.types.float_ | None = None,
) -> bool: ...| Type: | salvus._core.types.float_ |
| Description: | x-coordinate to test. |
| Type: | salvus._core.types.float_ |
| Description: | y-coordinate to test. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | z-coordinate to test. If None test will only be done for the x- and y-coordinates. Defaults to None. |
def plot(
self, events: Event | list[Event] | None = None
) -> go.FigureWidget: ...def write(self, filename: pathlib.Path) -> None: ...| Type: | pathlib.Path |
| Description: | Filename to write it to. |
class SphericalChunkDomain(salvus.project.domain.dim3.SphericalDomain):
def __init__(
self,
lat_center: salvus._core.types.float_,
lat_extent: salvus._core.types.float_,
lon_center: salvus._core.types.float_,
lon_extent: salvus._core.types.float_,
radius_in_meter: salvus._core.types.float_,
polygon: SphericalPolygon | None = None,
minimum_radius_in_meter: float | None = None,
chunk_rotation: float | None = None,
) -> None: ...| Type: | salvus._core.types.float_ |
| Description: | Latitude (in geocentric coordinates) of the domain center in degrees. |
| Type: | salvus._core.types.float_ |
| Description: | Latitude extent (in geocentric coordinates) of the domain in degrees. |
| Type: | salvus._core.types.float_ |
| Description: | Longitude of the domain center in degrees. |
| Type: | salvus._core.types.float_ |
| Description: | Longitude extent of the domain in degrees. |
| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon | None |
| Default value: | None |
| Description: | Spherical polygon to further restrict the domain. |
| Type: | float | None |
| Default value: | None |
| Description: | Minimum radius of the domain. |
| Type: | float | None |
| Default value: | None |
| Description: | Rotate the spherical chunk counterclockwise about a vector that points to its center. Specified in degrees. |
np.ndarray)-Domain bounding box.DomainBounds)-Get the 3-D domain bounds.CoordinateSystem)-Coordinate system of the domain.int)-Dimensions of the domain.SphericalPolygon | None)-Polygon restricting the domain.def from_geojson(
radius_in_meter: salvus._core.types.float_, geojson: Path | str | dict
) -> SphericalDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Radius of the sphere in meters. |
| Type: | Path | str | dict |
| Description: | The GeoJSON document. |
def from_json_data(d: dict) -> Domain: ...| Type: | dict |
| Description: | Dictionary with the JSON data. |
def from_material(m: typing.Any) -> Domain: ...| Type: | typing.Any |
| Description: | The material model. |
def from_spherical_polygon(
radius_in_meter: salvus._core.types.float_, polygon: SphericalPolygon
) -> SphericalChunkDomain | SphericalGlobeDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon |
| Description: | The spherical polygon. |
def from_volume_model(model: volume._VolumeBase) -> Domain: ...| Type: | volume._VolumeBase |
| Description: | The volumetric model from which to create the domain. |
def from_xarray(
d: xr.Dataset | xr.DataArray,
) -> dim2.BoxDomain | dim3.BoxDomain: ...| Type: | xr.Dataset | xr.DataArray |
| Description: | The xarray Dataset or DataArray. |
def load(filename: pathlib.Path) -> Domain: ...| Type: | pathlib.Path |
| Description: | File from which to load. |
def dim_enum(self) -> Dim: ...def estimate_max_travel_distance_in_m(self) -> float: ...def generate_random_points_in_domain(
self, num_points: salvus._core.types.int_
) -> np.ndarray: ...| Type: | salvus._core.types.int_ |
| Description: | Number of points to generate |
def is_point_inside_domain(
self,
latitude: salvus._core.types.float_,
longitude: salvus._core.types.float_,
) -> bool: ...| Type: | salvus._core.types.float_ |
| Description: | latitude |
| Type: | salvus._core.types.float_ |
| Description: | longitude |
ipyleaflet to plot the domain, and optionally
the sources and receivers. See the online documentation for
ipyleaflet for information on the relevant parameters.def plot(
self,
zoom: int | None = None,
events: Event | list[Event] | None = None,
basemap: xyzservices.lib.TileProvider = {
"url": "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",
"max_zoom": 17,
"html_attribution": 'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)',
"attribution": "Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)",
"name": "OpenTopoMap",
},
domain_color: str = "green",
cluster: bool = False,
) -> ipyleaflet.Map: ...| Type: | int | None |
| Default value: | None |
| Description: | Zoom level to create the map with. If not given, it will zoom to the bounds of the domain. |
| Type: | xyzservices.lib.TileProvider |
| Default value: | {'url': 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', 'max_zoom': 17, 'html_attribution': 'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)', 'attribution': 'Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)', 'name': 'OpenTopoMap'} |
| Description: | The background map. |
| Type: | str |
| Default value: | 'green' |
| Description: | Color of the domain boundary. |
| Type: | bool |
| Default value: | False |
| Description: | If a very large number of sources and receivers are passed, the map rendering can become slow. Cluster tries to reduce noise on the map by grouping close objects together. |
def write(self, filename: pathlib.Path) -> None: ...| Type: | pathlib.Path |
| Description: | Filename to write it to. |
class SphericalDomain(salvus.project.domain.Domain):
def __init__(
self,
radius_in_meter: salvus._core.types.float_,
polygon: SphericalPolygon | None = None,
minimum_radius_in_meter: float | None = None,
) -> None: ...| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon | None |
| Default value: | None |
| Description: | Optionally further restrict the domain with a polygon. |
| Type: | float | None |
| Default value: | None |
| Description: | Minimum radius of the domain. |
np.ndarray)-Domain bounding box.DomainBounds)-Get the bounds of this domain.CoordinateSystem)-Coordinate system of the domain.int)-Dimensions of the domain.SphericalPolygon | None)-Polygon restricting the domain.def from_geojson(
radius_in_meter: salvus._core.types.float_, geojson: Path | str | dict
) -> SphericalDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Radius of the sphere in meters. |
| Type: | Path | str | dict |
| Description: | The GeoJSON document. |
def from_json_data(d: dict) -> Domain: ...| Type: | dict |
| Description: | Dictionary with the JSON data. |
def from_material(m: typing.Any) -> Domain: ...| Type: | typing.Any |
| Description: | The material model. |
def from_spherical_polygon(
radius_in_meter: salvus._core.types.float_, polygon: SphericalPolygon
) -> SphericalChunkDomain | SphericalGlobeDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon |
| Description: | The spherical polygon. |
def from_volume_model(model: volume._VolumeBase) -> Domain: ...| Type: | volume._VolumeBase |
| Description: | The volumetric model from which to create the domain. |
def from_xarray(
d: xr.Dataset | xr.DataArray,
) -> dim2.BoxDomain | dim3.BoxDomain: ...| Type: | xr.Dataset | xr.DataArray |
| Description: | The xarray Dataset or DataArray. |
def load(filename: pathlib.Path) -> Domain: ...| Type: | pathlib.Path |
| Description: | File from which to load. |
def dim_enum(self) -> Dim: ...def estimate_max_travel_distance_in_m(self) -> float: ...def generate_random_points_in_domain(
self, num_points: salvus._core.types.int_
) -> np.ndarray: ...| Type: | salvus._core.types.int_ |
| Description: | Number of points to generate |
def is_point_inside_domain(self) -> bool: ...def plot(self) -> None: ...def write(self, filename: pathlib.Path) -> None: ...| Type: | pathlib.Path |
| Description: | Filename to write it to. |
class SphericalGlobeDomain(salvus.project.domain.dim3.SphericalDomain):
def __init__(
self,
radius_in_meter: salvus._core.types.float_,
polygon: SphericalPolygon | None = None,
minimum_radius_in_meter: float | None = None,
) -> None: ...| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon | None |
| Default value: | None |
| Description: | Optionally further restrict the domain. |
| Type: | float | None |
| Default value: | None |
| Description: | The minimum radius of the domain. |
np.ndarray)-Domain bounding box.DomainBounds)-Get the 3-D domain bounds.CoordinateSystem)-Coordinate system of the domain.int)-Dimensions of the domain.SphericalPolygon | None)-Polygon restricting the domain.def from_geojson(
radius_in_meter: salvus._core.types.float_, geojson: Path | str | dict
) -> SphericalDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Radius of the sphere in meters. |
| Type: | Path | str | dict |
| Description: | The GeoJSON document. |
def from_json_data(d: dict) -> Domain: ...| Type: | dict |
| Description: | Dictionary with the JSON data. |
def from_material(m: typing.Any) -> Domain: ...| Type: | typing.Any |
| Description: | The material model. |
def from_spherical_polygon(
radius_in_meter: salvus._core.types.float_, polygon: SphericalPolygon
) -> SphericalChunkDomain | SphericalGlobeDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Planet radius. |
| Type: | SphericalPolygon |
| Description: | The spherical polygon. |
def from_volume_model(model: volume._VolumeBase) -> Domain: ...| Type: | volume._VolumeBase |
| Description: | The volumetric model from which to create the domain. |
def from_xarray(
d: xr.Dataset | xr.DataArray,
) -> dim2.BoxDomain | dim3.BoxDomain: ...| Type: | xr.Dataset | xr.DataArray |
| Description: | The xarray Dataset or DataArray. |
def load(filename: pathlib.Path) -> Domain: ...| Type: | pathlib.Path |
| Description: | File from which to load. |
def dim_enum(self) -> Dim: ...def estimate_max_travel_distance_in_m(self) -> float: ...def generate_random_points_in_domain(
self, num_points: salvus._core.types.int_
) -> np.ndarray: ...| Type: | salvus._core.types.int_ |
| Description: | Number of points to generate |
def is_point_inside_domain(
self,
latitude: salvus._core.types.float_,
longitude: salvus._core.types.float_,
) -> bool: ...| Type: | salvus._core.types.float_ |
| Description: | Latitude in degrees. |
| Type: | salvus._core.types.float_ |
| Description: | Longitude in degrees. |
def plot(self) -> None: ...def write(self, filename: pathlib.Path) -> None: ...| Type: | pathlib.Path |
| Description: | Filename to write it to. |
class UtmDomain(salvus.project.domain.dim3.BoxDomain):
def __init__(
self,
x0: salvus._core.types.float_,
x1: salvus._core.types.float_,
y0: salvus._core.types.float_,
y1: salvus._core.types.float_,
utm: pyproj.CRS,
) -> None: ...| Type: | salvus._core.types.float_ |
| Description: | Minimum x-coordinate (easting). |
| Type: | salvus._core.types.float_ |
| Description: | Maximum x-coordinate (easting). |
| Type: | salvus._core.types.float_ |
| Description: | Minimum y-coordinate (northing). |
| Type: | salvus._core.types.float_ |
| Description: | Maximum y-coordinate (northing). |
| Type: | pyproj.CRS |
| Description: | A pyproj.CRS object which represents the coordinate frame of the desired UTM domain. |
np.ndarray)-Domain bounding box.DomainBounds)-Get the 3-D domain bounds.CoordinateSystem)-Coordinate system of the domain.int)-Dimensions of the domain.tuple[npt.NDArray, npt.NDArray])-Get the bounding box of this domain in spherical WGS 84 coordinates.
Returns:
A 2-tuple of length 2 numpy arrays, which have the minimum and
maximum latitude and longitude values.pyproj.CRS)-The projection object defining the domain within the UTM zone..json file that comes with the AppEEARS request.def from_appeears_request(
json_file: Path | dict | str,
shrink_domain: salvus._core.types.float_ = 0.0,
) -> UtmDomain: ...| Type: | Path | dict | str |
| Description: | Path to the AppEEARS request JSON, or the json file itself (as a dictionary). |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Often the actual domain of interest is smaller than the full size of the domain specified in AppEEARS. Enter a value here to shrink the domain in the easting and northing dimensions by the provided number of meters. This is especially useful when one wants to attach absorbing boundary layers to the domain, as without shrinking the boundary layers may extend past the topographic information in the AppEEARS data. Defaults to 0.0. |
# Create a box domain with a width of 1.0, a depth of 2.0, and height # of 3.0. d = sn.domain.dim3.BoxDomain.from_bounds(1.0, 2.0, 3.0) # Create a box domain from -1 to 2 in x, 3 to 4 in y, and 5 to 6 in z. d = sn.domain.dim3.BoxDomain.from_bounds( x=(-1.0, 2.0), y=(3.0, 4.0), z=(5.0, 6.0), )
def from_bounds() -> BoxDomain: ...def from_events(
events: Event | list[Event],
utm: pyproj.CRS,
buffer_in_meters: salvus._core.types.float_ = 0.0,
) -> UtmDomain: ...| Type: | Event | list[Event] |
| Description: | A list of events from which to compute the extent. These events should be comprised of Cartesian sources and receivers. The extent will be measured from the first two coordinates of each contained source / receiver object, which should represent x (easting) and y (northing). These objects do not yet need to be attached to a mesh, as the "z" value will be ignored as in the convention in UTM domains. |
| Type: | pyproj.CRS |
| Description: | A pyproj.CRS object which represents the coordinate frame of the desired UTM domain. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Add this much distance to the bounding box defined by the sources and receivers. You almost always want to set something here, otherwise some of your sources and receivers will be extremely close to the edge. |
def from_json_data(d: dict) -> Domain: ...| Type: | dict |
| Description: | Dictionary with the JSON data. |
def from_material(m: typing.Any) -> Domain: ...| Type: | typing.Any |
| Description: | The material model. |
xarray.Dataset object, or in a
NetCDF file on disk conforming to the Salvus XY file format.def from_salvus_xyz(
model: Path | str | xr.Dataset,
shrink_domain: salvus._core.types.float_ = 0.0,
) -> BoxDomain: ...| Type: | Path | str | xr.Dataset |
| Description: | Model file, either stored in memory (as an xarray.Dataset) or on disk (as a NetCDF file). |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Reduce the size of the domain w.r.t. the size as defined in the Salvus model. |
def from_spherical_chunk(
min_latitude: salvus._core.types.float_,
max_latitude: salvus._core.types.float_,
min_longitude: salvus._core.types.float_,
max_longitude: salvus._core.types.float_,
) -> UtmDomain: ...| Type: | salvus._core.types.float_ |
| Description: | Minimum domain latitude in WGS84. |
| Type: | salvus._core.types.float_ |
| Description: | Maximum domain latitude in WGS84. |
| Type: | salvus._core.types.float_ |
| Description: | Minimum domain longitude in WGS84. |
| Type: | salvus._core.types.float_ |
| Description: | Maximum domain longitude in WGS84. |
def from_volume_model(model: volume._VolumeBase) -> Domain: ...| Type: | volume._VolumeBase |
| Description: | The volumetric model from which to create the domain. |
def from_xarray(
d: xr.Dataset | xr.DataArray,
) -> dim2.BoxDomain | dim3.BoxDomain: ...| Type: | xr.Dataset | xr.DataArray |
| Description: | The xarray Dataset or DataArray. |
def load(filename: pathlib.Path) -> Domain: ...| Type: | pathlib.Path |
| Description: | File from which to load. |
def unit() -> BoxDomain: ...def dim_enum(self) -> Dim: ...def download_topography_and_bathymetry(
self,
filename: str,
buffer_in_degrees: salvus._core.types.float_ = 0.0,
resolution: str = "default",
) -> None: ...| Type: | str |
| Description: | Filename to safe to. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Buffer outside the current domain to account for edge effects when interpolating the topography/bathymetry. |
| Type: | str |
| Default value: | 'default' |
| Description: | Resolution for the topography. Possibilities are "low"/"default", "med", "high", and"max'. |
def estimate_max_travel_distance_in_m(self) -> float: ...def is_point_inside_domain(
self,
x: salvus._core.types.float_,
y: salvus._core.types.float_,
z: salvus._core.types.float_ | None = None,
) -> bool: ...| Type: | salvus._core.types.float_ |
| Description: | x-coordinate to test. |
| Type: | salvus._core.types.float_ |
| Description: | y-coordinate to test. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | z-coordinate to test. If None test will only be done for the x- and y-coordinates. Defaults to None. |
ipyleaflet to plot the domain, and optionally
the sources and receivers. See the online documentation for
ipyleaflet for information on the relevant parameters.def plot(
self,
zoom: int | None = None,
events: Event | list[Event] | None = None,
basemap: xyzservices.lib.TileProvider = {
"url": "https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",
"max_zoom": 17,
"html_attribution": 'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)',
"attribution": "Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)",
"name": "OpenTopoMap",
},
cluster: bool = False,
) -> ipyleaflet.Map: ...| Type: | int | None |
| Default value: | None |
| Description: | Zoom level to create the map with. If None, it will zoom to the domain bounds. |
| Type: | xyzservices.lib.TileProvider |
| Default value: | {'url': 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', 'max_zoom': 17, 'html_attribution': 'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)', 'attribution': 'Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)', 'name': 'OpenTopoMap'} |
| Description: | The background map. |
| Type: | bool |
| Default value: | False |
| Description: | If a very large number of sources and receivers are passed, the map rendering can become slow. Cluster tries to reduce noise on the map by grouping close objects together. |
def write(self, filename: pathlib.Path) -> None: ...| Type: | pathlib.Path |
| Description: | Filename to write it to. |