Required
da| Type: | xr.DataArray |
| Description: | The interface represented as a DataArray. |
class Curve(salvus.mesh.layered_meshing.interface.Interface):
def __init__(
self,
da: xr.DataArray,
extender: typing.Callable[
[xr.DataArray, xr.DataArray], xr.DataArray
] = salvus.utils.xarray_tools.extrude_like_and_pad,
interpolation_method: typing.Literal["nearest", "linear"] = "linear",
) -> None: ...| Type: | xr.DataArray |
| Description: | The interface represented as a DataArray. |
| Type: | typing.Callable[[xr.DataArray, xr.DataArray], xr.DataArray] |
| Default value: | salvus.utils.xarray_tools.extrude_like_and_pad |
| Description: | A function that can be used extend the boundaries of the interface past its defined extents. |
| Type: | typing.Literal['nearest', 'linear'] |
| Default value: | 'linear' |
| Description: | The interpolation method used to evaluate the interface between grid points. |
dict[str, typing.Any])-The object's parameters minus its xarray representation.xr.DataArray)-Get the DEM in absolute coordinates.bool)-Query whether the interface is flat.float)-Get the interface's maximum elevation.float)-Get the interface's minimum elevation.float)-Get the interface's reference elevation.def from_dataarray(
da: xr.DataArray,
extender: typing.Callable[
[xr.DataArray, xr.DataArray], xr.DataArray
] = salvus.utils.xarray_tools.extrude_like_and_pad,
interpolation_method: typing.Literal["nearest", "linear"] = "linear",
) -> Interface: ...| Type: | xr.DataArray |
| Description: | The data array. |
| Type: | typing.Callable[[xr.DataArray, xr.DataArray], xr.DataArray] |
| Default value: | salvus.utils.xarray_tools.extrude_like_and_pad |
| Description: | A function that can be used extend the boundaries of the interface past its defined extents. |
| Type: | typing.Literal['nearest', 'linear'] |
| Default value: | 'linear' |
| Description: | The interpolation method used to evaluate the interface between grid points. |
def from_points(
c: npt.ArrayLike,
dem: npt.ArrayLike,
reference_elevation: float | Depth | Height,
axis: str,
interpolation_method: typing.Literal["nearest", "linear"] = "linear",
extender: typing.Callable[
[xr.DataArray, xr.DataArray], xr.DataArray
] = salvus.utils.xarray_tools.extrude_like_and_pad,
) -> Curve: ...| Type: | npt.ArrayLike |
| Description: | The value of the independent coordinate. |
| Type: | npt.ArrayLike |
| Description: | The value of the relative digital elevation model. Must be on the same grid as c. |
| Type: | float | Depth | Height |
| Description: | The elevation to which the 0.0 value in the dem parameter refers to. A plain float specifies an absolute reference coordinate, while either a Depth or Height value specifies depth below or height above a domain's top and bottom bounds respectively. |
| Type: | str |
| Description: | The axis to which the independent coordinate refers to. Must be one of "x", "y", "latitude", or "longitude". |
| Type: | typing.Literal['nearest', 'linear'] |
| Default value: | 'linear' |
| Description: | Method to use for interpolating this curve between its defined points. |
| Type: | typing.Callable[[xr.DataArray, xr.DataArray], xr.DataArray] |
| Default value: | salvus.utils.xarray_tools.extrude_like_and_pad |
| Description: | Callable to use to extend the curve past its defined domain. Useful, for instance, when absorbing boundaries are used to extend the domain. |
def extrude_like_and_pad(
data: XrType,
like: xr.Dataset | xr.DataArray,
rel_tol: float = 0.0001,
update_bounds: bool = False,
) -> XrType: ...| Type: | XrType |
| Description: | The input data array or set. |
| Type: | xr.Dataset | xr.DataArray |
| Description: | The data array to extrude and pad like. |
| Type: | float |
| Default value: | 0.0001 |
| Description: | This tolerance is used to determine whether extrusion needs to occur. It will be multiplied by the smallest difference between coordinate value in data. If data does not fully enclose like, but the difference in extents is less than this tolerance, then no extrusion will occur. |
| Type: | bool |
| Default value: | False |
| Description: | If True, adjust the coordinate bounds of data so that, for each coordinate, the minimum and maximum values are set to the most extreme values found in either data or like. This is useful for ensuring that small numerical differences (less than the threshold set by rel_tol) do not prevent the coordinates from being treated as matching, effectively "snapping" the bounds to a common range. |
DataArray's coordinates.extend method to ensure that it spans the
coordinates spanned by other with the desired expansion behavior.def interp_like(self, like: xr.DataArray) -> typing.Self: ...| Type: | xr.DataArray |
| Description: | The DataArray on which to interpolate this interface. |
def map(
self,
f: typing.Callable[[xr.DataArray], xr.DataArray],
as_type: type | None = None,
) -> Interface: ...| Type: | typing.Callable[[xr.DataArray], xr.DataArray] |
| Description: | The function used to modify the DataArray. Must take and return a DataArray. |
| Type: | type | None |
| Default value: | None |
| Description: | Modify the type of the mapped DataArray. Useful for upcasting from a Hyperplane to a heterogeneous container, or vice versa. |
DataArray representation.def map_representation(
self, f: typing.Callable[[xr.DataArray], xr.DataArray]
) -> typing.Self: ...| Type: | typing.Callable[[xr.DataArray], xr.DataArray] |
| Description: | Function transform with. |