示例#1
0
def simple_glitch(dbcode, entity, probe_code, start_date, end_date, interval):
    """ Does a very simple GLITCH, for testing purposes.
    """

    _, cursor = mg.connect()
    dbname = str(dbcode) + str(entity)
    cnames = mg.gather_column_names(cursor, dbname)

    o1 = mg.system_tables(cursor, dbname, probe_code, cnames, start_date, end_date)

    dr = create_date_list_from_mapg(o1)

    fd, ld = create_date_bounds_from_date_list(dr, int(interval))

    vd = to_dated_dictionary(o1, *dr)

    nc, fc = numeric_or_flag(vd)

    returned_html = glitch_setup(vd, int(interval), o1, dbcode, entity, probe_code)

    return returned_html
示例#2
0
    fd, ld = create_date_bounds_from_date_list(dr, int(interval))

    vd = to_dated_dictionary(o1, *dr)

    nc, fc = numeric_or_flag(vd)

    returned_html = glitch_setup(vd, int(interval), o1, dbcode, entity, probe_code)

    return returned_html

if __name__ == "__main__":

    _, cursor = mg.connect()

    cnames = mg.gather_column_names(cursor,'MS04314')

    o1 = mg.system_tables(cursor, 'MS04314', 'WNDCEN01', cnames,'2015-03-02 22:00:00','2015-03-03 15:00:00')

    dr = create_date_list_from_mapg(o1)

    fd, ld = create_date_bounds_from_date_list(dr, 90)

    vd = to_dated_dictionary(o1, *dr)

    nc, fc = numeric_or_flag(vd)

    returned_value = glitch_setup(vd, 90, o1, 'MS043','14','WNDCEN01')

    print(returned_value)