コード例 #1
0
def temps_to_building_pkl(facility):
    start_date   = datetime.strptime("1/1/2011 00:00:00", "%m/%d/%Y %H:%M:%S").replace(tzinfo = tz_used)
    full_year_times = \
                [(start_date + rdatetime.timedelta(hours = n)) for n in range(8760)]
    data, desc = qload("temps_"+facility+".pkl",loc="")
    full_temps, temps_oriflag = fill_in(data,full_year_times)
    temp_times, temp_vals = zip(*full_temps)
    temps = (np.array(temp_vals), np.array(temps_oriflag))
    
    
    dataagg, descagg = qload("state_b_records_2011_with_temps.pkl",loc = "")
コード例 #2
0
def temps_to_building_pkl(facility):
    start_date = datetime.strptime("1/1/2011 00:00:00",
                                   "%m/%d/%Y %H:%M:%S").replace(tzinfo=tz_used)
    full_year_times = \
                [(start_date + rdatetime.timedelta(hours = n)) for n in range(8760)]
    data, desc = qload("temps_" + facility + ".pkl", loc="")
    full_temps, temps_oriflag = fill_in(data, full_year_times)
    temp_times, temp_vals = zip(*full_temps)
    temps = (np.array(temp_vals), np.array(temps_oriflag))

    dataagg, descagg = qload("state_b_records_2011_with_temps.pkl", loc="")
コード例 #3
0
def toadd_to_building_pkls(data,k):
    start_date   = datetime.strptime("1/1/2011 00:00:00", "%m/%d/%Y %H:%M:%S").replace(tzinfo = tz_used)
    full_year_times = \
                [(start_date + rdatetime.timedelta(hours = n)) for n in range(8760)]
    toadd, desctemp = qload("temps_"+k+".pkl",loc=data_loc + '2011/')
    ### fix it
    #times, tempe = zip(*toadd)
#    temp = {}
#    for date, number in toadd:
#        if date not in temp: # we see this key for the first time
#            temp[date] = (date, number)
#    result = temp.values()
    result = list(set(toadd)).sorted()
    
    full_temps, temps_oriflag = fill_in(result,full_year_times)
    temp_times, temp_vals = zip(*full_temps)
    temps = (np.array(temp_vals), np.array(temps_oriflag))
    return data        
コード例 #4
0
def toadd_to_building_pkls(data, k):
    start_date = datetime.strptime("1/1/2011 00:00:00",
                                   "%m/%d/%Y %H:%M:%S").replace(tzinfo=tz_used)
    full_year_times = \
                [(start_date + rdatetime.timedelta(hours = n)) for n in range(8760)]
    toadd, desctemp = qload("temps_" + k + ".pkl", loc=data_loc + '2011/')
    ### fix it
    #times, tempe = zip(*toadd)
    #    temp = {}
    #    for date, number in toadd:
    #        if date not in temp: # we see this key for the first time
    #            temp[date] = (date, number)
    #    result = temp.values()
    result = list(set(toadd)).sorted()

    full_temps, temps_oriflag = fill_in(result, full_year_times)
    temp_times, temp_vals = zip(*full_temps)
    temps = (np.array(temp_vals), np.array(temps_oriflag))
    return data