Beispiel #1
0
def runStorvannetHammerfest(startDate, endDate):

    LocationNames = ["Storvannet, 7 moh"]
    x = 821340
    y = 7862497

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getGriddata(x, y, "tm", from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, "fsw", from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, "sd", from_date, to_date)
    wsCC = gws.getMetData(95350, "NNM", startDate, endDate, 0, "list")  # BANAK - østover innerst i fjorden

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}StorvannetHammerfest {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
def runOrovannMET(startDate, endDate):

    location_name = 'Otrøvatnet v/Nystuen 971 moh'
    wsTemp = gws.getMetData(54710, 'TAM', startDate, endDate, 0, 'list')
    wsSno  = gws.getMetData(54710, 'SA',  startDate, endDate, 0, 'list')

    date = []
    snotot = []
    temp = []

    for e in wsTemp:
        date.append(e.Date)
        temp.append(e.Value)
    for e in wsSno:
        snotot.append(e.Value)

    sno = dp.delta_snow_from_total_snow(snotot)

    #observed_ice_filename = '{0}Otroevann observasjoner {1}-{2}.csv'.format(data_path, startDate.year, endDate.year)
    #observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    if len(observed_ice) == 0:
        icecover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno)
    else:
        icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno)

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = '{0}Ortovann MET {1}-{2}.png'.format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #3
0
def runGiljastolsvatnet(startDate, endDate):

    LocationNames = ["Giljastølsvatnet 412 moh", "Giljastølvatnet sør 412 moh"]
    x = -1904
    y = 6553573

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    # cs_temp = gcsd.getStationdata('189.3.0','17.1', from_date, to_date)
    cs_temp = gcsd.getGriddata(x, y, "tm", from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, "fsw", from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, "sd", from_date, to_date)
    wsCC = gws.getMetData(
        43010, "NNM", startDate, endDate, 0, "list"
    )  # Eik - Hove. Ligger lenger sør men er litt inn i landet.
    # wsCC = getMetData(43010, 'NNM', startDate, endDate, 0, 'list') # Sola (44560) er et alternativ

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}Giljastolsvatnet {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #4
0
def runSkoddebergvatnet(startDate, endDate):

    LocationName = "Skoddebergvatnet - nord 101 moh"
    # Skoddebergvatnet - sør 101 moh
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    # cs_temp = gcsd.getGriddata('189.3.0','17.1', from_date, to_date)
    cs_temp = gcsd.getGriddata(593273, 7612469, "tm", from_date, to_date)
    cs_sno = gcsd.getGriddata(593273, 7612469, "fsw", from_date, to_date)
    cs_snotot = gcsd.getGriddata(593273, 7612469, "sd", from_date, to_date)
    wsCC = gws.getMetData(87640, "NNM", startDate, endDate, 0, "list")  # Harstad Stadion

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}Skoddebergvatnet {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
def runBaklidammen(startDate, endDate):

    LocationNames = ['Baklidammen 200 moh']
    x = 266550
    y = 7040812

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getGriddata(x, y, 'tm', from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, 'fsw', from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, 'sd', from_date, to_date)
    wsCC = gws.getMetData(68860, 'NNM', startDate, endDate, 0, 'list')  # TRONDHEIM - VOLL

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}Baklidammen {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #6
0
def runBaklidammen(startDate, endDate):

    LocationNames = ["Baklidammen 200 moh"]
    x = 266550
    y = 7040812

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getGriddata(x, y, "tm", from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, "fsw", from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, "sd", from_date, to_date)
    wsCC = gws.getMetData(68860, "NNM", startDate, endDate, 0, "list")  # TRONDHEIM - VOLL

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}Baklidammen {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
def runStorvannetHammerfest(startDate, endDate):

    LocationNames = ['Storvannet, 7 moh']
    x = 821340
    y = 7862497

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getGriddata(x, y, 'tm', from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, 'fsw', from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, 'sd', from_date, to_date)
    wsCC = gws.getMetData(95350, 'NNM', startDate, endDate, 0, 'list')  # BANAK - østover innerst i fjorden

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}StorvannetHammerfest {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
def runGiljastolsvatnet(startDate, endDate):

    LocationNames = ['Giljastølsvatnet 412 moh', 'Giljastølvatnet sør 412 moh']
    x = -1904
    y = 6553573

    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    #cs_temp = gcsd.getStationdata('189.3.0','17.1', from_date, to_date)
    cs_temp = gcsd.getGriddata(x, y, 'tm', from_date, to_date)
    cs_sno = gcsd.getGriddata(x, y, 'fsw', from_date, to_date)
    cs_snotot = gcsd.getGriddata(x, y, 'sd', from_date, to_date)
    wsCC = gws.getMetData(43010, 'NNM', startDate, endDate, 0, 'list')  # Eik - Hove. Ligger lenger sør men er litt inn i landet.
    #wsCC = getMetData(43010, 'NNM', startDate, endDate, 0, 'list') # Sola (44560) er et alternativ

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationNames, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}Giljastolsvatnet {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
def runSkoddebergvatnet(startDate, endDate):

    LocationName = 'Skoddebergvatnet - nord 101 moh'
    # Skoddebergvatnet - sør 101 moh
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    #cs_temp = gcsd.getGriddata('189.3.0','17.1', from_date, to_date)
    cs_temp = gcsd.getGriddata(593273, 7612469, 'tm', from_date, to_date)
    cs_sno = gcsd.getGriddata(593273, 7612469, 'fsw', from_date, to_date)
    cs_snotot = gcsd.getGriddata(593273, 7612469, 'sd', from_date, to_date)
    wsCC = gws.getMetData(87640, 'NNM', startDate, endDate, 0, 'list')  # Harstad Stadion

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}Skoddebergvatnet {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #10
0
def runHakkloa(startDate, endDate):

    LocationName = 'Hakkloa nord 372 moh'
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getStationdata('6.24.4','17.1', from_date, to_date, timeseries_type=0)
    cs_sno = gcsd.getGriddata(260150, 6671135, 'fsw', from_date, to_date, timeseries_type=0)
    cs_snotot = gcsd.getGriddata(260150, 6671135, 'sd', from_date, to_date, timeseries_type=0)
    wsCC = gws.getMetData(18700, 'NNM', startDate, endDate, 0, 'list')

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}Hakkloa {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #11
0
def runHakkloa(startDate, endDate):

    LocationName = "Hakkloa nord 372 moh"
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    cs_temp = gcsd.getStationdata("6.24.4", "17.1", from_date, to_date, timeseries_type=0)
    cs_sno = gcsd.getGriddata(260150, 6671135, "fsw", from_date, to_date, timeseries_type=0)
    cs_snotot = gcsd.getGriddata(260150, 6671135, "sd", from_date, to_date, timeseries_type=0)
    wsCC = gws.getMetData(18700, "NNM", startDate, endDate, 0, "list")

    temp, date = we.strip_metadata(cs_temp, True)
    sno = we.strip_metadata(cs_sno, False)
    snotot = we.strip_metadata(cs_snotot, False)
    cc = we.strip_metadata(wsCC, False)

    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    if len(observed_ice) == 0:
        ice_cover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        ice_cover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}Hakkloa {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(ice_cover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #12
0
def runOrovannMET(startDate, endDate):

    location_name = "Otrøvatnet v/Nystuen 971 moh"
    wsTemp = gws.getMetData(54710, "TAM", startDate, endDate, 0, "list")
    wsSno = gws.getMetData(54710, "SA", startDate, endDate, 0, "list")

    date = []
    snotot = []
    temp = []

    for e in wsTemp:
        date.append(e.Date)
        temp.append(e.Value)
    for e in wsSno:
        snotot.append(e.Value)

    sno = dp.delta_snow_from_total_snow(snotot)

    # observed_ice_filename = '{0}Otroevann observasjoner {1}-{2}.csv'.format(data_path, startDate.year, endDate.year)
    # observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    if len(observed_ice) == 0:
        icecover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno)
    else:
        icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno)

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = "{0}Ortovann MET {1}-{2}.png".format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #13
0
def runSemsvannEB(startDate, endDate):
    # TODO: get coordinates from the ObsLocation in regObs
    location_name = "Semsvannet v/Lo 145 moh"

    wsTemp = gws.getMetData(19710, "TAM", startDate, endDate, 0, "list")
    wsSno = gws.getMetData(19710, "SA", startDate, endDate, 0, "list")
    wsPrec = gws.getMetData(19710, "RR", startDate, endDate, 0, "list")
    wsWind = gws.getMetData(18700, "FFM", startDate, endDate, 0, "list")
    wsCC = gws.getMetData(18700, "NNM", startDate, endDate, 0, "list")

    utm33_y = 6644410
    utm33_x = 243940

    temp, date = we.strip_metadata(wsTemp, get_dates=True)
    sno_tot = we.strip_metadata(wsSno)
    prec_snow = dp.delta_snow_from_total_snow(sno_tot)
    prec = we.strip_metadata(wsPrec)
    wind = we.strip_metadata(wsWind)
    cloud_cover = we.strip_metadata(wsCC)
    rel_hum = [const.rel_hum_air] * len(date)
    pressure_atm = [const.pressure_atm] * len(date)

    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    ice_cover, energy_balance = calculate_ice_cover_eb(
        utm33_x,
        utm33_y,
        date,
        temp,
        prec,
        prec_snow,
        cloud_cover=cloud_cover,
        wind=wind,
        rel_hum=rel_hum,
        pressure_atm=pressure_atm,
        inn_column=copy.deepcopy(observed_ice[0]),
    )

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = "{0}Semsvann EB {1}-{2}.png".format(plot_folder, from_date.year, to_date.year)
    # pts.plot_ice_cover(ice_cover, observed_ice, date, temp, sno_tot, plot_filename)
    plot_filename = "{0}Semsvann MET with EB {1}-{2}.png".format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover_eb(
        ice_cover,
        energy_balance,
        observed_ice,
        date,
        temp,
        sno_tot,
        plot_filename,
        prec=prec,
        wind=wind,
        clouds=cloud_cover,
    )
