saber.gis
clip_by_assignment(workdir, assign_df, drain_gis, prefix='')
Creates Geopackage files in workdir/gis_outputs for each unique value in the assignment column
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
the path to the working directory for the project |
required |
assign_df |
pd.DataFrame
|
the assign_table dataframe |
required |
drain_gis |
str
|
path to a drainage line shapefile which can be clipped |
required |
prefix |
str
|
a prefix for names of the outputs to distinguish between data generated at separate instances |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
clip_by_cluster(workdir, assign_table, drain_gis, prefix='')
Creates Geopackage files in workdir/gis_outputs of the drainage lines based on the fdc cluster they were assigned to
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
the path to the working directory for the project |
required |
assign_table |
pd.DataFrame
|
the assign_table dataframe |
required |
drain_gis |
str
|
path to a drainage line shapefile which can be clipped |
required |
prefix |
str
|
optional, a prefix to prepend to each created file's name |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
clip_by_ids(workdir, ids, drain_gis, prefix='', id_column=mid_col)
Creates Geopackage files in workdir/gis_outputs of the subset of 'drain_shape' with an ID in the specified list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
path to the project directory |
required |
ids |
list
|
any iterable containing a series of model_ids |
required |
drain_gis |
str
|
path to the drainage shapefile to be clipped |
required |
prefix |
str
|
optional, a prefix to prepend to each created file's name |
''
|
id_column |
str
|
name of the id column in the attributes of the shape table |
mid_col
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
clip_by_unassigned(workdir, assign_table, drain_gis, prefix='')
Creates Geopackage files in workdir/gis_outputs of the drainage lines which haven't been assigned a gauge yet
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
the path to the working directory for the project |
required |
assign_table |
pd.DataFrame
|
the assign_table dataframe |
required |
drain_gis |
str
|
path to a drainage line shapefile which can be clipped |
required |
prefix |
str
|
optional, a prefix to prepend to each created file's name |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
generate_all(workdir, assign_table, drain_gis, prefix='')
Runs all the clip functions which create subsets of the drainage lines GIS dataset based on how they were assigned for bias correction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
the path to the working directory for the project |
required |
assign_table |
pd.DataFrame
|
the assign_table dataframe |
required |
drain_gis |
str
|
path to a drainage line shapefile which can be clipped |
required |
prefix |
str
|
a prefix for names of the outputs to distinguish between data generated in separate instances |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
histomaps(gdf, metric, prct, workdir)
Creates a histogram of the KGE2012 values for the validation set
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gdf |
gpd.GeoDataFrame
|
a GeoDataFrame containing validation metrics |
required |
metric |
str
|
name of th emetric to plot |
required |
prct |
str
|
Percentile of the validation set used to generate the histogram |
required |
workdir |
str
|
the project working directory |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
|
validation_maps(workdir, gauge_gis, val_table=None, prefix='')
Creates Geopackage files in workdir/gis_outputs of subsets of the gauge_shape. 1 is the fill gauge shape with added attribute columns for all the computed stats. There are 2 for each of the 5 validation groups; 1 which shows the gauges included in the validation set and 1 which shows gauges that were excluded from the validation set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workdir |
str
|
path to the project directory |
required |
val_table |
pd.DataFrame
|
the validation table produced by saber.validate |
None
|
gauge_gis |
str
|
path to the gauge locations shapefile |
required |
prefix |
str
|
optional, a prefix to prepend to each created file's name |
''
|
Returns:
Type | Description |
---|---|
None
|
None |
Source code in saber/gis.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|