xdem.dDEM#
- class xdem.dDEM(raster, start_time, end_time, error=None)[source]#
A difference-DEM object.
- __init__(raster, start_time, end_time, error=None)[source]#
Create a dDEM object from a Raster.
- Parameters:
raster (
Raster) – A georeferenced Raster object.start_time (
datetime64) – The starting time of the dDEM.end_time (
datetime64) – The end time of the dDEM.error (
Any|None) – An error measure for the dDEM (UNUSED).
- Returns:
A new dDEM instance.
Methods
__init__(raster, start_time, end_time[, error])Create a dDEM object from a Raster.
astype(dtype[, convert_nodata, inplace])coords([grid, shift_area_or_point, force_offset])Get coordinates (x,y) of all pixels in the raster.
copy([new_array])Return a copy of the DEM.
crop(bbox[, mode, inplace])filter(method[, inplace, size])from_array(data, transform, crs, start_time, ...)Create a new dDEM object from an array.
from_pointcloud_regular(pointcloud[, ...])Create a raster from a point cloud with coordinates on a regular grid.
from_xarray(ds[, dtype])Create raster from a xarray.DataArray.
georeferenced_grid_equal(raster)Check that raster shape, geotransform and CRS are equal.
get_bounds_projected(out_crs[, densify_points])Get raster bounds projected in a specified CRS.
get_footprint_projected(out_crs[, ...])Get raster footprint projected in a specified CRS.
get_mask()Get mask of invalid values from the raster.
get_metric_crs([local_crs_type, method])Get local metric coordinate reference system for the raster (UTM, UPS, or custom Mercator or Polar).
get_nanarray([floating_dtype, return_mask])get_stats([stats_name, inlier_mask, band, ...])icrop(bbox, *[, inplace])ij2xy(i, j[, shift_area_or_point, force_offset])Get coordinates (x,y) of indexes (row,column).
info([stats, verbose])interp_points(points[, method, ...])interpolate([method, reference_elevation, mask])Interpolate the dDEM using the given method.
intersection(raster[, match_ref])Returns the bounding box of intersection between this image and another.
load([bands])Load the raster array from disk.
outside_image(xi, yj[, index])Check whether a given point falls outside the raster.
plot([bands, cmap, vmin, vmax, alpha, ...])polygonize([target_values, data_column_name])Polygonize the raster into a vector.
proximity([vector, target_values, ...])Compute proximity distances to the raster target pixels, or to a vector geometry on the raster grid.
raster_equal(other[, strict_masked, ...])Check if two rasters are equal.
reduce_points(points[, reducer_function, ...])Reduce raster values around point coordinates.
reproject([ref, crs, res, grid_size, ...])save(filename[, driver, dtype, nodata, ...])set_area_or_point(new_area_or_point[, ...])Set new pixel interpretation of the raster.
set_mask(mask)Set a mask on the raster array.
set_nodata(new_nodata[, update_array, ...])Set a new nodata value for all bands.
split_bands([copy, bands])Split the bands into separate rasters.
subsample(subsample[, return_indices, ...])to_file(filename[, driver, dtype, nodata, ...])Write the raster to file.
to_pointcloud([data_column_name, data_band, ...])to_points(**kwargs)to_rio_dataset()Export to a Rasterio in-memory dataset.
to_xarray([name])Convert raster to a xarray.DataArray.
translate(xoff, yoff[, distance_unit, inplace])xy2ij(x, y[, op, precision, shift_area_or_point])Get indexes (row,column) of coordinates (x,y).
Attributes
area_or_pointPixel interpretation of the raster.
bandsBand indexes loaded in memory if they are, otherwise on disk.
bands_on_diskBand indexes on disk if a file exists.
boundsBounding coordinates of the raster.
countCount of bands loaded in memory if they are, otherwise the one on disk.
count_on_diskCount of bands on disk if it exists.
crsCoordinate reference system of the raster.
dataArray of the raster.
driverDriver used to read a file on disk.
dtypeData type of the raster (string representation).
fill_methodReturn the fill method used for the filled_data.
filled_dataGet the filled data array if it exists, or else the original data if it has no nans.
footprintFootprint of the raster.
heightHeight of the raster in pixels.
indexesBand indexes (duplicate of .bands attribute, mirroring Rasterio naming "indexes").
is_loadedWhether the raster array is loaded.
is_maskWhether the raster array is a boolean data type (a mask).
is_modifiedWhether the array has been modified since it was loaded from disk.
nameName of the raster file on disk, if it exists.
nodataNodata value of the raster.
profileBasic metadata and creation options of this dataset.
resResolution (X, Y) of the raster in georeferenced units.
shapeShape (i.e., height, width) of the raster in pixels.
tagsMetadata tags of the raster.
timeGet the time duration.
transformGeotransform of the raster.
widthWidth of the raster in pixels.