Mondaic
This API reference is not for the latest stable Salvus version.

salvus.project.configuration.topography.spherical

Classes

MohoTopography

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

Spherical topography.

Parameters
  • name str — Name of the topography.
  • data Union[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 Union[numpy.ndarray, Tuple[numpy.ndarray, numpy.ndarray]]

Coordinates of the data values.

ds xarray.core.dataset.Dataset

The actual dataset representing the model.

name str

Name of the topography configuration.

no_deformation_below Optional[float]

Don’t deform below this value.

reference_elevation float

Reference elevation height.

relative_elevation_model numpy.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: Union[str, pathlib.Path]) -> Dict:
    ...

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

Parameters
  • parent_folder Union[str, pathlib.Path] — 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: Union[pathlib.Path, str],
        use_symlink: bool = False,
    ):
        ...

Spherical topography.

Parameters
  • name str — Name of the topography.
  • data Union[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 Union[numpy.ndarray, Tuple[numpy.ndarray, numpy.ndarray]]

Coordinates of the data values.

ds xarray.core.dataset.Dataset

The actual dataset representing the model.

name str

Name of the topography configuration.

no_deformation_below Optional[float]

Don’t deform below this value.

reference_elevation float

Reference elevation height.

relative_elevation_model numpy.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: Union[str, pathlib.Path]) -> Dict:
    ...

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

Parameters
  • parent_folder Union[str, pathlib.Path] — Parent folder where the JSON + NetCDF files should be stored.
Returns Dict