salvus.project.configuration.topography.spherical
Classes
MohoTopography
MohoTopographyclass MohoTopography(
salvus.project.configuration.topography.spherical._SphericalBase
):
def __init__(
self,
name: str,
data: Union[pathlib.Path, str],
use_symlink: bool = False,
):
...Spherical topography.
Parameters
namestr — Name of the topography.dataUnion[pathlib.Path, str] — Filename with the data.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.
Attributes
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 strName of the topography configuration.
no_deformation_below Optional[float]
no_deformation_below Optional[float]Don’t deform below this value.
reference_elevation float
reference_elevation floatReference elevation height.
relative_elevation_model numpy.ndarray
relative_elevation_model numpy.ndarrayRelative elevation model.
Methods
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.
Parameters
parent_folderpathlib.Path — Path to which the serialized model is relative to.dDict — Dictionary containing its init parameters and a few other things.
Returns _ModelBase
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).
Parameters
parent_folderUnion[str, pathlib.Path] — Parent folder where the JSON + NetCDF files should be stored.
Returns Dict
SurfaceTopography
SurfaceTopographyclass SurfaceTopography(
salvus.project.configuration.topography.spherical._SphericalBase
):
def __init__(
self,
name: str,
data: Union[pathlib.Path, str],
use_symlink: bool = False,
):
...Spherical topography.
Parameters
namestr — Name of the topography.dataUnion[pathlib.Path, str] — Filename with the data.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.
Attributes
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 strName of the topography configuration.
no_deformation_below Optional[float]
no_deformation_below Optional[float]Don’t deform below this value.
reference_elevation float
reference_elevation floatReference elevation height.
relative_elevation_model numpy.ndarray
relative_elevation_model numpy.ndarrayRelative elevation model.
Methods
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.
Parameters
parent_folderpathlib.Path — Path to which the serialized model is relative to.dDict — Dictionary containing its init parameters and a few other things.
Returns _ModelBase
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).
Parameters
parent_folderUnion[str, pathlib.Path] — Parent folder where the JSON + NetCDF files should be stored.
Returns Dict