invert4geom.create_topography

invert4geom.create_topography#

create_topography(method, region, spacing, dampings=None, registration='g', upward=None, upwards=None, coord_names=('easting', 'northing'), projection=None, constraints_df=None, weights=None, weights_col=None, block_size=None, block_reduction='median', upper_confining_layer=None, lower_confining_layer=None, dataset_to_add=None)[source]#

Create a grid of topography data from either the interpolation (with splines) of point data or creating a grid of constant value. Optionally, a subset of point data can be interpolated and then merged with an existing grid. To do this, constraints_df must contain two additional columns of booleans, inside which is True for points inside the region of interest, and False otherwise, and buffer which is True for points within a buffer region around the region of interest, and False otherwise. Inside and Buffer points are used to interpolated the data, and then the interpolated data (without the buffer zone) is merged with the points outside the region of interest. For interpolations, block_size can be supplied to perform a block-median filtering of the points before fitting the spline, reducing the computational cost.

Parameters:
  • method (str) – method to use, either flat or splines

  • region (tuple[float, float, float, float]) – bounding region to use for the output grid. If you are using projected coordinates (meters), this is in the format (min_easting, max_easting, min_northing, max_northing). If using geographic coordinates (latitude and longitude), this is in the format (min_longitude, max_longitude, min_latitude, max_latitude)

  • spacing (float) – spacing of the grid in meters if using projected coordinates, or in decimal degrees if using geographic coordinates

  • dampings (list[float] | None) – damping values to use in spline cross validation for method spline, by default None

  • registration (str) – choose between gridline g or pixel p registration, by default g

  • upward (float | None) – constant elevation in meters to use for method flat, by default None

  • upwards (float | None) – deprecated, use upward instead, by default None

  • coord_names (tuple[str, str]) – names to use for coordinates, should be either (easting, northing) or (longitude, latitude), by default (easting, northing)

  • projection (Proj | None) – if using geographic coordinates (latitude and longitude) and the splines method, provide a pyproj Proj object to convert to cartesian coordinates, by default None

  • constraints_df (DataFrame | None) – dataframe with column β€˜upward’ to use for method splines, and optionally columns inside and buffer, by default None

  • weights (Series | ndarray[tuple[Any, ...], dtype[TypeVar(_ScalarT, bound= generic)]] | None) – weight to use for fitting the spline. Typically, this should be 1 over the data uncertainty squared, by default None

  • weights_col (str | None) – instead of passing the weights, pass the name of the column containing the weights, by default None

  • block_size (float | None) – block size to use for block-reduction of constraint points before fitting splines. In meters if using projected coordinates, or in decimal degrees if using geographic coordinates. If None, no block-reduction is applied, by default None

  • block_reduction (str) – type of block reduction to apply, if median, weights will be ignored, of mean, and weights are provided, they will be used in the block reduction. Defaults to median.

  • upper_confining_layer (DataArray | None) – layer which the inverted topography should always be below, by default None

  • lower_confining_layer (DataArray | None) – layer which the inverted topography should always be above, by default None

  • dataset_to_add (Dataset | None) – additional variables to add to the topography dataset, such as variables mask or geocentric_radius, by default None

Returns:

a topography grid

Return type:

Dataset