Repository navigation
Expand file tree
/
Copy pathvarpy_modelworkflow2c.py
More file actions
62 lines (45 loc) · 1.76 KB
/
Copy pathvarpy_modelworkflow2c.py
File metadata and controls
62 lines (45 loc) · 1.76 KB
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
import sys
from varpy.management import core, conversion
from varpy.data_preparation import window
from varpy.analysis import magnitudes
from numpy import linspace
from varpy.modelling.model_application import experiments
from datetime import date
#For different experiment types...:
#c) retrospective forecast test: t_min = value, t_max = value, t_step = value, tf = None
#specify experiment name, data locations
ID = 'Etna'
ecvd_data_file = '../Library/Etna_INGVCT_C1_99-170214.txt'
ecvd_metadata_file = '../Library/Etna_INGVCT_C1_meta.txt'
#Method variables
#1. Spatial variables
lat_min = 37.5
lat_max = 37.9
lon_min = 14.7
lon_max = 15.3
#2. Depth variables
z_min = -10.0
z_max = 30.0
#3. Time variabl3s
t_min = '01-06-2011' #Could be today, may want to add capability for a "None" option
t_max = '01-01-2013' #Could be in future, may want to add capability for a "None" option
t_step = 1.0 #time between model applications, in days (for ecvd, maybe minutes for ecld?). #If None means single application
#4
mag_comp = 'GFT' #method for magnitude filtering. 'None' is no filtering
#5
model = 'iol_mle' #name of model to apply. Could do many???
#Setup Varpy object
d1 = core.Volcanic(ID)
#Add data to Varpy object
d1.add_datatype('ecvd',ecvd_data_file, ecvd_metadata_file)
#Set-up times to run model
try:
t_min=conversion.date2int(t_min)
t_max=conversion.date2int(t_max)
except:
t_min = float(t_min)
t_max = float(t_max)
pass
kwargs={'spatial':'latlon','spatial_x_min':lat_min,'spatial_x_max':lat_max,'spatial_y_min':lon_min,'spatial_y_max':lon_max,'single_attribute':'depth','z_max':z_max, 'z_min':z_min,'mag_comp':mag_comp,'t_min':t_min, 't_max':t_max,'t_step':t_step}
d2=experiments.multiple_analysis(d1,'ecvd',model,**kwargs)
d2.ecvd.display_models()