Beispiel #14
0
def runOrovannEB(startDate, endDate):

    location_name = "Otrøvatnet v/Nystuen 971 moh"
    wsTemp = gws.getMetData(54710, "TAM", startDate, endDate, 0, "list")
    wsSno = gws.getMetData(54710, "SA", startDate, endDate, 0, "list")
    wsPrec = gws.getMetData(54710, "RR", startDate, endDate, 0, "list")

    utm33_y = 6802070
    utm33_x = 130513

    temp, date = we.strip_metadata(wsTemp, get_dates=True)
    sno_tot = we.strip_metadata(wsSno)
    prec_snow = dp.delta_snow_from_total_snow(sno_tot)
    prec = we.strip_metadata(wsPrec)
    cloud_cover = dp.clouds_from_precipitation(prec)
    wind = [const.avg_wind_const] * len(date)
    rel_hum = [const.rel_hum_air] * len(date)
    pressure_atm = [const.pressure_atm] * len(date)

    # available_elements = gws.getElementsFromTimeserieTypeStation(54710, 0, 'csv')
    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    ice_cover, energy_balance = calculate_ice_cover_eb(
        utm33_x,
        utm33_y,
        date,
        temp,
        prec,
        prec_snow,
        cloud_cover,
        wind,
        rel_hum=rel_hum,
        pressure_atm=pressure_atm,
        inn_column=copy.deepcopy(observed_ice[0]),
    )

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = "{0}Ortovann MET EB {1}-{2}.png".format(plot_folder, from_date.year, to_date.year)
    # pts.plot_ice_cover(ice_cover, observed_ice, date, temp, sno_tot, plot_filename)
    plot_filename = "{0}Ortovann MET with EB {1}-{2}.png".format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover_eb(
        ice_cover,
        energy_balance,
        observed_ice,
        date,
        temp,
        sno_tot,
        plot_filename,
        prec=prec,
        wind=wind,
        clouds=cloud_cover,
    )
