示例#1
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)
示例#2
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)
示例#3
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,
    )
示例#4
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,
    )
示例#5
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)
示例#6
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)
示例#7
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)
示例#8
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)