Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a statistic to count the number of values within specified bounds #57

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions pdgstaging/ConfigManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,17 @@ class ConfigManager():
aggregation method will be used to summarize the given
property in the cell. Method can be any method allowed
in the 'func' property of the panda's aggregate method,
e.g. 'sum', 'count', 'mean', etc.
e.g. 'sum', 'count', 'mean', etc., or 'bounded_count'.
For 'bounded_count', a 'bounds' tuple is required and
'weight_by' is ignored because 'count' is already
implied.
- bounds : tuple
An upper and lower bound for the value of 'property'
for the element to be included in the count. Only
used if 'aggregation_method' is 'bounded_count'. If one
of the bounds is None, the accepted values for
'property' are unbounded in that direction. The upper
bound is inclusive and the lower bound is exclusive.
- resampling_method : str
The resampling method to use when combining raster data
from child tiles into parent tiles. See rasterio's
Expand Down Expand Up @@ -1163,11 +1173,13 @@ def get_raster_config(self):
'name',
'weight_by',
'property',
'aggregation_method')
'aggregation_method',
'bounds'
)
stats_config = []
for stat_config in self.config['statistics']:
stats_config.append(
{k: stat_config[k] for k in stats_config_keys}
{k: stat_config[k] for k in stats_config_keys if k in stat_config}
)

raster_config = {
Expand Down