-
Notifications
You must be signed in to change notification settings - Fork 3
/
ST_CORA_runner_v2_1_1.py
78 lines (64 loc) · 2.44 KB
/
ST_CORA_runner_v2_1_1.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
32
33
34
35
36
37
38
39
40
41
42
43
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
73
74
75
76
77
78
# -*- coding: utf-8 -*-
"""
###############################################################################
ST-CORA v2.2.1 master
###############################################################################
@author: M. Laverde-Barajas
@email: [email protected]
@company SERVIR- MEKONG program
IHE Delft Institute for Water Education
Delft University of Technology
@citation: Laverde-Barajas, M., et al(2019).
Spatiotemporal analysis of extreme rainfall
events using an object-based approach.
In Spatiotemporal Analysis of Extreme Hydrological Events
(pp. 95-112). Elsevier.
ISBN 9780128116890,
https://doi.org/10.1016/B978-0-12-811689-0.00005-7.
(https://www.sciencedirect.com/science/article/pii/B9780128116890000057)
## Paramaters
T = wet values
T2 = delineation Core
Minsize = noise
kernel = 1 = kernel segmentation 4D 0= 3D
Psize = Min Object size
pixel_value = resolution
StartTime = datetime() # LOCAL TIME (GMT )
EndTime = datetime()
MATRIX = 3D rainfall matrix
boundary = [Xmin_lbm,Xmax_lbm,Ymin_lbm,Ymax_lbm]
"""
import functions_stcora_v2_1_1 as cora
from datetime import datetime, timedelta
import pandas as pd
import time
import warnings
warnings.filterwarnings("ignore")
#from multiprocessing import Pool
import sys, getopt
import os
###############################################################################
#%%########### MASTER ST-CORA
###############################################################################
def main():
start_time = time.time()
P={}
P['T'] = 3 # delineation mm/h
P['T2'] = 20 # segmentation mm/h
P['kernel'] = 1 # Kernel yes =1
P['Minsize'] = 10 # Min Object size to be considered as noise
P['Psize'] = 100 # pixel extension in km2
P['pixel_value'] = 0.1 # resolution in degree
# P['Mask_path'] = r'Path mask' (optional )
P['boundary'] = [min_lon, maxlon,Minlat,Maxlat] #Boundary domain
P['Storm_dir'] = r' path'
P['CPU_cores'] = 1
# Select initial and end date
StartTime ='2020-11-27'
EndTime = '2021-01-01'
Dates = pd.date_range(StartTime,EndTime, freq='h')
# RUNNER ST-CORA
cora.runner(Dates,MATRIX,P)
if __name__ == '__main__':
main()