Beispiel #15
0
def runOrovannNVE(startDate, endDate):

    # Need datetime objects from now on
    LocationName = 'Otrøvatnet v/Nystuen 971 moh'
    startDate = dt.datetime.strptime(startDate, "%Y-%m-%d")
    endDate = dt.datetime.strptime(endDate, "%Y-%m-%d")

    weather_data_filename = '{0}kyrkjestoelane_vaerdata.csv'.format(data_path)
    date, temp, sno, snotot = gfd.read_weather(startDate, endDate, weather_data_filename)

    #observed_ice_filename = '{0}Otroevann observasjoner 2011-2012.csv'.format(data_path)
    #observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno)

    plot_filename = '{0}Ortovann {1}-{2}.png'.format(plot_folder, startDate.year, endDate.year)
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #16
0
def runOrovannNVE(startDate, endDate):

    # Need datetime objects from now on
    LocationName = "Otrøvatnet v/Nystuen 971 moh"
    startDate = dt.datetime.strptime(startDate, "%Y-%m-%d")
    endDate = dt.datetime.strptime(endDate, "%Y-%m-%d")

    weather_data_filename = "{0}kyrkjestoelane_vaerdata.csv".format(data_path)
    date, temp, sno, snotot = gfd.read_weather(startDate, endDate, weather_data_filename)

    # observed_ice_filename = '{0}Otroevann observasjoner 2011-2012.csv'.format(data_path)
    # observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)

    icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno)

    plot_filename = "{0}Ortovann {1}-{2}.png".format(plot_folder, startDate.year, endDate.year)
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #17
0
def runSemsvannEB(startDate, endDate):
    # TODO: get coordinates from the ObsLocation in regObs
    location_name = 'Semsvannet v/Lo 145 moh'

    wsTemp = gws.getMetData(19710, 'TAM', startDate, endDate, 0, 'list')
    wsSno = gws.getMetData(19710, 'SA', startDate, endDate, 0, 'list')
    wsPrec = gws.getMetData(19710, 'RR', startDate, endDate, 0, 'list')
    wsWind = gws.getMetData(18700, 'FFM', startDate, endDate, 0, 'list')
    wsCC = gws.getMetData(18700, 'NNM', startDate, endDate, 0, 'list')

    utm33_y = 6644410
    utm33_x = 243940

    temp, date = we.strip_metadata(wsTemp, get_dates=True)
    sno_tot = we.strip_metadata(wsSno)
    prec_snow = dp.delta_snow_from_total_snow(sno_tot)
    prec = we.strip_metadata(wsPrec)
    wind = we.strip_metadata(wsWind)
    cloud_cover = we.strip_metadata(wsCC)
    rel_hum = [const.rel_hum_air] * len(date)
    pressure_atm = [const.pressure_atm] * len(date)

    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    ice_cover, energy_balance = calculate_ice_cover_eb(
        utm33_x, utm33_y, date,
        temp, prec, prec_snow, cloud_cover=cloud_cover, wind=wind, rel_hum=rel_hum, pressure_atm=pressure_atm,
        inn_column=copy.deepcopy(observed_ice[0]))

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = '{0}Semsvann EB {1}-{2}.png'.format(plot_folder, from_date.year, to_date.year)
    # pts.plot_ice_cover(ice_cover, observed_ice, date, temp, sno_tot, plot_filename)
    plot_filename = '{0}Semsvann MET with EB {1}-{2}.png'.format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover_eb(ice_cover, energy_balance, observed_ice, date, temp, sno_tot, plot_filename, prec=prec, wind=wind, clouds=cloud_cover)
