Пример #1
0
from __future__ import print_function, division
from nilmtk import DataSet, TimeFrame, MeterGroup
import plot_config
import seaborn as sns
from matplotlib.dates import DateFormatter, HourLocator
from datetime import timedelta
import matplotlib.pyplot as plt
import pytz
import pandas as pd
from os.path import join

from pylab import rcParams

rcParams.update({'figure.figsize': plot_config._mm_to_inches(180, 100)})

UNIT = 'kW'

dataset = DataSet('/data/mine/vadeec/merged/ukdale.h5')
TZ_STRING = dataset.metadata['timezone']
TZ = pytz.timezone(TZ_STRING)
elec = dataset.buildings[1].elec
submeters = elec.meters_directly_downstream_of_mains()

# Select appliances used in top K plot
APPLIANCES = [
    'fridge freezer', 'HTPC', 'dish washer', 'washer dryer', 'kettle'
]
selected_meters = [submeters[appliance] for appliance in APPLIANCES]
remainder = []
for meter in submeters.meters:
    for appliance in APPLIANCES:
Пример #2
0
from __future__ import print_function, division
from nilmtk import DataSet, TimeFrame, MeterGroup
import plot_config
import seaborn as sns
from matplotlib.dates import DateFormatter, HourLocator
import matplotlib.pyplot as plt
import pytz
from os.path import join

from pylab import rcParams
rcParams.update({'figure.figsize': plot_config._mm_to_inches(180, 120)})

print("plotting good sections...")

dataset = DataSet('/data/mine/vadeec/merged/ukdale.h5')
# dataset.set_window("2013-06-01", "2013-06-02") 
dataset.set_window(None, None) 

axes = dataset.plot_good_sections(color=plot_config.BLUE)

for i, ax in enumerate(axes):
    plot_config.format_axes(ax, tick_size=2)
    ax.set_title('House {:d}'.format(i+1), x=0.05, y=.4, va='top')    
    ax.set_ylabel('Meter' if i == 1 else '', 
                  rotation=0, ha='center', va='center', y=.4)


plt.savefig(join(plot_config.FIG_DIR, '03_good_sections.eps'), 
            bbox_inches='tight')
Пример #3
0
from __future__ import print_function, division
from nilmtk import DataSet, TimeFrame, MeterGroup
import plot_config
import seaborn as sns
from matplotlib.ticker import MultipleLocator
import matplotlib.pyplot as plt
import pytz
from os.path import join

from pylab import rcParams
rcParams.update({'figure.figsize': plot_config._mm_to_inches(88, 150)})

print("plotting activity histograms...")

dataset = DataSet('/data/mine/vadeec/merged/ukdale.h5')
dataset.set_window("2013-03-01", None)#"2013-08-01")
elec = dataset.buildings[1].elec

N = 9
fig, axes = plt.subplots(N, 1)
meter_keys = ['boiler', 'kettle', 'toaster', 'oven',
              'vacuum cleaner', 'television', 
              'laptop computer', 'computer monitor', ('light', 1)]

axes = elec.plot_multiple(axes, meter_keys, 'plot_activity_histogram')

# Formatting
for i, ax in enumerate(axes):
    ax.grid(False)
    ax.set_yticks([])
    ax.set_ylabel('')
Пример #4
0
from __future__ import print_function, division
from nilmtk import DataSet, TimeFrame, MeterGroup
import plot_config
import seaborn as sns
from matplotlib.ticker import MultipleLocator
import matplotlib.pyplot as plt
import pytz
from os.path import join

from pylab import rcParams
rcParams.update({'figure.figsize': plot_config._mm_to_inches(88, 150)})

print("plotting activity histograms...")

dataset = DataSet('/data/mine/vadeec/merged/ukdale.h5')
dataset.set_window("2013-03-01", None)  #"2013-08-01")
elec = dataset.buildings[1].elec

N = 9
fig, axes = plt.subplots(N, 1)
meter_keys = [
    'boiler', 'kettle', 'toaster', 'oven', 'vacuum cleaner', 'television',
    'laptop computer', 'computer monitor', ('light', 1)
]

axes = elec.plot_multiple(axes, meter_keys, 'plot_activity_histogram')

# Formatting
for i, ax in enumerate(axes):
    ax.grid(False)
    ax.set_yticks([])