Package mosp_tools :: Package heatmap :: Module heatmap :: Class Heatmap
[hide private]
[frames] | no frames]

Class Heatmap

source code


A generator for heatmap images based on simulation log data.


Author: B. Henne

Instance Methods [hide private]
 
__init__(self, mapfilename, minlon, maxlon, minlat, maxlat, dotsize=30)
Initialize the heatmap generation object.
source code
 
_colorize(self, img, colors, opacity)
Use the colorscheme selected to color the image densities.
source code
 
__dotImage(self, size)
Returns a image of the dot that is used for drawing heatmap.
source code
 
__translate(self, xy)
Translates x,y coordinates into pixel offsets of a map.
source code
 
generate(self, logfilename, delimiter, t, x, y, t_start, t_end, step, reset_dotlayer_every_step=False)
Generates the heapmap PNG image files.
source code
 
mencode_video(self, location, files, filetype, videofile)
[Bad Video Quality] Encodes a set of image files to a video file using mencoder.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  mapfile
filename of underlay map from osm export
  minlon
min longitude from osm png export
  maxlon
max longitude from osm png export
  minlat
min latitude from osm png export
  maxlat
max latitude from osm png export
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mapfilename, minlon, maxlon, minlat, maxlat, dotsize=30)
(Constructor)

source code 

Initialize the heatmap generation object.

Overrides: object.__init__

_colorize(self, img, colors, opacity)

source code 

Use the colorscheme selected to color the image densities.

heatmap.py v1.0 20091004. from http://www.jjguy.com/heatmap/

generate(self, logfilename, delimiter, t, x, y, t_start, t_end, step, reset_dotlayer_every_step=False)

source code 

Generates the heapmap PNG image files.

Parameters:
  • logfilename - name of csv-formated log file
  • delimiter - delimiter between columns in csv log file
  • t - number of log file's column containing time
  • x - number of log file's column containing x-value
  • y - number of log file's column containing y-value
  • t_start - start of output time interval
  • t_end - end of output time interval
  • step - size/length of a log accumulation step
  • reset_dotlayer_every_step - draw second heatmap over first one etc. or clear for each image

mencode_video(self, location, files, filetype, videofile)

source code 

[Bad Video Quality] Encodes a set of image files to a video file using mencoder.

Better use:

  1. mencoder mf://PNG/heatmap1*.png -mf type=png:w=780:h=600:fps=30 -o /dev/null -ovc x264 -x264encopts pass=1:bitrate=1200:bframes=1:me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 -vf crop=768:576:0:0
  2. mencoder mf://PNG/heatmap1*.png -mf type=png:w=780:h=600:fps=30 -o heatmap1.avi -ovc x264 -x264encopts pass=2:bitrate=1200:bframes=1:me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 -vf crop=768:576:0:0