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_dfmust contain two additional columns of booleans,insidewhich is True for points inside the region of interest, and False otherwise, andbufferwhich 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_sizecan 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, eitherflatorsplinesregion (
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 coordinatesdampings (
list[float] |None) β damping values to use in spline cross validation for methodspline, by default Noneregistration (
str) β choose between gridlinegor pixelpregistration, by defaultgupward (
float|None) β constant elevation in meters to use for methodflat, by default Noneupwards (
float|None) β deprecated, use upward instead, by default Nonecoord_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 Noneconstraints_df (
DataFrame|None) β dataframe with column βupwardβ to use for methodsplines, and optionally columnsinsideandbuffer, by default Noneweights (
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 Noneweights_col (
str|None) β instead of passing the weights, pass the name of the column containing the weights, by default Noneblock_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 Noneblock_reduction (
str) β type of block reduction to apply, ifmedian, weights will be ignored, ofmean, and weights are provided, they will be used in the block reduction. Defaults tomedian.upper_confining_layer (
DataArray|None) β layer which the inverted topography should always be below, by default Nonelower_confining_layer (
DataArray|None) β layer which the inverted topography should always be above, by default Nonedataset_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: