This script allows you to cross a merged catchments map with a DEM (or any other map): you will obtain for each catchment the following values: average, minimum, maximum, std, predominant, median, sum, count.
The results are added as new columns to your existing merged catchments table.
Dialog box options:
Merged Catchment Table: |
Select the output table of a previous Catchment Merge operation. The output columns that will contain the result of the script will be added to this table. |
Merged Catchment Map: |
Select a raster map that is the output of a previous Catchment Merge operation. The map may contain a single catchment or multiple catchments. |
Parameter Map for Aggregate Statistics: |
|
Select a raster map with a value domain, for instance your DEM. The merged catchments map will be crossed with the raster map selected here. |
Tip:
For more information, refer to Table calculation : Joining columns from other tables.
Note:
If you choose a class map for the cross (instead of a value map), the join operation cannot aggregate the classes very well. Then, the predominant class 'value' will be returned.
Output columns:
Suppose you cross the merged catchments map with a DEM:
average | The average height value in each catchment. |
minimum | The minimum height value in each catchment. |
maximum | The maximum height value in each catchment. |
std | The standard deviation of height values in each catchment. |
predominant | The predominant height value in each catchment. |
median | The predominant height value in each catchment. |
sum | The sum of all height values in each catchment. |
count | The number of pixels in each catchment. |
Short explanation of the calculations by the script:
temporary column temp_sum = values_2nd_map * NPix_column_in_temp_cross_table
output column average = ColumnJoinAvg(temp_cross_table, values_2nd_map, merged_catchment_IDs, NPix)
output column minimum = ColumnJoinMin(temp_cross_table, values_2nd_map, merged_catchment_IDs)
output column maximum = ColumnJoinMax(temp_cross_table, values_2nd_map, merged_catchment_IDs)
output column std = ColumnJoinStd(temp_cross_table, values_2nd_map, merged_catchment_IDs, NPix)
output column predominant = ColumnJoinPrd(temp_cross_table, values_2nd_map, merged_catchment_IDs, NPix)
output column median = ColumnJoinMed(temp_cross_table, values_2nd_map, merged_catchment_IDs, NPix)
output column sum = ColumnJoinSum(temp_cross_table, temp_sum, merged_catchment_IDs)
output column count = ColumnJoinSum(temp_cross_table, NPix, merged_catchment_IDs)
See also:
Table calculation : Joining columns from other tables