sens_center_plot module

For each measurement configuration, the sensitivity distribution and the center of mass of its values is computed.

Then for all measurements sensitivities and centers of mass are plotted in the grid. This might give a better overview on the sensitivities of our measurement configuration.

Different weights for the sensitivities can be used (–weight):

  • 0: unweighted,

  • 1: abs,

  • 2: log10,

  • 3: square,

by invoking the command line options.

Use sens_center_plot.py -h for help or take a look at the tests provided in TESTS/sens_center_plot.

Examples

Plot center plot, and single measurement sensitivities:

sens_center_plot.py --elem elem.dat --elec elec.dat --config config.dat -c

Disable plots:

sens_center_plot.py --no_plot

Use alternative weighting functions:

sens_center_plot.py –weight 0 sens_center_plot.py –weight 1 sens_center_plot.py –weight 2 sens_center_plot.py –weight 3

sens_center_plot.handle_cmd_options()[source]
sens_center_plot.main()[source]
class sens_center_plot.sens_center(elem_file, elec_file, options, weight)[source]

Bases: object

clean()[source]
color_electrodes(config_nr, ax)[source]

Color the electrodes used in specific configuration. Voltage electrodes are yellow, Current electrodes are red ?!

compute_center_of_mass(filename)[source]

Center of mass is computed using the sensitivity data output from CRMod Data weights can be applied using command line options

compute_sens(elem_file, elec_file, configs)[source]

Compute the sensitivities for the given input data. A CRMod instance is called to create the sensitivity files.

compute_sensitivity_centers()[source]
get_configs(filename, use_first_line)[source]
get_sens_centers(sens_files)[source]
plot_sens_center(frequency=2)[source]

plot sensitivity center distribution for all configurations in config.dat. The centers of mass are colored by the data given in volt_file.

plot_sensitivities_to_file()[source]
plot_single_configuration(config_nr, sens_file)[source]

plot sensitivity distribution with center of mass for a single configuration. The electrodes used are colored.

Parameters:
  • config_nr (int) – number of configuration

  • sens_file (string, file path) – filename to sensitivity file

remove_tmp_dir(directory)[source]

Remove the directory if it is located in /tmp