plots.py#

Make plots of spectral response data.

plots.main(args=None, **kw)[source]#

Make pdf of figures for a spectral response.

  • Load data

  • Plot monochromator spectral irradiance data

  • Plot camera spectral response

  • Plot camera spectral image stack measurements vs estimated values from the spectral response

  • Save the figures to a pdf

If called without parameters, parses arguments from the command line. Arguments may be passed as a list of strings or as keyword arguments. E.g.:

main(['-r','response.h5','--quiet'])
# or
main(response='response.h5',quiet=True)
Parameters:
  • response ('-r', '--response', Path) – path to spectral response file

  • monochromator ('-m', '--monochromator', Path) – path to monochromator irradiance file

  • output ('-o', '--output', Path) – path to pdf plots file

  • style ('--style', matplotlib style name) – Matplotlib style name or path to style file. default ggplot

  • logy ('--logy', bool) – Use log-y scale

  • dpi ('--dpi') – Figure dpi

  • figsize ('--figsize', [width, height]) – Set figure (page) size in inches. Default [8.3,5.8] is A5 landscape

  • margins ('--margins', [left, right, top, bottom]) – Set page margins, in inches. Default [0.5, 0.5, 1.0, 0.75]

  • title_pos ('--title-pos', float) – Title position from the top of the page, in inches. Ignores margins. Default 0.75

  • quiet ('--quiet') – Suppress progress messages

plots.set_margins(fig, margins)[source]#

Set figure margins in inches, (left,right,top,bottom).

plots.set_text(ax, xlabel=None, ylabel=None, title=None)[source]#

Set axis title and labels.

plots.srgb_spectrum(wl, fit=[(0.366, 435.0, 39.3), (1.0, 610.0, 86.0), (0.913, 539, 90.3), (1.0, 453, 71.2)])[source]#

Estimate sRGB for each wavelength, based on gaussian approximation.

plots.plot_irradiances(wl, irrad, irrad_std=0, likelihood=0.95, logy=False, ax=None)[source]#

Plot monochromator irradiances.

plots.plot_sample_estimates(wl, rgb_mean, rgb_std, est_mean, est_std, likelihood=0.95, ax=None)[source]#

Plot camera samples and their regression estimates.

plots.plot_response(wl, resp_mean, resp_std, resp_n, confidence=0.95, logy=False, ax=None)[source]#

Plot estimated camera spectral response.