-
Notifications
You must be signed in to change notification settings - Fork 0
/
validate_multiscale.py
31 lines (28 loc) · 1.33 KB
/
validate_multiscale.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'''Validate the results of modeling/disaggregation using multiple scale levels.'''
import rum
import rum.validate
argparser = rum.defaultArgumentParser(__doc__)
argparser.add_argument('true_table', help='table containing the true values')
argparser.add_argument('model_table', help='table containing the modeled/disaggregated values')
argparser.add_argument('report_path', help='save HTML reports to this directory')
argparser.add_argument('multiple', help='grid size multiples to validate on', nargs='*', type=int)
argparser.add_argument('-t', '--true-field', help='true value field', default='target')
argparser.add_argument('-m', '--model-field', help='model value field', default='value')
argparser.add_argument('-x', '--xoffset', metavar='distance',
help='grid x-coordinate offset in the extent CRS', type=float, default=None
)
argparser.add_argument('-y', '--yoffset', metavar='distance',
help='grid y-coordinate offset in the extent CRS', type=float, default=None
)
if __name__ == '__main__':
args = argparser.parse_args()
rum.validate.ModelMultiscaleValidator.fromArgs(args).run(
args.true_table,
args.model_table,
trueField=args.true_field,
modelField=args.model_field,
multiples=args.multiple,
reportPath=args.report_path,
xoffset=args.xoffset,
yoffset=args.yoffset,
)