RAVE
Lib.rave_dom_db Namespace Reference

Classes

class  rave_db
 Class for connecting with the database. More...
 

Functions

 psql_set_extra_float_digits (dbapi_con, con_record)
 
 create_db (url, create_schema=True)
 Creates a rave db instance.
 
 create_db_from_conf (configfile=BDB_CONFIG_FILE, create_schema=True)
 Creates a rave_db instance.
 

Variables

 logger = rave_pgf_logger.create_logger()
 
 MIGRATION_REPO_PATH = os.path.join(os.path.dirname(__file__), "ravemigrate")
 
 meta = MetaData()
 
 rave_wmo_station
 
 rave_observation
 
 rave_gra_coefficient
 
 rave_grapoint
 
 rave_melting_layer
 
dict dburipool = {}
 

Detailed Description

Copyright (C) 2010- Swedish Meteorological and Hydrological Institute (SMHI)

This file is part of RAVE.

RAVE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

RAVE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with RAVE.  If not, see <http://www.gnu.org/licenses/>.

Function Documentation

◆ create_db()

Lib.rave_dom_db.create_db ( url,
create_schema = True )

Creates a rave db instance.

This instance will be remembered for the same url which means that the same db-instance will be used for the same url. If create_schema = True (default) then the tables will be created

◆ create_db_from_conf()

Lib.rave_dom_db.create_db_from_conf ( configfile = BDB_CONFIG_FILE,
create_schema = True )

Creates a rave_db instance.

Variable Documentation

◆ rave_gra_coefficient

Lib.rave_dom_db.rave_gra_coefficient
Initial value:
1= Table("rave_gra_coefficient", meta,
2 Column("area", Text, nullable=False),
3 Column("date", Date, nullable=False),
4 Column("time", Time, nullable=False),
5 Column("significant", Text, nullable=False),
6 Column("points", Integer, nullable=False),
7 Column("loss", Integer, nullable=False),
8 Column("r", Float, nullable=False),
9 Column("r_significant", Text, nullable=False),
10 Column("corr_coeff", Float, nullable=False),
11 Column("a", Float, nullable=False),
12 Column("b", Float, nullable=False),
13 Column("c", Float, nullable=False),
14 Column("mean", Float, nullable=False),
15 Column("stddev", Float, nullable=False),
16 PrimaryKeyConstraint("area","date","time"))

◆ rave_grapoint

Lib.rave_dom_db.rave_grapoint
Initial value:
1= Table("rave_grapoint", meta,
2 Column("date", Date, nullable=False),
3 Column("time", Time, nullable=False),
4 Column("radarvaluetype", Integer, nullable=False),
5 Column("radarvalue", Float, nullable=False),
6 Column("radardistance", Float, nullable=False),
7 Column("longitude", Float, nullable=False),
8 Column("latitude", Float, nullable=False),
9 Column("observation", Float, nullable=False),
10 Column("accumulation_period", Integer, nullable=False),
11 Column("gr", Float, nullable=False),
12 PrimaryKeyConstraint("date","time","longitude","latitude"))

◆ rave_melting_layer

Lib.rave_dom_db.rave_melting_layer
Initial value:
1= Table("rave_melting_layer", meta,
2 Column("nod", Text, nullable=False),
3 Column("datetime", DateTime, nullable=False),
4 Column("top", Float, nullable=True),
5 Column("bottom", Float, nullable=True),
6 PrimaryKeyConstraint("datetime", "nod"))

◆ rave_observation

Lib.rave_dom_db.rave_observation
Initial value:
1= Table("rave_observation", meta,
2 Column("station", Text, nullable=True),
3 Column("country", Text, nullable=True),
4 Column("type", Integer, nullable=True),
5 Column("date", Date, nullable=False),
6 Column("time", Time, nullable=False),
7 Column("longitude", Float, nullable=False),
8 Column("latitude", Float, nullable=False),
9 Column("visibility", Float, nullable=True),
10 Column("windtype", Integer, nullable=True),
11 Column("cloudcover", Integer, nullable=True),
12 Column("winddirection", Float, nullable=True),
13 Column("windspeed", Float, nullable=True),
14 Column("temperature", Float, nullable=True),
15 Column("dewpoint", Float, nullable=True),
16 Column("relativehumidity", Float, nullable=True),
17 Column("pressure", Float, nullable=True),
18 Column("sea_lvl_pressure", Float, nullable=True),
19 Column("pressure_change", Float, nullable=True),
20 Column("liquid_precipitation", Float, nullable=True),
21 Column("accumulation_period", Integer, nullable=True),
22 Column("valid_fields_bitmask", Integer, nullable=True),
23 PrimaryKeyConstraint("station", "date", "time", "accumulation_period"))

◆ rave_wmo_station

Lib.rave_dom_db.rave_wmo_station
Initial value:
1= Table("rave_wmo_station", meta,
2 Column("stationnumber", Text, nullable=False),
3 Column("stationsubnumber", Text, nullable=False),
4 Column("stationname", Text, nullable=True),
5 Column("country", Text, nullable=True),
6 Column("countrycode", Text, nullable=True),
7 Column("longitude", Float, nullable=True),
8 Column("latitude", Float, nullable=True),
9 PrimaryKeyConstraint('stationnumber','stationsubnumber',name='pk_wmo_station'),
10)