コード例 #1
0
def init(pool, model, wrf_model_list, version, variable, unit, unit_type):
    for _wrf_model in wrf_model_list:
        source_name = "{}_{}".format(model, _wrf_model)
        add_source(pool=pool, model=source_name, version=version)

    add_variable(pool=pool, variable=variable)

    add_unit(pool=pool, unit=unit, unit_type=unit_type)
コード例 #2
0
        #         db=CURW_FCST_DATABASE)

        # ########
        # # test
        # ########

        USERNAME = "******"
        PASSWORD = "******"
        HOST = "127.0.0.1"
        PORT = 3306
        DATABASE = "curw_fcst"

        pool = get_Pool(host=HOST, port=PORT, user=USERNAME, password=PASSWORD, db=DATABASE)

        add_source(pool=pool, model=model, version=version, parameters=None)
        add_variable(pool=pool, variable=variable)
        add_unit(pool=pool, unit=unit, unit_type=unit_type)

        # add hechms output stations

        for i in range(len(hechms_stations)):
            station_name = hechms_stations[i][0]
            lat = hechms_stations[i][1]
            lon = hechms_stations[i][2]
            add_station(pool=pool, name=station_name, latitude="%.6f" % float(lat), longitude="%.6f" % float(lon),
                    station_type=StationEnum.HECHMS, description="hecHMS output station")

        destroy_Pool(pool=pool)

    except Exception:
        logger.info("Initialization process failed.")