Back to Article
1. Load SuitabilityMappingTools.py script
Download Notebook

The SuitabilityMappingTools.py script is a Python-based geospatial analysis tool designed to process, analyze, and conduct sensitivity assessments on raster datasets (GeoTIFF files).

The script is specifically built to facilitate weighted overlay analysis (WOA) or weighted linear combinations (WLC) for environmental and hydrological suitability mapping, using raster layers representing different thematic variables (e.g., subsurface infiltration potential).

In this notebook we perform a sensitivity analysis on a subset of the ponderosa pine forested area within Arizona, USA. The analysis does the following.

  1. Load SuitabilityMappingTools.py script
  2. Set the directory containing the data (tif files)
  3. Check that data is all the same size and projection
  4. Plot all the data to give a visual check that the data looks how it should
  5. Perform a sensitivity analysis on the SbII index data 5a. Weight swapping 5b. variable removal
  6. Plot the SBII results of the sensitivity analysis
  7. repeat steps 5 & 6 for SMII
  8. repeat steps 5 & 6 for VDI
  9. repeat steps 5 & 6 for Final Suitability
In [1]:
## install the required packages
%pip install rasterio
%pip install matplotlib
%pip install pandas
%pip install seaborn
%pip install tabulate
Collecting tabulate
  Downloading tabulate-0.9.0-py3-none-any.whl.metadata (34 kB)
Downloading tabulate-0.9.0-py3-none-any.whl (35 kB)
Installing collected packages: tabulate
Successfully installed tabulate-0.9.0
Note: you may need to restart the kernel to use updated packages.

[notice] A new release of pip is available: 24.3.1 -> 25.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip

1. Load SuitabilityMappingTools.py script

In [2]:
import SuitabilityMappingTools as smt
import os
SuitabilityMappingTools has been loaded

2. Set the directory containing the data (tif files)

In [2]:
# lets set the variables for where our data is, and where the results should go
os.getcwd()
data_dir = r'G:\Data\Thinning_Recharge_Final_Data\SA\resampled'

3. Check that data is all the same size and projection

In [7]:
# now lets get info on the layers we have
smt.get_dir_info(data_dir)
{'File': 'Final_Suit.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\Final_Suit.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.1899999), 'Max Value': np.float32(8.61336), 'Mean Value': np.float32(5.9957256), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sBA_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sBA_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(7.940568), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'Sbii.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\Sbii.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(3.3500001), 'Max Value': np.float32(9.0), 'Mean Value': np.float32(6.6547184), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sCC_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sCC_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(7.8302107), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'SF.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\SF.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(8.0), 'Mean Value': np.float32(6.21031), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sLD5_10_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sLD5_10_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(5.0), 'Max Value': np.float32(9.0), 'Mean Value': np.float32(5.7170258), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'SMii.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\SMii.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(0.6667), 'Max Value': np.float32(9.3334), 'Mean Value': np.float32(5.0084877), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sPK5_10_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sPK5_10_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(5.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(7.8721204), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sPm_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sPm_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(3.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(8.262257), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sPo_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sPo_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(3.6713552), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sSF_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sSF_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(8.0), 'Mean Value': np.float32(6.21031), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sSoilK_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sSoilK_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(4.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(6.089721), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'sTRMI_SA_pp_nd_rsmp.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\sTRMI_SA_pp_nd_rsmp.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(1.0), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(5.056199), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}
{'File': 'VDI.tif', 'Filepath': 'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\VDI.tif', 'Projection': CRS.from_wkt('PROJCS["NAD83(2011) / UTM zone 12N",GEOGCS["NAD83(2011)",DATUM["NAD83_National_Spatial_Reference_System_2011",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","1116"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","6318"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-111],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","6341"]]'), 'Min Value': np.float32(0.3333), 'Max Value': np.float32(10.0), 'Mean Value': np.float32(7.246992), 'Extent': BoundingBox(left=445653.43769999966, bottom=3798617.068499999, right=510453.43769999966, top=3864347.068499999), 'Width': 2160, 'Height': 2191, 'Dimensions': (2191, 2160), 'Data Type': 'float32'}

All our data is in the same projection, and is the same size. This is something you should always check. If the projections are different you will have to reproject the data before trying to use this tool.

However if the data is not the same size, you can use the resample_layers() function to resample the data to the same size.

next lets plot the layers so I can explain what they are: use the plot_layers() function to do this

4. Plot all the data to give a visual check that the data looks how it should

In [8]:
smt.plot_layers(data_dir)

5. Perform a sensitivity analysis on the SbII index data

The Subsurface infiltration index contains four thematic layers, each representing a different subsurface property. These are:

sLD - scaled lineament density (5-10) created using 1-arcsec DEM extracted using PCI Geomatica Catalyst LINE Module sPK - Scaled Potential Karst (5-10) from USA Karst Map sPm - Scaled permeability (1-10) from GLHYMPS v2 sPo - Scaled Porosity (1-10) fom GLHYMPS v2

All layers have been scaled (linearly) from 5-10 or 1-10. Permeability and Porosity represent the subsurface properties of lithology (particularly the matrix), while lineament density and potential karst represent give indications of the density of features that may have secondary or tertiary permeability and porosity

How the sensitivity analysis will work, is that we will get the four thematic layers mentioined above then:

5.1 perform an analysis on the effects of shuffling or swapping the weights, and see how this affects the final SbII index. When I say, effect, we are looking at the change in the distributioin of values (the histogram of values) as well as the shift in the mean pixel value, and the % of pixels with values greater than 5, 6 & 7. Additionally, each run of the sensitivity analysis produces a different SbII index raster, we will look at the Coefficient of Variation (CoV), the mean, range, and standard deviation of the SbII index values spatially, so we can see which pixels have higher variablility than others.

5.2 Then we will perform a sensitivity analysis where we remove variables One-at-a-time (OAT), and then equally weight the remaining variables to see what the effect of variable removal has on the final SbII index. (Looking for the same affects as described above.)

In [3]:
""" In this step we select which files we want to combine to create the SbII index, when you run this the
select_tif_files() function it shows you all the data that is available and you choose the sLD, sPK, sPM, and sPo layers by their indices """
files_list = smt.select_tif_files(data_dir)

# input: 5,7,8,9
# output: ['sLD', 'sPK', 'sPM', 'sPo']
# the filenames can be confusing but SA means its the sensitivity analysis area, 
# pp means its been masked to only look at ponderosa pine pixels
# nd means non ponderosa pine pixels are no-data
# rsmp means the layer has been resampled so that they all are the same dimensions (some of them were different by 1,2 pixels)

Available .tif files:
0: Final_Suit
1: sBA_SA_pp_nd_rsmp
2: Sbii
3: sCC_SA_pp_nd_rsmp
4: SF
5: sLD5_10_SA_pp_nd_rsmp
6: SMii
7: sPK5_10_SA_pp_nd_rsmp
8: sPm_SA_pp_nd_rsmp
9: sPo_SA_pp_nd_rsmp
10: sSF_SA_pp_nd_rsmp
11: sSoilK_SA_pp_nd_rsmp
12: sTRMI_SA_pp_nd_rsmp
13: VDI
Enter the indices of the files you want to select (comma-separated)

This next step creates the index, what it really does is create the Sbii.tif file you see above, which we will use later for the sensitivity analysis of the final suitability index.

In [4]:
# next lets set the weights of the layers, we are going to type 'Y" into the user input and hit enter, then add the following weights using the user_input box
# 0.15,0.2,0.4,0.25
file_list_w = smt.define_weights(files_list, True)
# lets make sure we set the weights correctly
smt.check_weights(file_list_w)

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.25

Enter new weights (comma-separated). Make sure they sum to 1.
In [12]:
# Now that we have set the weights lets combine the layers using those weights to create an index of subsurface infiltration potential
smt.create_weighted_index(file_list_w, 'Subsurface_infiltration_potential')
output_file_directory: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\Subsurface_infiltration_potential.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\Subsurface_infiltration_potential.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 6 :0.00%
Percentage of pixels in bin 4: count = 1595 :0.06%
Percentage of pixels in bin 5: count = 640099 :26.08%
Percentage of pixels in bin 6: count = 488155 :19.89%
Percentage of pixels in bin 7: count = 1324149 :53.95%
Percentage of pixels in bin 8: count = 266 :0.01%
Percentage of pixels in bin 9: count = 10 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\weighted_layers\\Subsurface_infiltration_potential.tif'
In [13]:
# plot the resulting layer
output_dir = data_dir + r'\weighted_layers'
smt.plot_layers(output_dir)

5a Sensitivity analysis of the SbII index data using weight shuffling

In [5]:
# ensure we have the correct layers and they are weighted correctly.[0.15,0.2,0.4,0.25]
file_list_w = smt.define_weights(files_list, True)
output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_weights(file_list_w, 'SbII')

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.25

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_0.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_0.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 6 :0.00%
Percentage of pixels in bin 4: count = 1595 :0.06%
Percentage of pixels in bin 5: count = 640099 :26.08%
Percentage of pixels in bin 6: count = 488155 :19.89%
Percentage of pixels in bin 7: count = 1324149 :53.95%
Percentage of pixels in bin 8: count = 266 :0.01%
Percentage of pixels in bin 9: count = 10 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_1.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_1.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 861 :0.04%
Percentage of pixels in bin 5: count = 1010001 :41.15%
Percentage of pixels in bin 6: count = 1425396 :58.08%
Percentage of pixels in bin 7: count = 15780 :0.64%
Percentage of pixels in bin 8: count = 1889 :0.08%
Percentage of pixels in bin 9: count = 25 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_2.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_2.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 343 :0.01%
Percentage of pixels in bin 5: count = 995875 :40.58%
Percentage of pixels in bin 6: count = 87529 :3.57%
Percentage of pixels in bin 7: count = 1370311 :55.83%
Percentage of pixels in bin 8: count = 174 :0.01%
Percentage of pixels in bin 9: count = 43 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_3.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_3.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 852 :0.03%
Percentage of pixels in bin 5: count = 992393 :40.44%
Percentage of pixels in bin 6: count = 125411 :5.11%
Percentage of pixels in bin 7: count = 1329708 :54.18%
Percentage of pixels in bin 8: count = 5886 :0.24%
Percentage of pixels in bin 9: count = 25 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_4.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_4.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 956 :0.04%
Percentage of pixels in bin 5: count = 995787 :40.57%
Percentage of pixels in bin 6: count = 1439515 :58.65%
Percentage of pixels in bin 7: count = 17455 :0.71%
Percentage of pixels in bin 8: count = 196 :0.01%
Percentage of pixels in bin 9: count = 43 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.15
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_5.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_5.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 1827 :0.07%
Percentage of pixels in bin 5: count = 106346 :4.33%
Percentage of pixels in bin 6: count = 1019563 :41.54%
Percentage of pixels in bin 7: count = 1326077 :54.03%
Percentage of pixels in bin 8: count = 452 :0.02%
Percentage of pixels in bin 9: count = 10 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_6.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_6.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 6 :0.00%
Percentage of pixels in bin 4: count = 1610 :0.07%
Percentage of pixels in bin 5: count = 641638 :26.14%
Percentage of pixels in bin 6: count = 903817 :36.83%
Percentage of pixels in bin 7: count = 906967 :36.95%
Percentage of pixels in bin 8: count = 242 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_7.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_7.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 870 :0.04%
Percentage of pixels in bin 5: count = 1470504 :59.92%
Percentage of pixels in bin 6: count = 964908 :39.32%
Percentage of pixels in bin 7: count = 15791 :0.64%
Percentage of pixels in bin 8: count = 1879 :0.08%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_8.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_8.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 1062 :0.04%
Percentage of pixels in bin 5: count = 995147 :40.55%
Percentage of pixels in bin 6: count = 91283 :3.72%
Percentage of pixels in bin 7: count = 1366580 :55.68%
Percentage of pixels in bin 8: count = 193 :0.01%
Percentage of pixels in bin 9: count = 10 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_9.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_9.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 857 :0.03%
Percentage of pixels in bin 5: count = 926837 :37.76%
Percentage of pixels in bin 6: count = 191908 :7.82%
Percentage of pixels in bin 7: count = 1146253 :46.70%
Percentage of pixels in bin 8: count = 188425 :7.68%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_10.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_10.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 1637 :0.07%
Percentage of pixels in bin 5: count = 995430 :40.56%
Percentage of pixels in bin 6: count = 1437641 :58.58%
Percentage of pixels in bin 7: count = 19058 :0.78%
Percentage of pixels in bin 8: count = 176 :0.01%
Percentage of pixels in bin 9: count = 10 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.2
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_11.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_11.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 1820 :0.07%
Percentage of pixels in bin 5: count = 130060 :5.30%
Percentage of pixels in bin 6: count = 1005913 :40.99%
Percentage of pixels in bin 7: count = 1310589 :53.40%
Percentage of pixels in bin 8: count = 5893 :0.24%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_12.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_12.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 396 :0.02%
Percentage of pixels in bin 5: count = 1016070 :41.40%
Percentage of pixels in bin 6: count = 1424655 :58.05%
Percentage of pixels in bin 7: count = 13123 :0.53%
Percentage of pixels in bin 8: count = 36 :0.00%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_13.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_13.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 824 :0.03%
Percentage of pixels in bin 5: count = 1014718 :41.34%
Percentage of pixels in bin 6: count = 1243238 :50.66%
Percentage of pixels in bin 7: count = 195481 :7.96%
Percentage of pixels in bin 8: count = 19 :0.00%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.25

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_14.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_14.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 828 :0.03%
Percentage of pixels in bin 5: count = 941133 :38.35%
Percentage of pixels in bin 6: count = 1495686 :60.94%
Percentage of pixels in bin 7: count = 16602 :0.68%
Percentage of pixels in bin 8: count = 31 :0.00%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.25
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_15.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_15.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 767 :0.03%
Percentage of pixels in bin 5: count = 600746 :24.48%
Percentage of pixels in bin 6: count = 959896 :39.11%
Percentage of pixels in bin 7: count = 892632 :36.37%
Percentage of pixels in bin 8: count = 239 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_16.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_16.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 560 :0.02%
Percentage of pixels in bin 5: count = 941324 :38.35%
Percentage of pixels in bin 6: count = 1318811 :53.74%
Percentage of pixels in bin 7: count = 193341 :7.88%
Percentage of pixels in bin 8: count = 244 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.4
sPK5_10_SA_pp_nd_rsmp.tif: 0.25
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_17.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_17.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 762 :0.03%
Percentage of pixels in bin 5: count = 940894 :38.34%
Percentage of pixels in bin 6: count = 619787 :25.25%
Percentage of pixels in bin 7: count = 892580 :36.37%
Percentage of pixels in bin 8: count = 257 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_18.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_18.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 851 :0.03%
Percentage of pixels in bin 5: count = 1427272 :58.15%
Percentage of pixels in bin 6: count = 1008141 :41.08%
Percentage of pixels in bin 7: count = 15819 :0.64%
Percentage of pixels in bin 8: count = 1869 :0.08%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.15
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_19.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_19.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 1592 :0.06%
Percentage of pixels in bin 5: count = 131831 :5.37%
Percentage of pixels in bin 6: count = 1412159 :57.54%
Percentage of pixels in bin 7: count = 908553 :37.02%
Percentage of pixels in bin 8: count = 140 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_20.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_20.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 1639 :0.07%
Percentage of pixels in bin 5: count = 1411069 :57.49%
Percentage of pixels in bin 6: count = 1022013 :41.64%
Percentage of pixels in bin 7: count = 19081 :0.78%
Percentage of pixels in bin 8: count = 150 :0.01%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.2
sPm_SA_pp_nd_rsmp.tif: 0.4
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_21.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_21.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 5 :0.00%
Percentage of pixels in bin 4: count = 1577 :0.06%
Percentage of pixels in bin 5: count = 130303 :5.31%
Percentage of pixels in bin 6: count = 1006133 :41.00%
Percentage of pixels in bin 7: count = 1310521 :53.40%
Percentage of pixels in bin 8: count = 5741 :0.23%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.15
sPo_SA_pp_nd_rsmp.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_22.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_22.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 641 :0.03%
Percentage of pixels in bin 5: count = 992620 :40.44%
Percentage of pixels in bin 6: count = 95844 :3.91%
Percentage of pixels in bin 7: count = 1364727 :55.61%
Percentage of pixels in bin 8: count = 448 :0.02%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_23.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_23.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 857 :0.03%
Percentage of pixels in bin 5: count = 992155 :40.43%
Percentage of pixels in bin 6: count = 127378 :5.19%
Percentage of pixels in bin 7: count = 1145900 :46.69%
Percentage of pixels in bin 8: count = 187990 :7.66%
Percentage of pixels in bin 9: count = 0 :0.00%
✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_WSA_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

ok, now we have run the sensitivity analysis. For each run of the sensitivity analysis a histogram of values was generated, as well as a SbII index raster based on each of the weighting scenarios, in this case there were 24 different weighting scenarios . These files will be valled WTA_0 and WTA_1, WTA_n (n: 0-23).

Next we want to combine those 24 rasters and calculate the mean, std, range, and coefficient of variation for each pixel in the two different weigthing scenarios to give us an idea of the potential variability in the SbII index values. Running this creates four rasters mean, std, range, and CV (Cov). The ‘w’ means it was a sensitivity analysis involving weight swapping.

In [17]:
# now lets evaluate the sensitivity results for weight swapping
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'w')
✅ w_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_w_mean.tif
✅ w_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_w_std.tif
✅ w_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_w_range.tif
✅ w_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_w_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_w_summary_stats.md

Summary Statistics for w-SbII

Raster Min Max Mean
Mean 3.75 8.75 6.38069
Standard Deviation 0.152753 0.706222 0.478653
Range 0.5 2.35 1.52658
Coefficient of Variation 0.0190941 0.131334 0.0737321

5b Sensitivity analysis of the SbII index data using variable removal

In [19]:
# next lets do a sensitivity analysis where we remove one variable at a time and see how the index changes
output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_removal(file_list_w, 'SbII')
Generating control scenario: SbII_RM_control.tif

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.25
sPK5_10_SA_pp_nd_rsmp.tif: 0.4
sPm_SA_pp_nd_rsmp.tif: 0.2
sPo_SA_pp_nd_rsmp.tif: 0.15

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_control.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_control.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 857 :0.03%
Percentage of pixels in bin 5: count = 992155 :40.43%
Percentage of pixels in bin 6: count = 127378 :5.19%
Percentage of pixels in bin 7: count = 1145900 :46.69%
Percentage of pixels in bin 8: count = 187990 :7.66%
Percentage of pixels in bin 9: count = 0 :0.00%
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 857 :0.03%
Percentage of pixels in bin 5: count = 992155 :40.43%
Percentage of pixels in bin 6: count = 127378 :5.19%
Percentage of pixels in bin 7: count = 1145900 :46.69%
Percentage of pixels in bin 8: count = 187990 :7.66%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without sLD5_10_SA_pp_nd_rsmp.tif -> SbII_RM_sLD5_10_SA_pp_nd_rsmp.tif

Current file weights:
sPK5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPm_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPo_SA_pp_nd_rsmp.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sLD5_10_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sLD5_10_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 116 :0.00%
Percentage of pixels in bin 5: count = 995619 :40.57%
Percentage of pixels in bin 6: count = 132674 :5.41%
Percentage of pixels in bin 7: count = 1325106 :53.99%
Percentage of pixels in bin 8: count = 296 :0.01%
Percentage of pixels in bin 9: count = 141 :0.01%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 328 :0.01%
Percentage of pixels in bin 4: count = 116 :0.00%
Percentage of pixels in bin 5: count = 995619 :40.57%
Percentage of pixels in bin 6: count = 132674 :5.41%
Percentage of pixels in bin 7: count = 1325106 :53.99%
Percentage of pixels in bin 8: count = 296 :0.01%
Percentage of pixels in bin 9: count = 141 :0.01%
Generating scenario without sPK5_10_SA_pp_nd_rsmp.tif -> SbII_RM_sPK5_10_SA_pp_nd_rsmp.tif

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPm_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPo_SA_pp_nd_rsmp.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPK5_10_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPK5_10_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 33 :0.00%
Percentage of pixels in bin 4: count = 446 :0.02%
Percentage of pixels in bin 5: count = 1059445 :43.17%
Percentage of pixels in bin 6: count = 1376489 :56.09%
Percentage of pixels in bin 7: count = 10733 :0.44%
Percentage of pixels in bin 8: count = 7129 :0.29%
Percentage of pixels in bin 9: count = 5 :0.00%
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 33 :0.00%
Percentage of pixels in bin 4: count = 446 :0.02%
Percentage of pixels in bin 5: count = 1059445 :43.17%
Percentage of pixels in bin 6: count = 1376489 :56.09%
Percentage of pixels in bin 7: count = 10733 :0.44%
Percentage of pixels in bin 8: count = 7129 :0.29%
Percentage of pixels in bin 9: count = 5 :0.00%
Generating scenario without sPm_SA_pp_nd_rsmp.tif -> SbII_RM_sPm_SA_pp_nd_rsmp.tif

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPK5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPo_SA_pp_nd_rsmp.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPm_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPm_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 326 :0.01%
Percentage of pixels in bin 4: count = 511931 :20.86%
Percentage of pixels in bin 5: count = 483873 :19.72%
Percentage of pixels in bin 6: count = 1327486 :54.09%
Percentage of pixels in bin 7: count = 128936 :5.25%
Percentage of pixels in bin 8: count = 1728 :0.07%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 326 :0.01%
Percentage of pixels in bin 4: count = 511931 :20.86%
Percentage of pixels in bin 5: count = 483873 :19.72%
Percentage of pixels in bin 6: count = 1327486 :54.09%
Percentage of pixels in bin 7: count = 128936 :5.25%
Percentage of pixels in bin 8: count = 1728 :0.07%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without sPo_SA_pp_nd_rsmp.tif -> SbII_RM_sPo_SA_pp_nd_rsmp.tif

Current file weights:
sLD5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPK5_10_SA_pp_nd_rsmp.tif: 0.3333333333333333
sPm_SA_pp_nd_rsmp.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPo_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_sPo_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 1222 :0.05%
Percentage of pixels in bin 5: count = 59365 :2.42%
Percentage of pixels in bin 6: count = 1080807 :44.04%
Percentage of pixels in bin 7: count = 5847 :0.24%
Percentage of pixels in bin 8: count = 1301437 :53.03%
Percentage of pixels in bin 9: count = 5602 :0.23%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 1222 :0.05%
Percentage of pixels in bin 5: count = 59365 :2.42%
Percentage of pixels in bin 6: count = 1080807 :44.04%
Percentage of pixels in bin 7: count = 5847 :0.24%
Percentage of pixels in bin 8: count = 1301437 :53.03%
Percentage of pixels in bin 9: count = 5602 :0.23%

Sensitivity Analysis Results:
            Removed Variable      % > 5      % > 6      % > 7      Mean
0                    Control  51.841350  30.872044  28.185380  6.781257
1  sLD5_10_SA_pp_nd_rsmp.tif  51.820410  29.202609  28.003216  6.601912
2  sPK5_10_SA_pp_nd_rsmp.tif  50.912234  14.582129   0.373772  5.883547
3      sPm_SA_pp_nd_rsmp.tif  32.284028  22.005532   2.532604  5.753500
4      sPo_SA_pp_nd_rsmp.tif  51.827489  38.626917  27.668006  7.283801

✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_RM_combined_results.csv

again lets turn the results into a mardown table and create the rasters for cov,mean,range, and std, these will have an ‘r’ in the filename reflecting we did the sensitivity analysis with removal.

In [6]:
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'r')
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ r_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_r_mean.tif
✅ r_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_r_std.tif
✅ r_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_r_range.tif
✅ r_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_r_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SbII\SbII_r_summary_stats.md

Summary Statistics for r-SbII

Raster Min Max Mean
Mean 3.85 8.76 6.4608
Standard Deviation 0.211765 1.05696 0.690844
Range 0.666667 3 1.90223
Coefficient of Variation 0.0264376 0.192875 0.10469

6. Plot the SBII results of the sensitivity analysis

Finally we will plot the results of the sensitivity analysis. We will plot the mean, std, range, and CV rasters for both the weight shuffling and variable removal sensitivity analysis.

In [7]:
# now lets plot all of the sensitivity results.  
smt.plot_layers(sensitivity_dir)

The plot above shows all the variou weighting and removal scenarios, and the effect on the SbII index. The red and blue plots are the cv (Cov),mean,std, and range for the (w) weight swapping and (r) removal scenarios respectively.

7. Sensitivity Analysis on VDI

sCC - Scaled Canopy Cover sBA - Scaled Basal Area

All layers have been scaled (linearly) from 5-10 We will now select the layers we want to combine.

In [23]:
files_list = smt.select_tif_files(data_dir)

# next lets set the weights of the layers, we are going to type 'Y" into the user input and hit enter, then add the following weights using the user_input box
# 0.3333, 0.6667
file_list_w = smt.define_weights(files_list, True)
# lets make sure we set the weights correctly
smt.check_weights(file_list_w)

Available .tif files:
0: Final_Suit
1: sBA_SA_pp_nd_rsmp
2: Sbii
3: sCC_SA_pp_nd_rsmp
4: SF
5: sLD5_10_SA_pp_nd_rsmp
6: SMii
7: sPK5_10_SA_pp_nd_rsmp
8: sPm_SA_pp_nd_rsmp
9: sPo_SA_pp_nd_rsmp
10: sSF_SA_pp_nd_rsmp
11: sSoilK_SA_pp_nd_rsmp
12: sTRMI_SA_pp_nd_rsmp
13: VDI
Enter the indices of the files you want to select (comma-separated)

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.5
sCC_SA_pp_nd_rsmp.tif: 0.5

Enter new weights (comma-separated). Make sure they sum to 1.

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.6667
sCC_SA_pp_nd_rsmp.tif: 0.3333
If weights are incorrect, run define_wights() function to change
In [8]:

# Now that we have set the weights lets combine the layers using those weights to create an index of subsurface infiltration potential
smt.create_weighted_index(file_list_w, 'Vegetation_Density_Index')
# plot the resulting layer
smt.plot_layers(output_dir)
output_file_directory: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.6667
sCC_SA_pp_nd_rsmp.tif: 0.3333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\Vegetation_Density_Index.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\Vegetation_Density_Index.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2403489
Percentage of pixels in bin 0: count = 72515 :3.02%
Percentage of pixels in bin 1: count = 153093 :6.37%
Percentage of pixels in bin 2: count = 111107 :4.62%
Percentage of pixels in bin 3: count = 283350 :11.79%
Percentage of pixels in bin 4: count = 54386 :2.26%
Percentage of pixels in bin 5: count = 120734 :5.02%
Percentage of pixels in bin 6: count = 95276 :3.96%
Percentage of pixels in bin 7: count = 233212 :9.70%
Percentage of pixels in bin 8: count = 113219 :4.71%
Percentage of pixels in bin 9: count = 1216963 :50.63%

7a. Sensitivity analysis of the VDI index data using weight shuffling

In [25]:
file_list_w = smt.define_weights(files_list, True)

output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_weights(file_list_w, 'VDI')

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.6667
sCC_SA_pp_nd_rsmp.tif: 0.3333

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.6667
sCC_SA_pp_nd_rsmp.tif: 0.3333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_WSA_0.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_WSA_0.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2403489
Percentage of pixels in bin 0: count = 72515 :3.02%
Percentage of pixels in bin 1: count = 153093 :6.37%
Percentage of pixels in bin 2: count = 111107 :4.62%
Percentage of pixels in bin 3: count = 283350 :11.79%
Percentage of pixels in bin 4: count = 54386 :2.26%
Percentage of pixels in bin 5: count = 120734 :5.02%
Percentage of pixels in bin 6: count = 95276 :3.96%
Percentage of pixels in bin 7: count = 233212 :9.70%
Percentage of pixels in bin 8: count = 113219 :4.71%
Percentage of pixels in bin 9: count = 1216963 :50.63%

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.3333
sCC_SA_pp_nd_rsmp.tif: 0.6667

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_WSA_1.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_WSA_1.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2453855
Percentage of pixels in bin 0: count = 50366 :2.05%
Percentage of pixels in bin 1: count = 124818 :5.09%
Percentage of pixels in bin 2: count = 96599 :3.94%
Percentage of pixels in bin 3: count = 165392 :6.74%
Percentage of pixels in bin 4: count = 88235 :3.60%
Percentage of pixels in bin 5: count = 113849 :4.64%
Percentage of pixels in bin 6: count = 249181 :10.15%
Percentage of pixels in bin 7: count = 183538 :7.48%
Percentage of pixels in bin 8: count = 210707 :8.59%
Percentage of pixels in bin 9: count = 1171170 :47.73%
✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_WSA_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
In [26]:
# now lets evaluate the sensitivity results for weight swapping
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'w')
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ w_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_w_mean.tif
✅ w_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_w_std.tif
✅ w_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_w_range.tif
✅ w_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_w_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_w_summary_stats.md
In [27]:
smt.plot_layers(sensitivity_dir)

Summary Statistics for w-VDI

Raster Min Max Mean
Mean 0.5 10 7.39282
Standard Deviation 0 1.667 0.446321
Range 0 3.334 0.892642
Coefficient of Variation 0 0.3334 0.0974894

7b. Sensitivity analysis of the VDI index data using variable removal

In [28]:
# next lets do a sensitivity analysis where we remove one variable at a time and see how the index changes
output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_removal(file_list_w, 'VDI')
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'r')
Generating control scenario: VDI_RM_control.tif

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 0.3333
sCC_SA_pp_nd_rsmp.tif: 0.6667

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_control.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_control.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2453855
Percentage of pixels in bin 0: count = 50366 :2.05%
Percentage of pixels in bin 1: count = 124818 :5.09%
Percentage of pixels in bin 2: count = 96599 :3.94%
Percentage of pixels in bin 3: count = 165392 :6.74%
Percentage of pixels in bin 4: count = 88235 :3.60%
Percentage of pixels in bin 5: count = 113849 :4.64%
Percentage of pixels in bin 6: count = 249181 :10.15%
Percentage of pixels in bin 7: count = 183538 :7.48%
Percentage of pixels in bin 8: count = 210707 :8.59%
Percentage of pixels in bin 9: count = 1171170 :47.73%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2453855
Percentage of pixels in bin 0: count = 50366 :2.05%
Percentage of pixels in bin 1: count = 124818 :5.09%
Percentage of pixels in bin 2: count = 96599 :3.94%
Percentage of pixels in bin 3: count = 165392 :6.74%
Percentage of pixels in bin 4: count = 88235 :3.60%
Percentage of pixels in bin 5: count = 113849 :4.64%
Percentage of pixels in bin 6: count = 249181 :10.15%
Percentage of pixels in bin 7: count = 183538 :7.48%
Percentage of pixels in bin 8: count = 210707 :8.59%
Percentage of pixels in bin 9: count = 1171170 :47.73%
Generating scenario without sBA_SA_pp_nd_rsmp.tif -> VDI_RM_sBA_SA_pp_nd_rsmp.tif

