pysilcam.plotting module

Particle plotting functionality: PSD, D50, etc.

class pysilcam.plotting.ParticleSizeDistPlot

Bases: object

Plot particle size distribution information on 2x2 layout

This is mostly old and redundant.

plot(imc, imbw, times, d50_ts, vd_mean, display)

Create plots from data

update(imc, imbw, times, d50_ts, vd_mean, display)

Update plot data without full replotting for speed

pysilcam.plotting.montage_plot(montage, pixel_size)

Plots a SilCam particle montage with a 1mm scale reference

Parameters
  • montage (uint8) – a SilCam montage created with scpp.make_montage

  • pixel_size (float) – the pixel size of the SilCam used, obtained from settings.PostProcess.pix_size in the config ini file

pysilcam.plotting.nd(stats, settings, ax, line=None, c='k', sample_volume=1.0)

Plot the particle number distribution, scaled to the given sample volume

Parameters
  • stats (DataFrame) – particle statistics from silcam process

  • settings (PySilcamSettings) – settings associated with the data, loaded with PySilcamSettings

  • () (line=None) – axis to plot data on

  • () – ?? possibly an option to rapidly replace a proviously plotted line??

  • c='k' (str) – color of the line to be plotted

  • sample_volume=1. (float) – the volume of water sampled in creating the stats DataFrame

Returns

?? the plotted line, possible returned incase of future adjustment??

Return type

line ()

pysilcam.plotting.nd_scaled(stats, settings, ax, c='k')

Plot the particle number distribution, scaled to the total volume of water sampled

Parameters
  • stats (DataFrame) – particle statistics from silcam process

  • settings (PySilcamSettings) – settings associated with the data, loaded with PySilcamSettings

  • () (ax) – axis to plot data on

  • c='k' (str) – color of the line to be plotted

pysilcam.plotting.psd(stats, settings, ax, line=None, c='k')

Plot a normalised particle volume distribution

Parameters
  • stats (DataFrame) – particle statistics from silcam process

  • settings (PySilcamSettings) – settings associated with the data, loaded with PySilcamSettings

  • () (line=None) – axis to plot data on

  • () – ?? possibly an option to rapidly replace a proviously plotted line??

  • c='k' (str) – color of the line to be plotted

Returns

?? the plotted line, possible returned incase of future adjustment??

Return type

line ()

pysilcam.plotting.show_imc(imc, mag=2)

Plots a scaled figure of for s SilCam image for medium or low magnification systems

Parameters
  • imc (uint8) – SilCam image (usually a corrected image, such as imc)

  • mag=2 (int) – mag=1 scales to the low mag SilCams; mag=2 (default) scales to the medium max SilCams

pysilcam.plotting.summarise_fancy_stats(stats_file, config_file, monitor=False, maxlength=100000, msize=2048, oilgas=<outputPartType.all: 1>, crop_stats=None)

Plots a summary figure of a dataset which shows the volume distribution, number distribution and a montage of randomly selected particles

Parameters
  • stats_file (str) – path of the *-STATS.h5 file created by silcam process

  • config_file (str) – path of the config ini file associated with the data

  • monitor=False (Bool) – if True then this function will run forever, continuously reading the stats_file and plotting the data might be useful in monitoring the progress of processing, for example

  • maxlength=100000 (int) – particles longer than this number will not be put in the montage

  • msize=2048 (int) – the montage created will have a canvas size of msize x msize pixels

  • oilgas=oc_pp.outputPartType.all – the oilgas enum if you want to just make the figure for oil, or just gas (defulats to all particles)

  • crop_stats=None – None or 4-tuple of lower-left then upper-right coord of crop