-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path02-run-fv-kmj.py
76 lines (61 loc) · 1.66 KB
/
02-run-fv-kmj.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
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 BinCreateParams
from vthree_utils import run_xhist2d
from vthree_utils import run_xhist1d
load_dotenv()
# Get environment variables
#ea_input_path = os.getenv("ea_input_path")
ea_input_path='./'
sa_file = os.getenv("sa_file")
polygon_pq_uri = os.getenv("polygon_pq_uri")
# Now create the BinCreateParams object
params = BinCreateParams(
region_id=0,
season_str="MAM",
lead_int=2,
level="mod",
region_name_dict={0: "Karamoja", 1: "Marsabit", 2: "Wajir"},
spi_prod_name="spi3",
data_path=ea_input_path,
output_path=os.path.join(os.getcwd(), "output"),
spi4_data_path="",
obs_netcdf_file=os.path.join(ea_input_path, "kmj_obs_spi3_masked.nc"),
fct_netcdf_file=os.path.join(ea_input_path, "kmj_rgr_seas51_spi3_masked.nc"),
service_account_json=sa_file,
gcs_file_url=polygon_pq_uri,
region_filter="kmj",
)
"""
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.season_str = "JJA"
params.sc_season_str = "jja"
params.spi_prod_name = "spi3"
# params.data_path = params.spi4_data_path
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)