Current file weights:
sCC_SA_pp_nd_rsmp.tif: 1.0

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_sBA_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_sBA_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2453855
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 292943 :11.94%
Percentage of pixels in bin 2: count = 72949 :2.97%
Percentage of pixels in bin 3: count = 78422 :3.20%
Percentage of pixels in bin 4: count = 39237 :1.60%
Percentage of pixels in bin 5: count = 78431 :3.20%
Percentage of pixels in bin 6: count = 80425 :3.28%
Percentage of pixels in bin 7: count = 97146 :3.96%
Percentage of pixels in bin 8: count = 123539 :5.03%
Percentage of pixels in bin 9: count = 1590763 :64.83%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2453855
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 292943 :11.94%
Percentage of pixels in bin 2: count = 72949 :2.97%
Percentage of pixels in bin 3: count = 78422 :3.20%
Percentage of pixels in bin 4: count = 39237 :1.60%
Percentage of pixels in bin 5: count = 78431 :3.20%
Percentage of pixels in bin 6: count = 80425 :3.28%
Percentage of pixels in bin 7: count = 97146 :3.96%
Percentage of pixels in bin 8: count = 123539 :5.03%
Percentage of pixels in bin 9: count = 1590763 :64.83%
Generating scenario without sCC_SA_pp_nd_rsmp.tif -> VDI_RM_sCC_SA_pp_nd_rsmp.tif

