SiteChan2Sql

This module contains all functions and classes for reading a sitechan file in CSS3.0 format and pushing it into the database

Functions and Classes

generateFakeSiteChannel(sensor)

Function for generating a “fake” SiteChan object related to the Sensor object given by the user.

This is used to guarantee that all sensors are attached to a SiteChan in the database.

Parameters:sensor (Sensor) – Sensor object for which the SiteChan is generated for
Returns:SiteChan object
getFakeSiteChanTimes(sensor)

Function for generating “fake” SiteChannel on- and off-dates.

On-date is roughly max( sensor.on_date, station.on_date )

Off-date is roughly min( sensor.off_date, station.off_date )

Parameters:sensor (Sensor) – Sensor object for which the SiteChan is generated for
Returns:SiteChan on_date, SiteChan off_date
insertSiteChan2Database(site_channel)

Function for inserting the sitechan array to the database.

Parameters:site_channel (SiteChan) – sitechan that will be inserted to the database