revrt.utilities.base.load_data_using_layer_file_profile#
- load_data_using_layer_file_profile(layer_fp, geotiff, tiff_chunks='file', layer_dirs=None, band_index=None)[source]#
Load GeoTIFF data, reprojecting to LayeredFile CRS if needed
- Parameters:
layer_fp (path-like) – Path to layered file on disk. This file must already exist.
geotiff (path-like) – Path to GeoTIFF from which data should be read.
tiff_chunks (
int | str
, default"file"
) – Chunk size to use when reading the GeoTIFF file. This will be passed down as thechunks
argument torioxarray.open_rasterio()
. By default,"file"
.layer_dirs (iterable of path-like, optional) – Directories to search for geotiff in, if not found in current directory. By default,
None
, which means only the current directory is searched.band_index (
int
, optional) – Optional index of band to load from the GeoTIFF. If provided, only that band will be returned. By default,None
, which means all bands will be returned.
- Returns:
array-like – Raster data.
- Raises:
revrtFileNotFoundError – If geotiff cannot be found in either the current directory or the layer_dir directory.