Current file weights:
sBA_SA_pp_nd_rsmp.tif: 1.0

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_sCC_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_sCC_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2149418
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 260426 :12.12%
Percentage of pixels in bin 2: count = 20940 :0.97%
Percentage of pixels in bin 3: count = 47843 :2.23%
Percentage of pixels in bin 4: count = 27769 :1.29%
Percentage of pixels in bin 5: count = 35272 :1.64%
Percentage of pixels in bin 6: count = 210875 :9.81%
Percentage of pixels in bin 7: count = 45358 :2.11%
Percentage of pixels in bin 8: count = 104695 :4.87%
Percentage of pixels in bin 9: count = 1396240 :64.96%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2149418
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 260426 :12.12%
Percentage of pixels in bin 2: count = 20940 :0.97%
Percentage of pixels in bin 3: count = 47843 :2.23%
Percentage of pixels in bin 4: count = 27769 :1.29%
Percentage of pixels in bin 5: count = 35272 :1.64%
Percentage of pixels in bin 6: count = 210875 :9.81%
Percentage of pixels in bin 7: count = 45358 :2.11%
Percentage of pixels in bin 8: count = 104695 :4.87%
Percentage of pixels in bin 9: count = 1396240 :64.96%

Sensitivity Analysis Results:
        Removed Variable      % > 5      % > 6      % > 7      Mean
0                Control  40.713990  38.121609  33.030115  7.538643
1  sBA_SA_pp_nd_rsmp.tif  39.975679  38.276282  36.223566  7.830211
2  sCC_SA_pp_nd_rsmp.tif  37.129334  32.673500  31.715076  7.940568

✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_RM_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ r_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_r_mean.tif
✅ r_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_r_std.tif
✅ r_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_r_range.tif
✅ r_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_r_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\VDI\VDI_r_summary_stats.md

Summary Statistics for r-VDI

Raster Min Max Mean
Mean 0.83335 10 7.69091
Standard Deviation 0 3.74168 0.88939
Range 0 9 2.07861
Coefficient of Variation 0 0.748352 0.165778

8. Sensitivity Analysis on SMII

In [29]:
files_list = smt.select_tif_files(data_dir)

Available .tif files:
0: Final_Suit
1: sBA_SA_pp_nd_rsmp
2: Sbii
3: sCC_SA_pp_nd_rsmp
4: SF
5: sLD5_10_SA_pp_nd_rsmp
6: SMii
7: sPK5_10_SA_pp_nd_rsmp
8: sPm_SA_pp_nd_rsmp
9: sPo_SA_pp_nd_rsmp
10: sSF_SA_pp_nd_rsmp
11: sSoilK_SA_pp_nd_rsmp
12: sTRMI_SA_pp_nd_rsmp
13: VDI
Enter the indices of the files you want to select (comma-separated)
In [30]:
file_list_w = smt.define_weights(files_list, True)
# lets make sure we set the weights correctly
smt.check_weights(file_list_w)

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.5
sTRMI_SA_pp_nd_rsmp.tif: 0.5

