-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun_mawa.py
98 lines (80 loc) · 2.12 KB
/
run_mawa.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import os
from dotenv import load_dotenv
import numpy as np
import pandas as pd
import altair as alt
from io import StringIO
import xarray as xr
from sklearn.metrics import roc_auc_score
from xbootstrap import block_bootstrap
import xskillscore as xs
from dask.distributed import Client
from vthree_utils import get_threshold
from vthree_utils import ken_mask_creator
from vthree_utils import make_obs_fct_dataset
from vthree_utils import get_threshold
from vthree_utils import seas51_patch_empirical_probability
from vthree_utils import xhist_metrics_2d
from vthree_utils import BinCreateParams
from vthree_utils import run_xhist2d
from vthree_utils import run_xhist1d
from vthree_utils import mean_emp_prob
from vthree_utils import mean_obs_spi
from vthree_utils import get_mean_ens_triggers
from vthree_utils import xhist_metrices_1d
from vthree_utils import trigger_decision_dict
from vthree_utils import chosen_triggers_metrix
from vthree_utils import update_ctdb
load_dotenv()
params = BinCreateParams(
region_id=1,
region_name_dict={0: "Karamoja", 1: "Marsabit", 2: "Wajir"},
season_str="MAM",
lead_int=2,
level="mod",
spi_prod_name="spi3",
data_path=os.getenv("ea_input_path"),
spi4_data_path=os.getenv("data_path"),
output_path=os.getenv("output_path"),
)
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 3
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 4
run_xhist2d(params)
run_xhist1d(params)
params.region_id = 2
params.lead_int = 2
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 3
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 4
run_xhist2d(params)
run_xhist1d(params)
params.region_id = 1
params.season_str = "OND"
params.sc_season_str = "ond"
params.spi_prod_name = "spi3"
params.lead_int = 2
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 3
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 4
run_xhist2d(params)
run_xhist1d(params)
params.region_id = 2
params.lead_int = 2
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 3
run_xhist2d(params)
run_xhist1d(params)
params.lead_int = 4
run_xhist2d(params)
run_xhist1d(params)