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, check_tiff=True, fillna=0)[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 (
intorstr, default"file") – Chunk size to use when reading the GeoTIFF file. This will be passed down as thechunksargument torioxarray.open_rasterio(). By default,"file".layer_dirs (
Iterableof 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.check_tiff (
bool, defaultTrue) – Whether to check that the GeoTIFF profile matches the template defined by the layered file. IfTrue, the GeoTIFF profile is compared to the template, and if they don’t match, the GeoTIFF is re-projected to match the template. IfFalse, no checks are performed and the GeoTIFF is loaded as-is. By default,True.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.fillna (
intorfloat, optional) – Value to fill NA cells with after loading the GeoTIFF. IfNone, NA cells will not be filled (and will typically be represented asnp.nanin the output array). By default,0.
- Returns:
array-like – Raster data.
- Raises:
revrtFileNotFoundError – If geotiff cannot be found in either the current directory or the layer_dir directory.