Enter new weights (comma-separated). Make sure they sum to 1.

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.3333
sTRMI_SA_pp_nd_rsmp.tif: 0.6667
If weights are incorrect, run define_wights() function to change
In [31]:
# Now that we have set the weights lets combine the layers using those weights to create an index of subsurface infiltration potential
smt.create_weighted_index(file_list_w, 'SoilMoistureInfiltrationIndex')
output_file_directory: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.3333
sTRMI_SA_pp_nd_rsmp.tif: 0.6667

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\SoilMoistureInfiltrationIndex.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\SoilMoistureInfiltrationIndex.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2431999
Percentage of pixels in bin 0: count = 884 :0.04%
Percentage of pixels in bin 1: count = 139210 :5.72%
Percentage of pixels in bin 2: count = 138469 :5.69%
Percentage of pixels in bin 3: count = 248263 :10.21%
Percentage of pixels in bin 4: count = 584164 :24.02%
Percentage of pixels in bin 5: count = 637089 :26.20%
Percentage of pixels in bin 6: count = 516104 :21.22%
Percentage of pixels in bin 7: count = 114163 :4.69%
Percentage of pixels in bin 8: count = 53652 :2.21%
Percentage of pixels in bin 9: count = 1 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
'G:\\Data\\Thinning_Recharge_Final_Data\\SA\\resampled\\weighted_layers\\SoilMoistureInfiltrationIndex.tif'
In [33]:
# plot the resulting layer
output_dir = data_dir + r'\weighted_layers'
smt.plot_layers(output_dir)

8a. Sensitivity analysis of the SMII index data using weight shuffling

In [34]:
file_list_w = smt.define_weights(files_list, True)

output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_weights(file_list_w, 'SMII')

# now lets evaluate the sensitivity results for weight swapping
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'w')

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.3333
sTRMI_SA_pp_nd_rsmp.tif: 0.6667

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.3333
sTRMI_SA_pp_nd_rsmp.tif: 0.6667

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_WSA_0.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_WSA_0.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2431999
Percentage of pixels in bin 0: count = 884 :0.04%
Percentage of pixels in bin 1: count = 139210 :5.72%
Percentage of pixels in bin 2: count = 138469 :5.69%
Percentage of pixels in bin 3: count = 248263 :10.21%
Percentage of pixels in bin 4: count = 584164 :24.02%
Percentage of pixels in bin 5: count = 637089 :26.20%
Percentage of pixels in bin 6: count = 516104 :21.22%
Percentage of pixels in bin 7: count = 114163 :4.69%
Percentage of pixels in bin 8: count = 53652 :2.21%
Percentage of pixels in bin 9: count = 1 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.6667
sTRMI_SA_pp_nd_rsmp.tif: 0.3333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_WSA_1.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_WSA_1.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2431115
Percentage of pixels in bin 0: count = 28278 :1.16%
Percentage of pixels in bin 1: count = 77786 :3.20%
Percentage of pixels in bin 2: count = 75527 :3.11%
Percentage of pixels in bin 3: count = 72607 :2.99%
Percentage of pixels in bin 4: count = 557770 :22.94%
Percentage of pixels in bin 5: count = 637085 :26.21%
Percentage of pixels in bin 6: count = 610176 :25.10%
Percentage of pixels in bin 7: count = 336186 :13.83%
Percentage of pixels in bin 8: count = 36584 :1.50%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_WSA_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ w_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_w_mean.tif
✅ w_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_w_std.tif
✅ w_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_w_range.tif
✅ w_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_w_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_w_summary_stats.md

8b. Sensitivity analysis of the SMII index data using variable removal

In [35]:
# next lets do a sensitivity analysis where we remove one variable at a time and see how the index changes
output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_removal(file_list_w, 'SMII')
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'r')
Generating control scenario: SMII_RM_control.tif

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 0.6667
sTRMI_SA_pp_nd_rsmp.tif: 0.3333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_control.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_control.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2431115
Percentage of pixels in bin 0: count = 28278 :1.16%
Percentage of pixels in bin 1: count = 77786 :3.20%
Percentage of pixels in bin 2: count = 75527 :3.11%
Percentage of pixels in bin 3: count = 72607 :2.99%
Percentage of pixels in bin 4: count = 557770 :22.94%
Percentage of pixels in bin 5: count = 637085 :26.21%
Percentage of pixels in bin 6: count = 610176 :25.10%
Percentage of pixels in bin 7: count = 336186 :13.83%
Percentage of pixels in bin 8: count = 36584 :1.50%
Percentage of pixels in bin 9: count = 0 :0.00%
Count of pixels (excluding no-data pixels): 2431115
Percentage of pixels in bin 0: count = 28278 :1.16%
Percentage of pixels in bin 1: count = 77786 :3.20%
Percentage of pixels in bin 2: count = 75527 :3.11%
Percentage of pixels in bin 3: count = 72607 :2.99%
Percentage of pixels in bin 4: count = 557770 :22.94%
Percentage of pixels in bin 5: count = 637085 :26.21%
Percentage of pixels in bin 6: count = 610176 :25.10%
Percentage of pixels in bin 7: count = 336186 :13.83%
Percentage of pixels in bin 8: count = 36584 :1.50%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without sSoilK_SA_pp_nd_rsmp.tif -> SMII_RM_sSoilK_SA_pp_nd_rsmp.tif

Current file weights:
sTRMI_SA_pp_nd_rsmp.tif: 1.0

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_sSoilK_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_sSoilK_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2228870
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 3579 :0.16%
Percentage of pixels in bin 2: count = 85279 :3.83%
Percentage of pixels in bin 3: count = 249850 :11.21%
Percentage of pixels in bin 4: count = 519764 :23.32%
Percentage of pixels in bin 5: count = 539891 :24.22%
Percentage of pixels in bin 6: count = 409856 :18.39%
Percentage of pixels in bin 7: count = 294419 :13.21%
Percentage of pixels in bin 8: count = 88748 :3.98%
Percentage of pixels in bin 9: count = 37484 :1.68%
Count of pixels (excluding no-data pixels): 2228870
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 3579 :0.16%
Percentage of pixels in bin 2: count = 85279 :3.83%
Percentage of pixels in bin 3: count = 249850 :11.21%
Percentage of pixels in bin 4: count = 519764 :23.32%
Percentage of pixels in bin 5: count = 539891 :24.22%
Percentage of pixels in bin 6: count = 409856 :18.39%
Percentage of pixels in bin 7: count = 294419 :13.21%
Percentage of pixels in bin 8: count = 88748 :3.98%
Percentage of pixels in bin 9: count = 37484 :1.68%
Generating scenario without sTRMI_SA_pp_nd_rsmp.tif -> SMII_RM_sTRMI_SA_pp_nd_rsmp.tif

Current file weights:
sSoilK_SA_pp_nd_rsmp.tif: 1.0

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_sTRMI_SA_pp_nd_rsmp.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_sTRMI_SA_pp_nd_rsmp.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2299436
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 585251 :25.45%
Percentage of pixels in bin 5: count = 0 :0.00%
Percentage of pixels in bin 6: count = 1025784 :44.61%
Percentage of pixels in bin 7: count = 0 :0.00%
Percentage of pixels in bin 8: count = 688397 :29.94%
Percentage of pixels in bin 9: count = 4 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2299436
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 0 :0.00%
Percentage of pixels in bin 3: count = 0 :0.00%
Percentage of pixels in bin 4: count = 585251 :25.45%
Percentage of pixels in bin 5: count = 0 :0.00%
Percentage of pixels in bin 6: count = 1025784 :44.61%
Percentage of pixels in bin 7: count = 0 :0.00%
Percentage of pixels in bin 8: count = 688397 :29.94%
Percentage of pixels in bin 9: count = 4 :0.00%

