Exemplo n.º 1
0
    def init(self):
        SosInput.init(self)
        PostgresDbInput.init(self)

        progress_list = self.do_query(self.progress_query)
        for progress_row in progress_list:
            name = progress_row["name"]
            timestamp = progress_row["timestamp"]
            self.progress[name] = timestamp
Exemplo n.º 2
0
    def __init__(self, configdict, section):
        PostgresDbInput.__init__(self, configdict, section)
        self.progress_query = self.cfg.get('progress_query')
        self.db = None

        # Init all timeseries id's
        self.ts_gids = []
        self.ts_gids_idx = 0
        self.ts_gid = -1
        self.last_gid = 0
Exemplo n.º 3
0
    def __init__(self, configdict, section):
        PostgresDbInput.__init__(self, configdict, section)

        # NB the last_gis is automatically set via TRIGGER
        # in the PostgresDB output
        self.progress_query = self.cfg.get('progress_query')
        self.db = None

        # Init all timeseries id's
        self.ts_gids = []
        self.ts_gids_idx = 0
        self.ts_gid = -1
        self.last_gid = 0
Exemplo n.º 4
0
    def init(self):
        PostgresDbInput.init(self)

        # get gid where to start
        last_gid_tuples = self.raw_query(self.last_gid_query)
        if len(last_gid_tuples) == 1:
            self.last_gid, = last_gid_tuples[0]

        # One time: get all gid's to be processed
        raw_query = self.gids_query % (self.last_gid, self.last_gid + self.max_input_records)
        ts_gid_tuples = self.raw_query(raw_query)
        ts_gid_recs = self.tuples_to_records(ts_gid_tuples, ['gid'])

        log.info('read timeseries_recs: %d' % len(ts_gid_recs))
        for rec in ts_gid_recs:
            self.ts_gids.append(rec['gid'])
Exemplo n.º 5
0
    def init(self):
        PostgresDbInput.init(self)

        if self.query is not None and len(self.sensor_model_names) > 0:
            log.info('Getting calibration models from database')
            for k, v in self.sensor_model_names.iteritems():
                id, param, model = self.query_parameters_and_model(v)
                self.ids[k] = id
                self.parameters[k] = param
                self.models[k] = model

                model_state = self.query_state(id)
                self.state[k] = model_state

        else:
            log.info('No query for fetching calibration models given or no '
                     'mapping for calibration models to gas components given.')
Exemplo n.º 6
0
 def __init__(self, configdict, section):
     PostgresDbInput.__init__(self, configdict, section)
     self.progress_query = self.cfg.get('progress_query')
     self.progress_update = self.cfg.get('progress_update')
     self.db = None
Exemplo n.º 7
0
 def __init__(self, configdict, section):
     PostgresDbInput.__init__(self, configdict, section)
     self.last_id = None
Exemplo n.º 8
0
    def init(self):
        PostgresDbInput.init(self)

        self.read_gids()
        self.read_records()
Exemplo n.º 9
0
 def __init__(self, configdict, section):
     SosInput.__init__(self, configdict, section)
     PostgresDbInput.__init__(self, configdict, section)
     self.progress = dict()
Exemplo n.º 10
0
 def __init__(self, configdict, section):
     PostgresDbInput.__init__(self, configdict, section)
     self.progress_query = self.cfg.get('progress_query')
     self.progress_update = self.cfg.get('progress_update')
     self.db = None
Exemplo n.º 11
0
 def __init__(self, configdict, section):
     PostgresDbInput.__init__(self, configdict, section)
     self.ids = dict()
     self.parameters = dict()
     self.models = dict()
     self.state = dict()