salvus.project.configuration.bathymetry.cartesian
Classes
OceanLayer
OceanLayerclass OceanLayer(
salvus.project.configuration.bathymetry.cartesian._CartesianBase
):
def __init__(
self,
name: str,
data: Union[pathlib.Path, str, xarray.core.dataset.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: Optional[float] = None,
use_symlink: bool = False,
): ...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.
namestr — Name of the bathymetry model.dataUnion[pathlib.Path, str, xarray.core.dataset.Dataset] — Path to the bathymetry data file, or an xarray Dataset.reference_elevationfloat — Elevation to which the bathymetry model is referenced.ocean_surface_datumfloat — 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.ocean_layer_stylestr — 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.ocean_layer_vpfloat — The (constant) velocity of water in the ocean layer. Defaults to 1450.0 m/s.ocean_layer_densityfloat — The (constant) density of water in the ocean layer. Defaults to 1020 kg/m**3.ocean_layer_cutoffOptional[float] — 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.use_symlinkbool — 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.
coordinates Union[numpy.ndarray, Tuple[numpy.ndarray, numpy.ndarray]]
coordinates Union[numpy.ndarray, Tuple[numpy.ndarray, numpy.ndarray]]Coordinates of the data values.
ds xarray.core.dataset.Dataset
ds xarray.core.dataset.DatasetThe actual dataset representing the model.
name str
name strModel name.
ocean_layer_cutoff Optional[float]
ocean_layer_cutoff Optional[float]Ocean layer cutoff.
ocean_layer_density float
ocean_layer_density floatDensity of the ocean layer.
ocean_layer_style str
ocean_layer_style strStyle of ocean layer.
ocean_layer_vp float
ocean_layer_vp floatP-wave velocity of the ocean layer.
reference_elevation float
reference_elevation floatReference elevation height.
relative_elevation_model numpy.ndarray
relative_elevation_model numpy.ndarrayRelative elevation model.
shore_smoothing_factor Optional[float]
shore_smoothing_factor Optional[float]Shore smoothing factor.
from_json()
from_json()def from_json(parent_folder: pathlib.Path, d: Dict) -> _ModelBase: ...Recreate the object from a dictionary serialization of its initialization parameters.
parent_folderpathlib.Path — Path to which the serialized model is relative to.dDict — Dictionary containing its init parameters and a few other things.
from_surface_topography()
from_surface_topography()def from_surface_topography(
name: str,
topography: salvus.project.configuration.topography.cartesian.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: Optional[float] = None,
use_symlink: bool = False,
) -> OceanLayer: ...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.
namestr — Name of the bathymetry model.topographysalvus.project.configuration.topography.cartesian.SurfaceTopography — Topography model from which to extract bathymetry.ocean_layer_stylestr — 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.ocean_surface_datumfloat — 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.ocean_layer_vpfloat — The (constant) velocity of water in the ocean layer. Defaults to 1450.0 m/s.ocean_layer_densityfloat — The (constant) density of water in the ocean layer. Defaults to 1020 kg/m**3.ocean_layer_cutoffOptional[float] — 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.use_symlinkbool — 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.
to_json()
to_json()def to_json(self, parent_folder: Union[str, pathlib.Path]) -> Dict: ...Serialize the model to JSON (and an associated NetCDF file).
parent_folderUnion[str, pathlib.Path] — Parent folder where the JSON + NetCDF files should be stored.