XArray Methods#

DEM Functions#

load_dem(dem_file[, input_var_name, ...])

Load DEM from a raster file and prepare it for use with gsolve.

prepare_dem(dem[, input_var_name, ...])

Prepare a DataArray or DataSet for use with gsolve terrain correction methods.

check_dem(dem[, show])

Check dem has increasing and evenly spaced coordinates.

create_empty_dataarray([var_name, x_dim, y_dim])

Create an empty DataArray with specified dimensions.

Xarray Accessor Class and Methods#

TCorrMethods(xarray_dataarray)

A class to providing accessor methods for xarray.DataArray objects.

TCorrMethods.xc

X coordinates as a numpy array.

TCorrMethods.yc

Y coordinates as a numpy array.

TCorrMethods.xdim

x dimension name.

TCorrMethods.ydim

y dimension name.

TCorrMethods.dx

Node separation in x direction.

TCorrMethods.dy

Node separation in y direction.

TCorrMethods.bounds

Return array extent as an ndarray of form (xmin, ymin, xmax, ymax).

TCorrMethods.cell_edges()

Return coordinates of cell edges.

TCorrMethods.coords_to_indices(point)

Convert cartesian coordinates (x, y) to array indices (i, j).

TCorrMethods.is_compatible(other)

Test that caller and other have same dimensions and size.

TCorrMethods.clip_to_arr(other[, clip_other])

Clip calling DataArray to the dimensions of other, or vice versa.

TCorrMethods.clip_to_points(points[, ...])

Return a copy of this array clipped to the extent of points + max_dist.

TCorrMethods.get_land_sea_mask([...])

Generate a mask array where "land" areas are True and "sea" areas are False.

TCorrMethods.generate_distance_mask([point, ...])

Generate a boolean distance mask from a specified point.

TCorrMethods.apply_mask(mask[, fill_value])

Mask calling DataArray and set masked elements to fill_value.

TCorrMethods.generate_bathymetry_density([...])

Generate a bathymetry density grid from a boolean mask grid or DEM.

TCorrMethods.generate_topo_density([...])

Generate a terrain density grid.

TCorrMethods.get_bathymetry_elevation([...])

Return an array with all elevations > sea level set to sea level.

TCorrMethods.get_topography_elevation([...])

Return an array with all elevations < sea level set to sea level.