Sensitivity Analysis Results:
           Removed Variable      % > 5      % > 6      % > 7      Mean
0                   Control  34.231600  17.029219   7.876709  5.383183
1  sSoilK_SA_pp_nd_rsmp.tif  17.548790   8.888445   2.667309  5.056199
2   sTRMI_SA_pp_nd_rsmp.tif  36.221094  14.546060  14.546060  6.089721

✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_RM_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ r_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_r_mean.tif
✅ r_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_r_std.tif
✅ r_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_r_range.tif
✅ r_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_r_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\SMII\SMII_r_summary_stats.md

Summary Statistics for w-SMII

Raster Min Max Mean
Mean 0.5 9 5.19584
Standard Deviation 0 1.667 0.404262
Range 0 3.334 0.808524
Coefficient of Variation 0 0.3334 0.0960663

Summary Statistics for r-SMII

Raster Min Max Mean
Mean 0.66665 8.88887 5.46272
Standard Deviation 0 3.3335 0.856364
Range 0 7 1.98829
Coefficient of Variation 0 0.595258 0.166258

9. Final Suitability Sensitivity Analysis

In [36]:
files_list = smt.select_tif_files(data_dir)

Available .tif files:
0: Final_Suit
1: sBA_SA_pp_nd_rsmp
2: Sbii
3: sCC_SA_pp_nd_rsmp
4: SF
5: sLD5_10_SA_pp_nd_rsmp
6: SMii
7: sPK5_10_SA_pp_nd_rsmp
8: sPm_SA_pp_nd_rsmp
9: sPo_SA_pp_nd_rsmp
10: sSF_SA_pp_nd_rsmp
11: sSoilK_SA_pp_nd_rsmp
12: sTRMI_SA_pp_nd_rsmp
13: VDI
Enter the indices of the files you want to select (comma-separated)
In [37]:
# next lets set the weights of the layers, we are going to type 'Y" into the user input and hit enter, then add the following weights using the user_input box
# 0.2,0.2,0.2,0.4
file_list_w = smt.define_weights(files_list, True)
# lets make sure we set the weights correctly
smt.check_weights(file_list_w)

Current file weights:
Sbii.tif: 0.25
SF.tif: 0.25
SMii.tif: 0.25
VDI.tif: 0.25

Enter new weights (comma-separated). Make sure they sum to 1.

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2
If weights are incorrect, run define_wights() function to change
In [38]:
# Now that we have set the weights lets combine the layers using those weights to create an index of subsurface infiltration potential
smt.create_weighted_index(file_list_w, 'FinalSuit')


# plot the resulting layer
output_dir = data_dir + r'\weighted_layers'
smt.plot_layers(output_dir)
output_file_directory: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\FinalSuit.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\weighted_layers\FinalSuit.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%

9a. Sensitivity analysis of the Final Suitability index data using weight shuffling

In [39]:
file_list_w = smt.define_weights(files_list, True)

output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_weights(file_list_w, 'FinalSuit')

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_0.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_0.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_1.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_1.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_2.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_2.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_3.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_3.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_4.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_4.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_5.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_5.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_6.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_6.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_7.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_7.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_8.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_8.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_9.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_9.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_10.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_10.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_11.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_11.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_12.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_12.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_13.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_13.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_14.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_14.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_15.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_15.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_16.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_16.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.4
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_17.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_17.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 0 :0.00%
Percentage of pixels in bin 2: count = 668 :0.03%
Percentage of pixels in bin 3: count = 20688 :0.84%
Percentage of pixels in bin 4: count = 216043 :8.80%
Percentage of pixels in bin 5: count = 568417 :23.16%
Percentage of pixels in bin 6: count = 971190 :39.57%
Percentage of pixels in bin 7: count = 675035 :27.50%
Percentage of pixels in bin 8: count = 2239 :0.09%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_18.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_18.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_19.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_19.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.2
VDI.tif: 0.4

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_20.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_20.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 926 :0.04%
Percentage of pixels in bin 2: count = 24206 :0.99%
Percentage of pixels in bin 3: count = 166564 :6.79%
Percentage of pixels in bin 4: count = 331789 :13.52%
Percentage of pixels in bin 5: count = 307425 :12.53%
Percentage of pixels in bin 6: count = 416355 :16.96%
Percentage of pixels in bin 7: count = 1012924 :41.27%
Percentage of pixels in bin 8: count = 194091 :7.91%
Percentage of pixels in bin 9: count = 0 :0.00%

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.2
SMii.tif: 0.4
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_21.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_21.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 382 :0.02%
Percentage of pixels in bin 2: count = 13631 :0.56%
Percentage of pixels in bin 3: count = 118894 :4.84%
Percentage of pixels in bin 4: count = 307163 :12.52%
Percentage of pixels in bin 5: count = 646613 :26.35%
Percentage of pixels in bin 6: count = 967095 :39.40%
Percentage of pixels in bin 7: count = 385044 :15.69%
Percentage of pixels in bin 8: count = 15458 :0.63%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_22.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_22.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_23.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_23.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%
✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_WSA_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
In [40]:
# now lets evaluate the sensitivity results for weight swapping
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'w')
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ w_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_w_mean.tif
✅ w_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_w_std.tif
✅ w_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_w_range.tif
✅ w_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_w_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_w_summary_stats.md

9b. Sensitivity analysis of the Final Suitability index data using variable removal

In [41]:
# next lets do a sensitivity analysis where we remove one variable at a time and see how the index changes
output_files, sensitivity_dir, run_name = smt.sensitivity_analysis_removal(file_list_w, 'FinalSuit')
smt.generate_summary_rasters(output_files, sensitivity_dir, run_name, 'r')
Generating control scenario: FinalSuit_RM_control.tif

Current file weights:
Sbii.tif: 0.2
SF.tif: 0.4
SMii.tif: 0.2
VDI.tif: 0.2

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_control.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_control.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 960 :0.04%
Percentage of pixels in bin 2: count = 7892 :0.32%
Percentage of pixels in bin 3: count = 53329 :2.17%
Percentage of pixels in bin 4: count = 246815 :10.06%
Percentage of pixels in bin 5: count = 592252 :24.13%
Percentage of pixels in bin 6: count = 921174 :37.53%
Percentage of pixels in bin 7: count = 630558 :25.69%
Percentage of pixels in bin 8: count = 1300 :0.05%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without Sbii.tif -> FinalSuit_RM_Sbii.tif

