Package topo :: Package misc :: Module trace :: Class ActivityMovie
[hide private]
[frames] | no frames]

Class ActivityMovie

source code


An object encapsulating a series of movie frames displaying the value of one or more matrix-valued time-series contained in a DataRecorder object.

An ActivityMovie takes a DataRecorder object, a list of names of variables in that recorder and a sequence of timepoints at which to sample those variables. It uses that information to compose a sequence of MontageBitmap objects displaying the stored values of each variable at each timepoint. These bitmaps can then be saved to sequentially-named files that can be composited into a movie by external software.

Parameters are available to control the layout of the montage, adding timecodes to the frames, and the names of the frame files.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
__init__(self, **params)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
save(self)
Save the movie frames.
source code

Inherited from param.parameterized.Parameterized: __getstate__, __repr__, __setstate__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, set_default, set_dynamic_time_fn, set_param, state_pop, state_push, verbose, warning

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

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  variables = param.List(class_= str, doc= ...
A list of variable names in a DataRecorder object containing matrix-valued time series data.
  overlays = param.Dict(default= {}, doc= ...
A dictionary indicating overlays for the variable bitmaps.
  frame_times = param.List(default= [0, 1], doc= ...
A list of the times of the frames in the movie.
  montage_params = param.Dict(default= {}, doc= ...
A dictionary containing parameters to be used when instantiating the MontageBitmap objects representing each frame.
  recorder = param.ClassSelector(class_= DataRecorder, doc= ...
The DataRecorder storing the timeseries.
  filename_fmt = param.String(default= '%n_%t.%T', doc= ...
The format for the filenames used to store the frames.
  filename_time_fmt = param.String(default= '%05.0f', doc= ...
The format of the frame time, using Python string substitution for a floating-point number.
  filetype = param.String(default= 'tif', doc= ...
The filetype to use when writing frames.
  filename_prefix = param.String(default= '', doc= ...
A prefix to prepend to the filename of each frame when saving; can include directories.
  add_timecode = param.Boolean(default= False, doc= ...
Whether to add a visible timecode indicator to each frame.
  timecode_options = param.Dict(default= {}, instantiate= False,...
A dictionary of keyword options to be passed to the PIL ImageDraw.text method when drawing the timecode on the frame.
  timecode_fmt = param.String(default= '%05.0f', doc= ...
The format of the timecode displayed in the movie frames, using Python string substitution for a floating-point number.
  timecode_offset = param.Number(default= 0, doc= ...
A value to be added to each timecode before formatting for display.
  name = <param.parameterized.String object at 0xbe2402c>
String identifier for this object.

Inherited from param.parameterized.Parameterized: print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **params)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

variables

A list of variable names in a DataRecorder object containing matrix-valued time series data.
Value:
param.List(class_= str, doc= """
        A list of variable names in a DataRecorder object containing
        matrix-valued time series data.""")

overlays

A dictionary indicating overlays for the variable bitmaps. The for each key in the dict matching the name of a variable, there should be associated a triple of matrices to be overlayed on the red, green, and blue channels of the corresponding bitmap in each frame.
Value:
param.Dict(default= {}, doc= """
        A dictionary indicating overlays for the variable bitmaps.  The
        for each key in the dict matching the name of a variable, there
        should be associated a triple of matrices to be overlayed on
        the red, green, and blue channels of the corresponding bitmap
        in each frame.""")

frame_times

A list of the times of the frames in the movie.
Value:
param.List(default= [0, 1], doc= """
        A list of the times of the frames in the movie.""")

montage_params

A dictionary containing parameters to be used when instantiating the MontageBitmap objects representing each frame.
Value:
param.Dict(default= {}, doc= """
        A dictionary containing parameters to be used when
        instantiating the MontageBitmap objects representing each frame.""", insta\
ntiate= False)

recorder

The DataRecorder storing the timeseries.
Value:
param.ClassSelector(class_= DataRecorder, doc= """
        The DataRecorder storing the timeseries.""")

filename_fmt

The format for the filenames used to store the frames. The following substitutions are possible:

%n: The name of this ActivityMovie object. %t: The frame time, as formatted by the filename_time_fmt parameter %T: The filetype given by the filetype parameter.

Value:
param.String(default= '%n_%t.%T', doc= """
        The format for the filenames used to store the frames.  The following
        substitutions are possible:
        
        %n: The name of this ActivityMovie object.
        %t: The frame time, as formatted by the filename_time_fmt parameter
        %T: The filetype given by the filetype parameter. """)

filename_time_fmt

The format of the frame time, using Python string substitution for a floating-point number.
Value:
param.String(default= '%05.0f', doc= """
        The format of the frame time, using Python string substitution for
        a floating-point number.""")

filetype

The filetype to use when writing frames. Can be any filetype understood by the Python Imaging Library.
Value:
param.String(default= 'tif', doc= """
        The filetype to use when writing frames. Can be any filetype understood
        by the Python Imaging Library.""")

filename_prefix

A prefix to prepend to the filename of each frame when saving; can include directories. If the filename contains a path, any non-existent directories in the path will be created when the movie is saved.
Value:
param.String(default= '', doc= """
        A prefix to prepend to the filename of each frame when saving; 
        can include directories.  If the filename contains a path, any
        non-existent directories in the path will be created when the
        movie is saved.""")

add_timecode

Whether to add a visible timecode indicator to each frame.
Value:
param.Boolean(default= False, doc= """
        Whether to add a visible timecode indicator to each frame.""")

timecode_options

A dictionary of keyword options to be passed to the PIL ImageDraw.text method when drawing the timecode on the frame. Valid options include font, an ImageFont object indicating the text font, and fill a PIL color specification indicating the text color. If unspecified, color defaults to the PIL default of black. Font defaults to topo.plotting.bitmap.TITLE_FONT.
Value:
param.Dict(default= {}, instantiate= False, doc= """
        A dictionary of keyword options to be passed to the PIL ImageDraw.text met\
hod
        when drawing the timecode on the frame. Valid options include font,
        an ImageFont object indicating the text font, and fill a PIL color
        specification indicating the text color.  If unspecified, color defaults t\
o
        the PIL default of black.  Font defaults to topo.plotting.bitmap.TITLE_FON\
...

timecode_fmt

The format of the timecode displayed in the movie frames, using Python string substitution for a floating-point number.
Value:
param.String(default= '%05.0f', doc= """
        The format of the timecode displayed in the movie frames, using
        Python string substitution for a floating-point number.""")

timecode_offset

A value to be added to each timecode before formatting for display.
Value:
param.Number(default= 0, doc= """
        A value to be added to each timecode before formatting for display.""")