Mondaic

salvus.project.configuration.topography.spherical

salvus.project.configuration.topography.spherical salvus project configuration topography spherical

Spherical topography.

Classes

MohoTopography

class MohoTopography(
    salvus.project.configuration.topography.spherical._SphericalBase
):
    def __init__(
        self, name: str, data: pathlib.Path | str, use_symlink: bool = False
    ): ...

Spherical topography.

Parameters
  • name str — Name of the topography.
  • data pathlib.Path | str — Filename with the data.
  • use_symlink bool — 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.
Attributes
coordinates np.ndarray | tuple[np.ndarray, np.ndarray]

Coordinates of the data values.

ds xr.Dataset

The actual dataset representing the model.

name str

Name of the topography configuration.

no_deformation_below float | None

Don’t deform below this value.

reference_elevation float

Reference elevation height.

relative_elevation_model np.ndarray

Relative elevation model.

Methods
from_json()
def from_json(parent_folder: pathlib.Path, d: dict) -> _ModelBase: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • parent_folder pathlib.Path — Path to which the serialized model is relative to.
  • d dict — Dictionary containing its init parameters and a few other things.
Returns _ModelBase
to_json()
def to_json(self, parent_folder: pathlib.Path | str) -> dict: ...

Serialize the model to JSON (and an associated NetCDF file).

Parameters
  • parent_folder pathlib.Path | str — Parent folder where the JSON + NetCDF files should be stored.
Returns dict

SurfaceTopography

class SurfaceTopography(
    salvus.project.configuration.topography.spherical._SphericalBase
):
    def __init__(
        self, name: str, data: pathlib.Path | str, use_symlink: bool = False
    ): ...

Spherical topography.

Parameters
  • name str — Name of the topography.
  • data pathlib.Path | str — Filename with the data.
  • use_symlink bool — 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.
Attributes
coordinates np.ndarray | tuple[np.ndarray, np.ndarray]

Coordinates of the data values.

ds xr.Dataset

The actual dataset representing the model.

name str

Name of the topography configuration.

no_deformation_below float | None

Don’t deform below this value.

reference_elevation float

Reference elevation height.

relative_elevation_model np.ndarray

Relative elevation model.

Methods
from_json()
def from_json(parent_folder: pathlib.Path, d: dict) -> _ModelBase: ...

Recreate the object from a dictionary serialization of its initialization parameters.

Parameters
  • parent_folder pathlib.Path — Path to which the serialized model is relative to.
  • d dict — Dictionary containing its init parameters and a few other things.
Returns _ModelBase
to_json()
def to_json(self, parent_folder: pathlib.Path | str) -> dict: ...

Serialize the model to JSON (and an associated NetCDF file).

Parameters
  • parent_folder pathlib.Path | str — Parent folder where the JSON + NetCDF files should be stored.
Returns dict

Used in tutorials