Current file weights:
SF.tif: 0.3333333333333333
SMii.tif: 0.3333333333333333
VDI.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_Sbii.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_Sbii.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454136
Percentage of pixels in bin 0: count = 846 :0.03%
Percentage of pixels in bin 1: count = 6120 :0.25%
Percentage of pixels in bin 2: count = 55305 :2.25%
Percentage of pixels in bin 3: count = 165529 :6.74%
Percentage of pixels in bin 4: count = 345085 :14.06%
Percentage of pixels in bin 5: count = 402872 :16.42%
Percentage of pixels in bin 6: count = 627637 :25.57%
Percentage of pixels in bin 7: count = 769806 :31.37%
Percentage of pixels in bin 8: count = 81040 :3.30%
Percentage of pixels in bin 9: count = 0 :0.00%
Count of pixels (excluding no-data pixels): 2454136
Percentage of pixels in bin 0: count = 846 :0.03%
Percentage of pixels in bin 1: count = 6120 :0.25%
Percentage of pixels in bin 2: count = 55305 :2.25%
Percentage of pixels in bin 3: count = 165529 :6.74%
Percentage of pixels in bin 4: count = 345085 :14.06%
Percentage of pixels in bin 5: count = 402872 :16.42%
Percentage of pixels in bin 6: count = 627637 :25.57%
Percentage of pixels in bin 7: count = 769806 :31.37%
Percentage of pixels in bin 8: count = 81040 :3.30%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without SF.tif -> FinalSuit_RM_SF.tif

Current file weights:
Sbii.tif: 0.3333333333333333
SMii.tif: 0.3333333333333333
VDI.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_SF.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_SF.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 23 :0.00%
Percentage of pixels in bin 2: count = 20434 :0.83%
Percentage of pixels in bin 3: count = 148372 :6.05%
Percentage of pixels in bin 4: count = 331351 :13.50%
Percentage of pixels in bin 5: count = 378922 :15.44%
Percentage of pixels in bin 6: count = 641104 :26.12%
Percentage of pixels in bin 7: count = 846166 :34.48%
Percentage of pixels in bin 8: count = 87908 :3.58%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 23 :0.00%
Percentage of pixels in bin 2: count = 20434 :0.83%
Percentage of pixels in bin 3: count = 148372 :6.05%
Percentage of pixels in bin 4: count = 331351 :13.50%
Percentage of pixels in bin 5: count = 378922 :15.44%
Percentage of pixels in bin 6: count = 641104 :26.12%
Percentage of pixels in bin 7: count = 846166 :34.48%
Percentage of pixels in bin 8: count = 87908 :3.58%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without SMii.tif -> FinalSuit_RM_SMii.tif

Current file weights:
Sbii.tif: 0.3333333333333333
SF.tif: 0.3333333333333333
VDI.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_SMii.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_SMii.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 197 :0.01%
Percentage of pixels in bin 2: count = 5939 :0.24%
Percentage of pixels in bin 3: count = 34361 :1.40%
Percentage of pixels in bin 4: count = 276229 :11.25%
Percentage of pixels in bin 5: count = 444530 :18.11%
Percentage of pixels in bin 6: count = 412379 :16.80%
Percentage of pixels in bin 7: count = 946822 :38.58%
Percentage of pixels in bin 8: count = 333823 :13.60%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 197 :0.01%
Percentage of pixels in bin 2: count = 5939 :0.24%
Percentage of pixels in bin 3: count = 34361 :1.40%
Percentage of pixels in bin 4: count = 276229 :11.25%
Percentage of pixels in bin 5: count = 444530 :18.11%
Percentage of pixels in bin 6: count = 412379 :16.80%
Percentage of pixels in bin 7: count = 946822 :38.58%
Percentage of pixels in bin 8: count = 333823 :13.60%
Percentage of pixels in bin 9: count = 0 :0.00%
Generating scenario without VDI.tif -> FinalSuit_RM_VDI.tif

Current file weights:
Sbii.tif: 0.3333333333333333
SF.tif: 0.3333333333333333
SMii.tif: 0.3333333333333333

Generating weighted raster...
✅ Weighted raster saved successfully: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_VDI.tif
✅ File G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_VDI.tif saved successfully. Size: 18943774 bytes

Metadata saved successfully!
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 38 :0.00%
Percentage of pixels in bin 2: count = 3432 :0.14%
Percentage of pixels in bin 3: count = 32025 :1.30%
Percentage of pixels in bin 4: count = 206337 :8.41%
Percentage of pixels in bin 5: count = 975839 :39.76%
Percentage of pixels in bin 6: count = 1161961 :47.34%
Percentage of pixels in bin 7: count = 74648 :3.04%
Percentage of pixels in bin 8: count = 0 :0.00%
Percentage of pixels in bin 9: count = 0 :0.00%
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:323: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator.
  ax.set_yticklabels([f'{int(label/1000)}k' for label in ax.get_yticks()])
Count of pixels (excluding no-data pixels): 2454280
Percentage of pixels in bin 0: count = 0 :0.00%
Percentage of pixels in bin 1: count = 38 :0.00%
Percentage of pixels in bin 2: count = 3432 :0.14%
Percentage of pixels in bin 3: count = 32025 :1.30%
Percentage of pixels in bin 4: count = 206337 :8.41%
Percentage of pixels in bin 5: count = 975839 :39.76%
Percentage of pixels in bin 6: count = 1161961 :47.34%
Percentage of pixels in bin 7: count = 74648 :3.04%
Percentage of pixels in bin 8: count = 0 :0.00%
Percentage of pixels in bin 9: count = 0 :0.00%

Sensitivity Analysis Results:
  Removed Variable      % > 5      % > 6      % > 7      Mean
0          Control  45.330307  32.815643  13.351273  6.233551
1         Sbii.tif  39.666502  31.154555  17.564278  6.120392
2           SF.tif  41.290507  33.283804  19.737119  6.287823
3         SMii.tif  45.166844  35.773873  27.056054  6.684201
4          VDI.tif  46.749201  26.129642   1.577328  5.923289

✅ Sensitivity analysis completed. Results saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_RM_combined_results.csv
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:739: RuntimeWarning: Mean of empty slice
  mean_raster = np.nanmean(stack, axis=0)
c:\Users\rl587\AppData\Local\Programs\Python\Python313\Lib\site-packages\numpy\lib\_nanfunctions_impl.py:2019: RuntimeWarning: Degrees of freedom <= 0 for slice.
  var = nanvar(a, axis=axis, dtype=dtype, out=out, ddof=ddof,
c:\Users\rl587\Documents\GitHub\ATUR-Thinning-to-enhance-recharge\notebooks\SuitabilityMappingTools.py:741: RuntimeWarning: All-NaN slice encountered
  range_raster = np.nanmax(stack, axis=0) - np.nanmin(stack, axis=0)
✅ r_mean raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_r_mean.tif
✅ r_std raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_r_std.tif
✅ r_range raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_r_range.tif
✅ r_cv raster saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_r_cv.tif
✅ Summary statistics markdown table saved at: G:\Data\Thinning_Recharge_Final_Data\SA\resampled\Sensitivity_Analysis\FinalSuit\FinalSuit_r_summary_stats.md

Summary Statistics for w-FinalSuit

Raster Min Max Mean
Mean 1.4875 8.43335 6.2539
Standard Deviation 0.00432158 0.889213 0.336096
Range 0.0100002 2 0.878771
Coefficient of Variation 0.000721776 0.34641 0.0565644

Summary Statistics for r-FinalSuit

Raster Min Max Mean
Mean 1.73998 8.37602 6.24984
Standard Deviation 0.00652003 1.37048 0.510094
Range 0.0166664 3.49556 1.46558
Coefficient of Variation 0.00108886 0.513686 0.085833