-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathfastpheno.py
More file actions
84 lines (63 loc) · 3.96 KB
/
fastpheno.py
File metadata and controls
84 lines (63 loc) · 3.96 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from datetime import datetime
from api import db
from sqlalchemy.dialects.mysql import DECIMAL
class Sites(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "sites"
sites_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
site_name: db.Mapped[str] = db.mapped_column(db.String(45), nullable=False)
lat: db.Mapped[float] = db.mapped_column(DECIMAL(15, 12), nullable=False)
lng: db.Mapped[float] = db.mapped_column(DECIMAL(15, 12), nullable=False)
site_desc: db.Mapped[str] = db.mapped_column(db.String(999), nullable=True)
class Flights(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "flights"
flights_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
pilot: db.Mapped[str] = db.mapped_column(db.String(45), nullable=True)
flight_date: db.Mapped[datetime] = db.mapped_column(db.DateTime, nullable=False)
sites_pk: db.Mapped[int] = db.mapped_column(db.Integer, nullable=False)
height: db.Mapped[float] = db.mapped_column(DECIMAL(15, 10), nullable=True)
speed: db.Mapped[float] = db.mapped_column(DECIMAL(15, 10), nullable=True)
class Trees(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "trees"
trees_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
sites_pk: db.Mapped[int] = db.mapped_column(db.Integer, nullable=False)
longitude: db.Mapped[float] = db.mapped_column(DECIMAL(15, 12), nullable=False)
latitude: db.Mapped[float] = db.mapped_column(DECIMAL(15, 12), nullable=False)
tree_site_id: db.Mapped[str] = db.mapped_column(db.String(45), nullable=True)
family_id: db.Mapped[str] = db.mapped_column(db.String(45), nullable=True)
external_link: db.Mapped[str] = db.mapped_column(db.String(200), nullable=True)
block_num: db.Mapped[int] = db.mapped_column(db.Integer, nullable=True)
seq_id: db.Mapped[str] = db.mapped_column(db.String(25), nullable=True)
x_pos: db.Mapped[int] = db.mapped_column(db.Integer, nullable=True)
y_pos: db.Mapped[int] = db.mapped_column(db.Integer, nullable=True)
height_2022: db.Mapped[str] = db.mapped_column(db.String(10), nullable=True)
class TreesFlightsJoinTbl(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "trees_flights_join_tbl"
trees_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
flights_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
confidence: db.Mapped[float] = db.mapped_column(DECIMAL(8, 5), nullable=True)
class Bands(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "bands"
__table_args__ = (db.Index("bands_flight_band_tree_idx", "flights_pk", "band", "trees_pk"),)
trees_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
flights_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
band: db.Mapped[str] = db.mapped_column(db.String(20), primary_key=True, nullable=False)
value: db.Mapped[float] = db.mapped_column(DECIMAL(8, 5), nullable=False)
class Pigments(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "pigments"
trees_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
flights_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
pigment: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
value: db.Mapped[float] = db.mapped_column(DECIMAL(20, 15), nullable=False)
class Unispec(db.Model):
__bind_key__ = "fastpheno"
__tablename__ = "unispec"
trees_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
flights_pk: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
pigment: db.Mapped[int] = db.mapped_column(db.Integer, primary_key=True, nullable=False)
value: db.Mapped[float] = db.mapped_column(DECIMAL(20, 15), nullable=False)