Skip to content
David M. Lorenzetti edited this page Oct 3, 2014 · 3 revisions

Heat map application

Introduction

A heat map shows electricity use by time-of-day, across many days. This shows the extent of daily, weekly, and seasonal load profiles.

Pseudo-code: Heat map

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 at times (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 array timesByDay. Each row of timesByDay 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 of timesByDay should correspond to a particular time of day. Note this may require special padding for the first and last rows, if times does not start or end exactly at midnight. If padding is needed, pad with a special NAN (not-a-number) indicator.
    • Reshape loads into an array loadsByDay, using the same row breaks and row padding as for timesByDay.
  • 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. Take x as the time-of-day in timesByDay. Take y as the dates in timesByDay. The color of each cell is defined by applying the color mapping to the appropriate entry in loadsByDay.