Beispiel #18
0
def runSemsvann(startDate, endDate):

    LocationName = 'Semsvannet v/Lo 145 moh'

    wsTemp = gws.getMetData(19710, 'TAM', startDate, endDate, 0, 'list')
    wsSno = gws.getMetData(19710, 'SA', startDate, endDate, 0, 'list')
    wsCC = gws.getMetData(18700, 'NNM', startDate, endDate, 0, 'list')

    temp, date = we.strip_metadata(wsTemp, True)
    snotot = we.strip_metadata(wsSno, False)
    cc = we.strip_metadata(wsCC, False)

    sno = dp.delta_snow_from_total_snow(snotot)

    #observed_ice_filename = '{0}Semsvann observasjoner {1}-{2}.csv'.format(data_path, startDate[0:4], endDate[0:4])
    #observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)
    if len(observed_ice) == 0:
        icecover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = '{0}Semsvann {1}-{2}.png'.format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)
Beispiel #19
0
def runOrovannEB(startDate, endDate):

    location_name = 'Otrøvatnet v/Nystuen 971 moh'
    wsTemp = gws.getMetData(54710, 'TAM', startDate, endDate, 0, 'list')
    wsSno  = gws.getMetData(54710, 'SA',  startDate, endDate, 0, 'list')
    wsPrec = gws.getMetData(54710, 'RR',  startDate, endDate, 0, 'list')

    utm33_y = 6802070
    utm33_x = 130513

    temp, date = we.strip_metadata(wsTemp, get_dates=True)
    sno_tot = we.strip_metadata(wsSno)
    prec_snow = dp.delta_snow_from_total_snow(sno_tot)
    prec = we.strip_metadata(wsPrec)
    cloud_cover = dp.clouds_from_precipitation(prec)
    wind = [const.avg_wind_const] * len(date)
    rel_hum = [const.rel_hum_air] * len(date)
    pressure_atm = [const.pressure_atm] * len(date)


    # available_elements = gws.getElementsFromTimeserieTypeStation(54710, 0, 'csv')
    observed_ice = gro.get_all_season_ice(location_name, startDate, endDate)

    ice_cover, energy_balance = calculate_ice_cover_eb(
        utm33_x, utm33_y, date, temp, prec, prec_snow, cloud_cover, wind, rel_hum=rel_hum, pressure_atm=pressure_atm,
        inn_column=copy.deepcopy(observed_ice[0]))

    # Need datetime objects from now on
    from_date = dt.datetime.strptime(startDate, "%Y-%m-%d")
    to_date = dt.datetime.strptime(endDate, "%Y-%m-%d")

    plot_filename = '{0}Ortovann MET EB {1}-{2}.png'.format(plot_folder, from_date.year, to_date.year)
    # pts.plot_ice_cover(ice_cover, observed_ice, date, temp, sno_tot, plot_filename)
    plot_filename = '{0}Ortovann MET with EB {1}-{2}.png'.format(plot_folder, from_date.year, to_date.year)
    pts.plot_ice_cover_eb(ice_cover, energy_balance, observed_ice, date, temp, sno_tot, plot_filename,
                       prec=prec, wind=wind, clouds=cloud_cover)
