-
Notifications
You must be signed in to change notification settings - Fork 0
/
l3.py
153 lines (142 loc) · 2.17 KB
/
l3.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#l3 helper functions
## Plot attributes
#set defaults
setvars_salinity = {
#The filename
"db" : "filename",
#which year
"year" : 2019,
#The variable to be plotted
"var" : "salinity_depth_average",
#clim=0 means use default min/max for colormap
"clim" : 0,
#If clim=1, choose the min/max for colormap
"cmin" : 0,
"cmax" : 35,
#The colormap
"cmap" : "viridis",
#Invert the colormap?
"invert" : 0,
#Scale Z by
"scale" : 0.004,
#Percent of grid to choose Y slice
"percent" : 35,
#Origin point of transect
"from_x" : -88.50,
"from_y" : 30.10,
#Destination point of transect
"to_x" : -87.70,
"to_y" : 31.1,
#Back/foreground colors
#Foreground, white
"cfore" : (255, 255, 255, 255),
#Background, black
"cback" : (0, 0, 0, 255),
#Print the legend, 0==False, 1==True
"legend" : 1,
"time" : 0,
"axes" : 0
}
#set defaults
setvars_temperature = {
#The filename
"db" : "filename",
#which year
"year" : 2019,
#The variable to be plotted
"var" : "temperature_depth_average",
#clim=0 means use default min/max for colormap
"clim" : 1,
#If clim=1, choose the min/max for colormap
"cmin" : 12,
"cmax" : 32,
#The colormap
"cmap" : "RdYlBu",
#Invert the colormap?
"invert" : 1,
#Scale Z by
"scale" : 0.004,
#Percent of grid to choose Y slice
"percent" : 35,
#Origin point of transect
"from_x" : -88.50,
"from_y" : 30.10,
#Destination point of transect
"to_x" : -87.70,
"to_y" : 31.1,
#Back/foreground colors
#Foreground, white
"cfore" : (255, 255, 255, 255),
#Background, black
"cback" : (0, 0, 0, 255),
#Print the legend, 0==False, 1==True
"legend" : 0,
"time" : 0,
"axes" : 0
}
## Date/Time indicies
#Valid model years
model_years = [
"2019"
]
#Define months
iJan = 0
iFeb = 1
iMar = 2
iApr = 3
iMay = 4
iJun = 5
iJul = 6
iAug = 7
iSep = 8
iOct = 9
iNov = 10
iDec = 11
which_months = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
]
which_vars = [
"salinity",
"temperature"
]
#Non leap year
range_year = [
(1,32),
(32,60),
(60,91),
(91,121),
(121,152),
(152,182),
(182,213),
(213,244),
(244,274),
(274,305),
(305,335),
(335,366)
]
#Leap year
range_leap_year = [
(1,32),
(32,61),
(60,92),
(92,122),
(122,153),
(153,183),
(183,214),
(214,245),
(245,275),
(275,306),
(306,336),
(336,367)
]