smash.tools.raster_handler.gdal_crop_dataset_to_array#
- smash.tools.raster_handler.gdal_crop_dataset_to_array(dataset=<object object>, window={}, band=1, lacuna=None)[source]#
Read the raster bands from gdal object and crop the array according the window
- Parameters:
- datasetgdal object from gdal.Open()
- window: window to crop (in grid unit)
- band: the band number to be read. default is band number 1
- lacuna: None or float64
- Returns:
- sliced_arrayan array
Examples
window=gdal_smash_window_from_geotransform(dataset,smash_mesh) array=gdal_crop_dataset_to_array(dataset,window,band=1)