Skip to content

redplanet.Crust.moho.get

get(
    lon: float | numpy.ndarray,
    lat: float | numpy.ndarray,
    crthick: bool = False,
    as_xarray: bool = False,
) -> (
    float | numpy.ndarray | xarray.core.dataarray.DataArray
)

Get Mohorovičić discontinuity depth (or derived crustal thickness) values at the specified coordinates. Dataset must be loaded first, see redplanet.Crust.moho.load(...).

Parameters:

Name Type Description Default
lon float | np.ndarray

Longitude coordinate(s) in range [-180, 360].

required
lat float | np.ndarray

Latitude coordinate(s) in range [-90, 90].

required
crthick bool

If True, return crustal thickness values, which is just the difference between the moho and a spherical harmonic model of topography evaluated to the same degree (same method as Wieczorek (2022)). Default is False.

False
as_xarray bool

If True, return the data as an xarray.DataArray. Default is False.

False

Returns:

Type Description
float | np.ndarray | xr.DataArray

Data values at the the input coordinates. The return type is determined as follows:

  • float: if both lon and lat are floats.
  • numpy.ndarray (1D): if one of lon or lat is a numpy 1D array and the other is a float.
  • numpy.ndarray (2D): if both lon and lat are numpy 1D arrays. The first dimension of output array corresponds to lat values.
  • xarray.DataArray: see as_xarray parameter (this takes precedence over the above types).

Units are meters [m].

References
  1. Wieczorek, M. A. (2022). InSight Crustal Thickness Archive [Dataset]. Zenodo. https://doi.org/10.5281/zenodo.6477509 [Data from "dichotomy/" is mirrored to https://rutgers.box.com/v/redplanet-data]
Source code in src/redplanet/Crust/moho/getter.py
@substitute_docstrings
def get(
    lon       : float | np.ndarray,
    lat       : float | np.ndarray,
    crthick   : bool = False,
    as_xarray : bool = False
) -> float | np.ndarray | xr.DataArray:
    """
    Get Mohorovičić discontinuity depth (or derived crustal thickness) values at the specified coordinates. Dataset must be loaded first, see `redplanet.Crust.moho.load(...)`.

    Parameters
    ----------
    {param.lon}
    {param.lat}
    crthick : bool, optional
        If True, return crustal thickness values, which is just the difference between the moho and a spherical harmonic model of topography evaluated to the same degree (same method as {@Wieczorek2022_icta.n}). Default is False.
    {param.as_xarray}

    Returns
    -------
    {return.GriddedData}

        Units are meters [m].
    """

    dat_moho = get_dataset()

    return dat_moho.get_values(
        lon = lon,
        lat = lat,
        var = 'crthick' if crthick else 'moho',
        as_xarray = as_xarray,
    )