create_subproblems.py¶
-
lib.create_subproblems.
cut_raster
(paths, param)¶ This function decides, based on the user preference in use_shapefile, whether to call the module
cut_raster_using_shapefile
orcut_raster_using_boxes
.- Parameters
paths (dict) – Dictionary of paths to inputs and outputs.
param (dict) – Dictionary of parameters and user preferences.
- Returns
The submodules
cut_raster_using_shapefile
andcut_raster_using_boxes
have their own outputs.- Return type
None
-
lib.create_subproblems.
cut_raster_using_boxes
(paths, param)¶ This function cuts the raster file into a m*n boxes with m rows and n columns.
- Parameters
paths (dict) – The paths to the input rasters inputs, to the output raster parts sub_rasters, and to the CSV file input_stats which will be updated.
param (dict) – Parameters that include the number of rows and cols, and the raster_names.
- Returns
The raster parts are saved as GEOTIFF files, and the CSV file input_stats is updated.
- Return type
None
-
lib.create_subproblems.
cut_raster_using_shapefile
(paths, param)¶ This function cuts the raster file into parts using the features of a shapefile of (multi)polygons. Each feature is used as a mask, so that only the pixels lying on it are extracted and saved in a separate raster file.
- Parameters
paths (dict) – The paths to the input rasters inputs, to the shapefile of subregions, to the output raster parts sub_rasters, and to the CSV file input_stats which will be updated.
param (dict) – Parameters that include the array Crd_all, the array res_desired and the dictionary GeoRef for georeferencing the output rasters, the minimum valid value minimum_valid, and the raster_names.
- Returns
The raster parts are saved as GEOTIFF files, and the CSV file input_stats is updated.
- Return type
None