Version:

salvus.project.configuration.bathymetry.cartesian

salvus.project.configuration.bathymetry.cartesian salvus project configuration bathymetry cartesian
Cartesian bathymetry models.

Classes

OceanLayer

Approximate the effect of bodies of water with fluid elements.
While the "ocean loading" approximation produces good results when considering lower-frequency waves, it cannot model ocean-rebverbarated phases. When an ocean layer is added to the simulation, true acoustic elements are placed in ocean regions, and these elements are coupled to the crust via a standard fluid-solid coupling algorithm. When the ocean gets to thin (near the shore), the ocean loading approximation is then used.
SIGNATURE
class OceanLayer(
    salvus.project.configuration.bathymetry.cartesian._CartesianBase
):
    def __init__(
        self,
        name: str,
        data: pathlib.Path | str | xr.Dataset,
        reference_elevation: float,
        ocean_surface_datum: float = 0.0,
        ocean_layer_style: str = "match_ocean_bottom",
        ocean_layer_vp: float = 1450.0,
        ocean_layer_density: float = 1020.0,
        ocean_layer_cutoff: float | None = None,
        use_symlink: bool = False,
    ): ...
ARGUMENTS
Required
name
Type:str
Description:
Name of the bathymetry model.
Required
data
Type:pathlib.Path | str | xr.Dataset
Description:
Path to the bathymetry data file, or an xarray Dataset.
Required
reference_elevation
Type:float
Description:
Elevation to which the bathymetry model is referenced.
Optional
ocean_surface_datum
Type:float
Default value:0.0
Description:
The elevation value in the bathymetry file that is considered as the ocean's surface. All elevations less than this value will be considered as underwater. Defaults to 0.0.
Optional
ocean_layer_style
Type:str
Default value:'match_ocean_bottom'
Description:
The method used to refine the elements in the water layer in the horizontal direction. Phases in the vertical direction should be resolved regardless of the option specified here. Options are: "match_ocean_bottom": Use the horizontal element size at the ocean bottom as the horizontal element size within the ocean. This may over- / under-resolve the ocean phases depending on the ratio of the sub-surface to ocean velocities.
Optional
ocean_layer_vp
Type:float
Default value:1450.0
Description:
The (constant) velocity of water in the ocean layer. Defaults to 1450.0 m/s.
Optional
ocean_layer_density
Type:float
Default value:1020.0
Description:
The (constant) density of water in the ocean layer. Defaults to 1020 kg/m**3.
Optional
ocean_layer_cutoff
Type:float | None
Default value:None
Description:
Use the ocean loading approximation once the ocean becomes shallower than this value in meters. Defaults to None, in which case an appropriate value will be computed using the period of the mesh.
Optional
use_symlink
Type:bool
Default value:False
Description:
Don't copy the data to the project but only symlink it. The downside of symlinking is that the project is no longer fully self-contained. The upside is that very large external files that could be used for multiple projects don't get copied.

Properties

  • coordinates(np.ndarray | tuple[np.ndarray, np.ndarray])-Coordinates of the data values.
  • ds(xr.Dataset)-The actual dataset representing the model.
  • name(str)-Model name.
  • ocean_layer_cutoff(float | None)-Ocean layer cutoff.
  • ocean_layer_density(float)-Density of the ocean layer.
  • ocean_layer_style(str)-Style of ocean layer.
  • ocean_layer_vp(float)-P-wave velocity of the ocean layer.
  • reference_elevation(float)-Reference elevation height.
  • relative_elevation_model(np.ndarray)-Relative elevation model.
  • shore_smoothing_factor(float | None)-Shore smoothing factor.

Class Methods

OceanLayer.from_json()
Recreate the object from a dictionary serialization of its initialization parameters.
SIGNATURE
def from_json(parent_folder: pathlib.Path, d: dict) -> _ModelBase: ...
ARGUMENTS
Required
parent_folder
Type:pathlib.Path
Description:
Path to which the serialized model is relative to.
Required
d
Type:dict
Description:
Dictionary containing its init parameters and a few other things.
OceanLayer.from_surface_topography()
Create a bathymetry model from a suitable topography model.
For cartesian domains topography and bathymetry models can be identical. This constructor decorates a cartesian topography model with the necessary parameters for bathymetry.
SIGNATURE
def from_surface_topography(
    name: str,
    topography: SurfaceTopography,
    ocean_layer_style: str = "match_ocean_bottom",
    ocean_surface_datum: float = 0.0,
    ocean_layer_vp: float = 1450.0,
    ocean_layer_density: float = 1020.0,
    ocean_layer_cutoff: float | None = None,
    use_symlink: bool = False,
) -> OceanLayer: ...
ARGUMENTS
Required
name
Type:str
Description:
Name of the bathymetry model.
Required
topography
Type:SurfaceTopography
Description:
Topography model from which to extract bathymetry.
Optional
ocean_layer_style
Type:str
Default value:'match_ocean_bottom'
Description:
The method used to refine the elements in the water layer in the horizontal direction. Phases in the vertical direction should be resolved regardless of the option specified here. Options are: "match_ocean_bottom": Use the horizontal element size at the ocean bottom as the horizontal element size within the ocean. This may over- / under-resolve the ocean phases depending on the ratio of the sub-surface to ocean velocities.
Optional
ocean_surface_datum
Type:float
Default value:0.0
Description:
The elevation value in the bathymetry file that is considered as the ocean's surface. All elevations less than this value will be considered as underwater. Defaults to 0.0.
Optional
ocean_layer_vp
Type:float
Default value:1450.0
Description:
The (constant) velocity of water in the ocean layer. Defaults to 1450.0 m/s.
Optional
ocean_layer_density
Type:float
Default value:1020.0
Description:
The (constant) density of water in the ocean layer. Defaults to 1020 kg/m**3.
Optional
ocean_layer_cutoff
Type:float | None
Default value:None
Description:
Use the ocean loading approximation once the ocean becomes shallower than this value in meters. Defaults to None, in which case an appropriate value will be computed using the period of the mesh.
Optional
use_symlink
Type:bool
Default value:False
Description:
Don't copy the data to the project but only symlink it. The downside of symlinking is that the project is no longer fully self-contained. The upside is that very large external files that could be used for multiple projects don't get copied.

Methods

OceanLayer.to_json()
Serialize the model to JSON (and an associated NetCDF file).
SIGNATURE
def to_json(self, parent_folder: pathlib.Path | str) -> dict: ...
ARGUMENTS
Required
parent_folder
Type:pathlib.Path | str
Description:
Parent folder where the JSON + NetCDF files should be stored.

Used in tutorials

Functionality from this module is used in the following tutorials.
PAGE CONTENTS