RAVE
Lib.rave_dom_db.rave_db Class Reference

Class for connecting with the database. More...

Inheritance diagram for Lib.rave_dom_db.rave_db:

Public Member Functions

 __init__ (self, engine_or_url)
 
 get_connection (self)
 
 psql_invalidate (self, dbapi_conn, connection_rec, exception)
 
 create (self)
 Creates the tables if they don't exist.
 
 drop (self)
 Drops the database tables if they exist.
 
 add (self, obj)
 Adds an object to the associated table.
 
 merge (self, obj)
 
 get_session (self)
 
 get_observations_in_bbox (self, ullon, ullat, lrlon, lrlat, startdt=None, enddt=None)
 
 get_observations_in_interval (self, startdt, enddt, stations=[])
 
 delete_observations_in_interval (self, startdt, enddt)
 
 get_station (self, stationid)
 
 get_stations_in_bbox (self, ullon, ullat, lrlon, lrlat)
 
 delete_all_stations (self)
 
 get_gra_coefficient (self, dt)
 
 get_newest_gra_coefficient (self, dt, dtmax=None)
 Return the most recent gra coefficient since dt.
 
 get_grapoints (self, dt, edt=None)
 
 delete_grapoints (self, dt, edt=None)
 
 purge_grapoints (self)
 
 get_latest_melting_layer (self, nod, hours=None, ct=datetime.datetime.utcnow())
 
 remove_old_melting_layers (self, ct=None)
 

Public Attributes

str _engine = "postgresql":
 
 psql_invalidate
 
 Session = sessionmaker(bind=self._engine)
 

Protected Attributes

 _engine = engine.create_engine(engine_or_url, echo=False)
 

Detailed Description

Class for connecting with the database.

Member Function Documentation

◆ add()

Lib.rave_dom_db.rave_db.add ( self,
obj )

Adds an object to the associated table.

◆ create()

Lib.rave_dom_db.rave_db.create ( self)

Creates the tables if they don't exist.

◆ drop()

Lib.rave_dom_db.rave_db.drop ( self)

Drops the database tables if they exist.

◆ get_connection()

Lib.rave_dom_db.rave_db.get_connection ( self)
get a context managed connection to the database

◆ get_newest_gra_coefficient()

Lib.rave_dom_db.rave_db.get_newest_gra_coefficient ( self,
dt,
dtmax = None )

Return the most recent gra coefficient since dt.

Parameters
dtFrom time when to search for coefficients

The documentation for this class was generated from the following file: