rasters

Raster tools

You can use this only if you have installed sertit[full] or sertit[rasters]

Functions

collocate(master_xds, slave_xds[, resampling])

Collocate two georeferenced arrays: forces the slave raster to be exactly georeferenced onto the master raster by reprojection.

crop(xds, shapes[, nodata])

Cropping a dataset: setting nodata outside of the given shapes AND cropping the raster to the shapes extent.

get_dim_img_path(dim_path[, img_name])

Get the image path from a BEAM-DIMAP data.

get_extent(xds)

Get the extent of a raster as a geopandas.Geodataframe.

get_footprint(xds)

Get real footprint of the product (without nodata, in french == emprise utile)

get_nodata_mask(xds)

Get nodata mask from a xarray.

get_nodata_vector(dst[, default_nodata])

Get the nodata vector of a raster as a vector.

get_valid_vector(xds[, default_nodata])

Get the valid data of a raster as a vector.

hillshade(xds[, azimuth, zenith])

Compute the hillshade of a DEM from an azimuth and elevation angle (in degrees).

mask(xds, shapes[, nodata])

Masking a dataset: setting nodata outside of the given shapes, but without cropping the raster to the shapes extent.

merge_gtiff(crs_paths, crs_merged_path, **kwargs)

Merge rasters as a GeoTiff.

merge_vrt(crs_paths, crs_merged_path, **kwargs)

Merge rasters as a VRT.

paint(xds, shapes, value[, invert])

Painting a dataset: setting values inside the given shapes.

path_xarr_dst(function)

Path, xarray or dataset decorator.

read(dst[, resolution, size, resampling, ...])

Read a raster dataset from a :

read_bit_array(bit_mask, bit_id)

Read bit arrays as a succession of binary masks (sort of read a slice of the bit mask, slice number bit_id)

read_uint8_array(bit_mask, bit_id)

Read 8 bit arrays as a succession of binary masks.

set_metadata(naked_xda, mtd_xda[, new_name])

Set metadata from a xr.DataArray to another (including rioxarray metadata such as encoded_nodata and crs).

set_nodata(xda, nodata_val)

Set nodata to a xarray that have no default nodata value.

sieve(xds, sieve_thresh[, connectivity])

Sieving, overloads rasterio function with raster shaped like (1, h, w).

slope(xds[, in_pct, in_rad])

Compute the slope of a DEM (in degrees).

unpackbits(array, nof_bits)

Function found here: https://stackoverflow.com/questions/18296035/how-to-extract-the-bits-of-larger-numeric-numpy-data-types

vectorize(xds[, values, keep_values, ...])

Vectorize a xarray to get the class vectors.

where(cond, if_true, if_false[, master_xda, ...])

Overloads xr.where with:

write(xds, path, **kwargs)

Write raster to disk.