-
Notifications
You must be signed in to change notification settings - Fork 15
app_heat_map
David M. Lorenzetti edited this page Oct 3, 2014
·
3 revisions
A heat map shows electricity use by time-of-day, across many days. This shows the extent of daily, weekly, and seasonal load profiles.
Sample explanatory text: "Horizontal banding indicates shut off during periodic days (e.g. weekends). Vertical banding indicates consistent daily scheduling of usage. Unusual or unexplainable 'hot spots' may indicate poor equipment control."
Program plotHeatMap
- Get inputs:
-
times
, vector of date-times (typically a time-specific format). -
loads
, vector of power data recorded attimes
(float).
-
- Assume:
- Data are collected at the same time every day.
- Identify the data of interest:
- Take the last month of data. This ensures that the data are visually distinct.
- Break up the data into rows, each representing one day:
- Reshape
times
into an arraytimesByDay
. Each row oftimesByDay
corresponds to one calendar day, with the date increasing in higher-numbered rows. Use the local time zone to determine transitions between days. Each column oftimesByDay
should correspond to a particular time of day. Note this may require special padding for the first and last rows, iftimes
does not start or end exactly at midnight. If padding is needed, pad with a specialNAN
(not-a-number) indicator. - Reshape
loads
into an arrayloadsByDay
, using the same row breaks and row padding as fortimesByDay
.
- Reshape
- Make the heat map:
- Define a color mapping from a power to a color. Details include the spectrum of colors to be used, the min/max range of the color bar, and bin sizes for the color bar.
- Make a density map, a binned
x-y
color map. Takex
as the time-of-day intimesByDay
. Takey
as the dates intimesByDay
. The color of each cell is defined by applying the color mapping to the appropriate entry inloadsByDay
.