Beispiel #20
0
def runSemsvann(startDate, endDate):

    LocationName = "Semsvannet v/Lo 145 moh"

    wsTemp = gws.getMetData(19710, "TAM", startDate, endDate, 0, "list")
    wsSno = gws.getMetData(19710, "SA", startDate, endDate, 0, "list")
    wsCC = gws.getMetData(18700, "NNM", startDate, endDate, 0, "list")

    temp, date = we.strip_metadata(wsTemp, True)
    snotot = we.strip_metadata(wsSno, False)
    cc = we.strip_metadata(wsCC, False)

    sno = dp.delta_snow_from_total_snow(snotot)

    # observed_ice_filename = '{0}Semsvann observasjoner {1}-{2}.csv'.format(data_path, startDate[0:4], endDate[0:4])
    # observed_ice = importColumns(observed_ice_filename)
    observed_ice = gro.get_all_season_ice(LocationName, startDate, endDate)
    if len(observed_ice) == 0:
        icecover = calculate_ice_cover_air_temp(ice.IceColumn(date[0], []), date, temp, sno, cc)
    else:
        icecover = calculate_ice_cover_air_temp(copy.deepcopy(observed_ice[0]), date, temp, sno, cc)

    plot_filename = "{0}Semsvann {1}-{2}.png".format(plot_folder, startDate[0:4], endDate[0:4])
    pts.plot_ice_cover(icecover, observed_ice, date, temp, snotot, plot_filename)