-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_tables.py
executable file
·99 lines (95 loc) · 1.91 KB
/
create_tables.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
import sqlite3
def create_tables(db):
conn = sqlite3.connect(db)
c = conn.cursor()
c.execute('''CREATE TABLE sites
(ID INTEGER primary key,
site_name str,
code_name str)''')
c.execute('''CREATE TABLE L2
(ID INTEGER primary key,
site_id REFERENCES sites(ID),
YEAR int,
GAP int,
DTIME double,
DOY int,
HRMIN int,
UST double,
TA double,
WD double,
WS double,
NEE double,
FC double,
SFC double,
H double,
SH double,
LE double,
SLE double,
FG double,
TS1 double,
TSdepth1 double,
TS2 double,
TSdepth2 double,
PREC double,
RH double,
PRESS double,
CO2 double,
VDP double,
SWC1 double,
SWC2 double,
Rn double,
PAR double,
Rg double,
Rgdif double,
PARout double,
RgOut double,
Rgl double,
RglOut double,
H2O double,
RE double,
GPP double,
CO2top double,
CO2height double,
APAR double,
PARdif double,
APARpct double,
ZL double)''')
c.execute('''CREATE TABLE L4_h
(ID INTEGER primary key,
site_id REFERENCES sites(ID),
Year int,
Month int,
Day int,
Hour double,
DoY double,
Rg_f double,
Rg_fqc int,
Ta_f double,
Ta_fqc int,
VPD_f double,
VPD_fqc int,
Ts_f double,
Ts_fqc int,
Precip double,
SWC int,
H_f double,
H_fqc int,
LE_f double,
LE_fqc int,
gf_NEE_st int,
gf_NEE_or int,
Reco_st double,
Reco_or double,
NEE_st_fMDS double,
NEE_st_fMDSqc int,
GPP_st_MDS double,
NEE_or_fMDS double,
NEE_or_fMDSqc int,
GPP_or_MDS double,
NEE_st_fANN double,
NEE_st_fANNqc int,
GPP_st_ANN double,
NEE_or_fANN double,
NEE_or_fANNqc int,
GPP_or_ANN double);''')
conn.commit()