Axis

class opencsp.common.lib.render_control.RenderControlAxis.RenderControlAxis(x_label='x', y_label='y', z_label='z', p_label='p', q_label='q', w_label='w', draw_axes=True, grid=True)

Bases: object

Render control for plot axes.

__init__(x_label='x', y_label='y', z_label='z', p_label='p', q_label='q', w_label='w', draw_axes=True, grid=True)
opencsp.common.lib.render_control.RenderControlAxis.image(draw_axes=True, grid=True)

Labels indicating image.

opencsp.common.lib.render_control.RenderControlAxis.latlon(decimal_t_degminsecs_f=True, draw_axes=True, grid=True)

Labels indicating units of latitude and longitude.

opencsp.common.lib.render_control.RenderControlAxis.meters(draw_axes=True, grid=True)

Labels indicating units of meters.

Bcs

class opencsp.common.lib.render_control.RenderControlBcs.RenderControlBcs(linestyle: str | None = '-', linewidth: float = 1, color: str = 'b', marker: str | None = '.', markersize: float = 8, markeredgecolor: str | None = None, markeredgewidth: float | None = None, markerfacecolor: str | None = None)

Bases: RenderControlPointSeq

Render control for the Beam Characterization System target.

Controls style of the point marker and circle marker of the BCS.

__init__(linestyle: str | None = '-', linewidth: float = 1, color: str = 'b', marker: str | None = '.', markersize: float = 8, markeredgecolor: str | None = None, markeredgewidth: float | None = None, markerfacecolor: str | None = None)

Render control for the Beam Characterization System target.

Controls style of the point marker and circle marker of the BCS.

Parameters:
  • linestyle (str, optional) – How to draw the line for the circle around the BCS. One of ‘-’, ‘–’, ‘-.’, ‘:’, ‘’ or None (see RenderControlPointSeq for a description). By default ‘-’

  • linewidth (int, optional) – Width of the line for the circle around the BCS. By default 1

  • color (str, optional) – Color for the circle around the BCS. One of bgrcmykw (see RenderControlPointSeq for a description). By default ‘b’

  • marker (str, optional) – Shape of the center BCS marker. One of .,ov^<>12348sp*hH+xXDd|_ or None. By default ‘.’

  • markersize (int, optional) – Size of the center BCS marker. By default 8

  • markeredgecolor (str, optional) – Defaults to color above if not set. By default None

  • markeredgewidth (float, optional) – Defaults to linewidth if not set. By default None

  • markerfacecolor (str, optional) – Defaults to color above if not set. By default None

opencsp.common.lib.render_control.RenderControlBcs.default(marker='.', color='b', linewidth=1, markersize=8) RenderControlBcs

Create a default render control for the Beam Characterization System target.

This function returns a RenderControlBcs instance configured with standard settings, providing a basic visual representation of the BCS when no specific preferences are expressed.

Parameters:
  • marker (str, optional) – Shape of the center BCS marker. One of ‘.’, ‘o’, ‘v’, ‘^’, ‘<’, ‘>’, ‘1’, ‘2’, ‘3’, ‘4’, ‘8’, ‘s’, ‘*’, ‘h’, ‘H’, ‘+’, ‘x’, ‘D’, ‘d’, ‘|’, ‘_’, or None. By default, ‘.’.

  • color (str, optional) – Color for the circle around the BCS. One of ‘b’, ‘g’, ‘r’, ‘c’, ‘m’, ‘y’, ‘k’, or any valid color string. By default, ‘b’.

  • linewidth (float, optional) – Width of the line for the circle around the BCS. By default, 1.

  • markersize (float, optional) – Size of the center BCS marker. By default, 8.

Returns:

An instance of RenderControlBcs configured with the specified parameters.

Return type:

RenderControlBcs

opencsp.common.lib.render_control.RenderControlBcs.thin(marker='.', color='b', linewidth=0.3, markersize=5) RenderControlBcs

Create a thin render control for the Beam Characterization System target.

This function returns a RenderControlBcs instance configured with a thin line style, suitable for scenarios where a less prominent visual representation is desired.

Parameters:
  • marker (str, optional) – Shape of the center BCS marker. One of ‘.’, ‘o’, ‘v’, ‘^’, ‘<’, ‘>’, ‘1’, ‘2’, ‘3’, ‘4’, ‘8’, ‘s’, ‘*’, ‘h’, ‘H’, ‘+’, ‘x’, ‘D’, ‘d’, ‘|’, ‘_’, or None. By default, ‘.’.

  • color (str, optional) – Color for the circle around the BCS. One of ‘b’, ‘g’, ‘r’, ‘c’, ‘m’, ‘y’, ‘k’, or any valid color string. By default, ‘b’.

  • linewidth (float, optional) – Width of the line for the circle around the BCS. By default, 0.3.

  • markersize (float, optional) – Size of the center BCS marker. By default, 5.

Returns:

An instance of RenderControlBcs configured with the specified parameters.

Return type:

RenderControlBcs

Point Sequence

class opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq(linestyle='-', linewidth: float = 1, color: str | Color = 'b', marker='x', markersize: float = 6, markeredgecolor: str | Color | None = None, markeredgewidth=None, markerfacecolor: str | Color | None = None, markeralpha: float | None = None, vector_color: str | Color = 'b', vector_linewidth: float = 1, vector_scale: float = 1.0)

Bases: object

Render control for sequences of points.

This class controls the style of point markers and lines connecting points.

Choices for line styles and colors can be found in the Matplotlib documentation: - Line Styles: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html

Line Styles

‘-’ solid line style ‘–’ dashed line style ‘-.’ dash-dot line style ‘:’ dotted line style

Colors

‘b’ blue ‘g’ green ‘r’ red ‘c’ cyan ‘m’ magenta ‘y’ yellow ‘k’ black ‘w’ white

For more colors, see: https://matplotlib.org/stable/api/colors_api.html#module-matplotlib.colors

Markers

‘.’ point marker ‘,’ pixel marker ‘o’ circle marker ‘v’ triangle_down marker ‘^’ triangle_up marker ‘<’ triangle_left marker ‘>’ triangle_right marker ‘1’ tri_down marker (three lines from the center to points on 30, 150, and 270 degrees) ‘2’ tri_up marker (three lines from the center to points on 90, 210, and 330 degrees) ‘3’ tri_left marker (three lines from the center to points on 60, 180, and 300 degrees) ‘4’ tri_right marker (three lines from the center to points on 0, 120, and 240 degrees) ‘8’ octagon marker ‘s’ square marker ‘p’ pentagon marker ‘P’ plus (filled) marker ‘*’ star marker ‘h’ hexagon1 marker ‘H’ hexagon2 marker ‘+’ plus marker ‘x’ x marker ‘X’ x (filled) marker ‘D’ diamond marker ‘d’ thin_diamond marker ‘|’ vline marker ‘_’ hline marker ‘None’ no marker ‘$♫$’ two quarter notes ‘$♫$’ two quarter notes ‘arrow’ draws an arrow at the end of every line

For more markers, see: https://matplotlib.org/stable/gallery/lines_bars_and_markers/marker_reference.html

__init__(linestyle='-', linewidth: float = 1, color: str | Color = 'b', marker='x', markersize: float = 6, markeredgecolor: str | Color | None = None, markeredgewidth=None, markerfacecolor: str | Color | None = None, markeralpha: float | None = None, vector_color: str | Color = 'b', vector_linewidth: float = 1, vector_scale: float = 1.0)

Initialize the rendering control for point sequences.

Parameters:
  • linestyle (str, optional) – Determines how lines are drawn. One of ‘-’, ‘–’, ‘-.’, ‘:’, ‘’ or ‘None’. Default is ‘-’ (solid line).

  • linewidth (float, optional) – Width of lines in pixels. Default is 1.

  • color (str | Color, optional) – The primary color used for everything that doesn’t have a color specified. Default is ‘b’.

  • marker (str | None, optional) – The style of marker to use. See the class description for more information. Default is ‘x’.

  • markersize (float, optional) – Size of the marker in pixels. Default is 6.

  • markeredgecolor (str | Color | None, optional) – The color of the marker edges. Default is the same as color.

  • markeredgewidth (float | None, optional) – Width of the marker edge in pixels. Defaults to linewidth.

  • markerfacecolor (str | Color | None, optional) – The color of the marker faces. Default is the same as color.

  • markeralpha (float | None, optional) – The alpha value (transparency) for the markers, where 0 is fully transparent and 1 is fully opaque. None for matplotlib default style. Default is None.

  • vector_color (str | Color | None, optional) – The color for vectors. Only applies to points in a vector field. Default is ‘b’.

  • vector_linewidth (float, optional) – The line width for vectors, in pixels. Only applies to points in a vector field. Default is 1.

  • vector_scale (float, optional) – Factor to grow/shrink vector length. Only applies to points in a vector field. Default is 1.

set_color(color: str | Color | tuple[float] | None)

Update the color values for this instance. Updates all color values to the given color. Use the “color = [value]” setters to change just a single color.

Parameters:

color (str | cl.Color | tuple[float]) – The fill color to use for a filled shape.

property color: tuple[float, float, float, float] | None

Get the RGBA color value for the primary color.

Returns:

The RGBA color value or None if not set.

Return type:

tuple[float, float, float, float] | None

property markeredgecolor: tuple[float, float, float, float] | None

Get the RGBA color value for the marker edge color.

Returns:

The RGBA color value or None if not set.

Return type:

tuple[float, float, float, float] | None

property markerfacecolor: tuple[float, float, float, float] | None

Get the RGBA color value for the marker face color.

Returns:

The RGBA color value or None if not set.

Return type:

tuple[float, float, float, float] | None

property vector_color: tuple[float, float, float, float] | None

Get the RGBA color value for the vector color.

Returns:

The RGBA color value or None if not set.

Return type:

tuple[float, float, float, float] | None

opencsp.common.lib.render_control.RenderControlPointSeq.data_curve(color='b', linewidth=1, marker='.', markersize=3) RenderControlPointSeq

Create a render control for a data curve with identified data points.

This function returns a RenderControlPointSeq instance configured to draw a data curve with specified data points.

Parameters:
  • color (str, optional) – Color for the data curve. By default, ‘b’ (blue).

  • linewidth (float, optional) – Line width for the data curve. By default, 1.

  • marker (str, optional) – Marker style for the data points. By default, ‘.’ (point marker).

  • markersize (float, optional) – Size of the marker in pixels. By default, 3.

Returns:

An instance of RenderControlPointSeq configured for a data curve.

Return type:

RenderControlPointSeq

opencsp.common.lib.render_control.RenderControlPointSeq.default(marker='.', color='b', linewidth=1, markersize=8)

Create a default render control for point sequences.

This function returns a RenderControlPointSeq instance with default settings.

Parameters:
  • marker (str, optional) – Marker style for the points. By default, ‘.’ (point marker).

  • color (str, optional) – Color for the points. By default, ‘b’ (blue).

  • linewidth (float, optional) – Line width for connecting lines. By default, 1.

  • markersize (float, optional) – Size of the marker in pixels. By default, 8.

Returns:

An instance of RenderControlPointSeq configured with default parameters.

Return type:

RenderControlPointSeq

opencsp.common.lib.render_control.RenderControlPointSeq.marker(marker='o', color='b', markersize=3) RenderControlPointSeq

Create a render control for displaying markers.

This function returns a RenderControlPointSeq instance configured to display markers.

Parameters:
  • marker (str, optional) – Marker style for the points. By default, ‘o’ (circle marker).

  • color (str, optional) – Color for the markers. By default, ‘b’ (blue).

  • markersize (float, optional) – Size of the marker in pixels. By default, 3.

Returns:

An instance of RenderControlPointSeq configured to display markers.

Return type:

RenderControlPointSeq

opencsp.common.lib.render_control.RenderControlPointSeq.outline(color='k', linewidth=1)

Create a render control for outlines of physical objects.

This function returns a RenderControlPointSeq instance configured to draw outlines only.

Parameters:
  • color (str, optional) – Color for the outlines. By default, ‘k’ (black).

  • linewidth (float, optional) – Line width for the outlines. By default, 1.

Returns:

An instance of RenderControlPointSeq configured to display outlines only.

Return type:

RenderControlPointSeq

opencsp.common.lib.render_control.RenderControlPointSeq.thin(marker=',', linewidth=0.3, color='y') RenderControlPointSeq

Create a render control for a thin line style.

This function returns a RenderControlPointSeq instance configured for a thin line style.

Parameters:
  • marker (str, optional) – Marker style for the points. By default, ‘,’ (pixel marker).

  • linewidth (float, optional) – Line width for the points. By default, 0.3.

  • color (str, optional) – Color for the points. By default, ‘y’ (yellow).

Returns:

An instance of RenderControlPointSeq configured for a thin line style.

Return type:

RenderControlPointSeq

opencsp.common.lib.render_control.RenderControlPointSeq.vector_field(marker='.', color='b', markersize=3, vector_linewidth=1, vector_scale=1.0) RenderControlPointSeq

Create a render control for a field of vector needles.

This function returns a RenderControlPointSeq instance configured to draw a field of vectors.

Parameters:
  • marker (str, optional) – Marker style for the points. By default, ‘.’ (point marker).

  • color (str, optional) – Color for the vector needles. By default, ‘b’ (blue).

  • markersize (float, optional) – Size of the marker in pixels. By default, 3.

  • vector_linewidth (float, optional) – Line width for the vector needles, in pixels. By default, 1.

  • vector_scale (float, optional) – Factor to grow/shrink vector length. By default, 1.0.

Returns:

An instance of RenderControlPointSeq configured for a vector field.

Return type:

RenderControlPointSeq

Deflectometry

class opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.RenderControlDeflectometryInstrument(draw_centroid=True, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=True, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal=True, surface_normal_length=4, surface_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal_at_corners=True, corner_normal_length=2, corner_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, corner_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_facets=False, facet_styles=<opencsp.common.lib.render_control.RenderControlEnsemble.RenderControlEnsemble object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>)

Bases: object

Render control for deflectometry instruments.

__init__(draw_centroid=True, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=True, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal=True, surface_normal_length=4, surface_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal_at_corners=True, corner_normal_length=2, corner_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, corner_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_facets=False, facet_styles=<opencsp.common.lib.render_control.RenderControlEnsemble.RenderControlEnsemble object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>)

Render control for deflectometry instruments.

This class manages the rendering settings for deflectometry instruments, allowing customization of various visual elements such as centroids, outlines, surface normals, and facets.

Parameters:
  • draw_centroid (bool, optional) – Whether to draw the centroid. By default, True.

  • centroid_style (object, optional) – Style for the centroid marker. By default, rcps.marker().

  • draw_outline (bool, optional) – Whether to draw the outline. By default, True.

  • outline_style (object, optional) – Style for the outline. By default, rcps.outline().

  • draw_surface_normal (bool, optional) – Whether to draw the surface normal. By default, True.

  • surface_normal_length (float, optional) – Length of the surface normal. By default, 4.

  • surface_normal_style (object, optional) – Style for the surface normal. By default, rcps.outline().

  • surface_normal_base_style (object, optional) – Style for the base of the surface normal. By default, rcps.marker().

  • draw_surface_normal_at_corners (bool, optional) – Whether to draw surface normals at corners. By default, True.

  • corner_normal_length (float, optional) – Length of the corner normal. By default, 2.

  • corner_normal_style (object, optional) – Style for the corner normal. By default, rcps.outline().

  • corner_normal_base_style (object, optional) – Style for the base of the corner normal. By default, rcps.marker().

  • draw_facets (bool, optional) – Whether to draw facets. By default, False.

  • facet_styles (object, optional) – Styles for the facets. By default, rce.RenderControlEnsemble(rcf.outline()).

  • draw_name (bool, optional) – Whether to draw the name. By default, False.

  • name_style (object, optional) – Style for the name text. By default, rctxt.default(color=’k’).

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.blank()

Create a blank render control for deflectometry instruments.

This function returns a RenderControlDeflectometryInstrument instance with all drawing options disabled.

Returns:

An instance of RenderControlDeflectometryInstrument with no visual elements drawn.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.centroid(color='k')

Create a render control that displays only the centroid.

This function returns a RenderControlDeflectometryInstrument instance configured to draw only the centroid of the instrument.

Parameters:

color (str, optional) – Color of the centroid marker. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display only the centroid.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.centroid_name(color='k')

Create a render control that displays both the centroid and the name.

This function returns a RenderControlDeflectometryInstrument instance configured to draw both the centroid and the name of the instrument.

Parameters:

color (str, optional) – Color of the centroid marker. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display both the centroid and the name.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.centroid_name_outline(color='k', horizontalalignment='center', verticalalignment='center')

Create a render control that displays the centroid, name, and overall outline.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the centroid, the name, and the outline of the instrument.

Parameters:
  • color (str, optional) – Color of the centroid marker and outline. By default, ‘k’.

  • horizontalalignment (str, optional) – Horizontal alignment of the name text. By default, ‘center’.

  • verticalalignment (str, optional) – Vertical alignment of the name text. By default, ‘center’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the centroid, name, and outline.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.corner_normals_outline(color='k')

Create a render control that displays the overall outline and surface normals at each corner.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the outline of the instrument and surface normals at each corner.

Parameters:

color (str, optional) – Color of the outline and corner normals. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the outline and corner normals.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.default()

Create a default render control for deflectometry instruments.

This function returns a RenderControlDeflectometryInstrument instance with standard settings.

Returns:

An instance of RenderControlDeflectometryInstrument with default parameters.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.facet_outlines(color='k')

Create a render control that displays only the facet outlines.

This function returns a RenderControlDeflectometryInstrument instance configured to draw only the outlines of the facets.

Parameters:

color (str, optional) – Color of the facet outlines. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display only the facet outlines.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.facet_outlines_corner_normals(color='k')

Create a render control that displays facet outlines and surface normals at corners.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the outlines of the facets and surface normals at the corners.

Parameters:

color (str, optional) – Color of the facet outlines and corner normals. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display facet outlines and corner normals.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.facet_outlines_names(color='k')

Create a render control that displays facet outlines and facet name labels.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the outlines of the facets along with their corresponding names.

Parameters:

color (str, optional) – Color of the facet outlines and names. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display facet outlines and names.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.facet_outlines_normals(color='k')

Create a render control that displays facet outlines without surface normals.

This function returns a RenderControlDeflectometryInstrument instance configured to draw only the outlines of the facets.

Parameters:

color (str, optional) – Color of the facet outlines. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display facet outlines.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.highlight(color='b')

Create a render control with highlighted styles for deflectometry instruments.

This function returns a RenderControlDeflectometryInstrument instance configured with styles that emphasize the centroid, outline, and surface normals, making them visually distinct.

Parameters:

color (str, optional) – Color for the highlighted elements (centroid, outline, surface normals, and corner normals). By default, ‘b’ (blue).

Returns:

An instance of RenderControlDeflectometryInstrument configured with highlighted styles.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.name(color='k', fontsize='medium')

Create a render control that displays only the name.

This function returns a RenderControlDeflectometryInstrument instance configured to draw only the name of the instrument.

Parameters:
  • color (str, optional) – Color of the name text. By default, ‘k’.

  • fontsize (str, optional) – Font size of the name text. By default, ‘medium’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display only the name.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.name_outline(color='k', horizontalalignment='center', verticalalignment='center')

Create a render control that displays the name and overall outline.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the name and the outline of the instrument.

Parameters:
  • color (str, optional) – Color of the outline. By default, ‘k’.

  • horizontalalignment (str, optional) – Horizontal alignment of the name text. By default, ‘center’.

  • verticalalignment (str, optional) – Vertical alignment of the name text. By default, ‘center’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the name and outline.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.normal(color='k', surface_normal_length=4)

Create a render control that displays the overall surface normal.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the surface normal of the instrument.

Parameters:
  • color (str, optional) – Color of the surface normal and its base. By default, ‘k’.

  • surface_normal_length (float, optional) – Length of the surface normal. By default, 4.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the surface normal.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.normal_facet_outlines(color='k')

Create a render control that displays the surface normal and facet outlines.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the surface normal and the outlines of the facets.

Parameters:

color (str, optional) – Color of the surface normal and facet outlines. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the surface normal and facet outlines.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.normal_facet_outlines_names(color='k')

Create a render control that displays facet outlines and facet name labels along with the surface normal.

This function returns a RenderControlDeflectometryInstrument instance configured to draw the surface normal and the outlines of the facets along with their corresponding names.

Parameters:

color (str, optional) – Color of the surface normal and facet outlines. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display facet outlines, names, and surface normal.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.normal_outline(color='k', surface_normal_length=4)

Create a render control that displays the overall surface normal and overall outline.

This function returns a RenderControlDeflectometryInstrument instance configured to draw both the surface normal and the outline of the instrument.

Parameters:
  • color (str, optional) – Color of the surface normal and outline. By default, ‘k’.

  • surface_normal_length (float, optional) – Length of the surface normal. By default, 4.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display the surface normal and outline.

Return type:

RenderControlDeflectometryInstrument

opencsp.common.lib.render_control.RenderControlDeflectometryInstrument.outline(color='k')

Create a render control that displays only the overall outline.

This function returns a RenderControlDeflectometryInstrument instance configured to draw only the outline of the instrument.

Parameters:

color (str, optional) – Color of the outline. By default, ‘k’.

Returns:

An instance of RenderControlDeflectometryInstrument configured to display only the outline.

Return type:

RenderControlDeflectometryInstrument

Facet

class opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet(draw_centroid=False, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=True, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal=False, surface_normal_length=4, surface_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, draw_mirror_curvature=False, mirror_styles=<opencsp.common.lib.render_control.RenderControlMirror.RenderControlMirror object>)

Bases: object

Render control for heliostat facets.

__init__(draw_centroid=False, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=True, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal=False, surface_normal_length=4, surface_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, draw_mirror_curvature=False, mirror_styles=<opencsp.common.lib.render_control.RenderControlMirror.RenderControlMirror object>)

Render control for heliostat facets.

This class manages the rendering settings for heliostat facets, allowing customization of various visual elements such as centroids, outlines, surface normals, and mirror curvature.

Parameters:
  • draw_centroid (bool, optional) – Whether to draw the centroid of the facet. By default, False.

  • centroid_style (object, optional) – Style for the centroid marker. By default, rcps.marker().

  • draw_outline (bool, optional) – Whether to draw the outline of the facet. By default, True.

  • outline_style (object, optional) – Style for the outline. By default, rcps.outline().

  • draw_surface_normal (bool, optional) – Whether to draw the surface normal. By default, False.

  • surface_normal_length (float, optional) – Length of the surface normal. By default, 4.

  • surface_normal_style (object, optional) – Style for the surface normal. By default, rcps.outline().

  • surface_normal_base_style (object, optional) – Style for the base of the surface normal. By default, rcps.marker().

  • draw_name (bool, optional) – Whether to draw the name of the facet. By default, False.

  • name_style (object, optional) – Style for the name text. By default, rctxt.default(color=’k’).

  • draw_mirror_curvature (bool, optional) – Whether to draw the curvature of the mirror. By default, False.

  • mirror_styles (object, optional) – Styles for the mirror. By default, rcm.RenderControlMirror().

style(input_name: str)

Gets the style for the given name. Always returns self for the current implement.

Parameters:

input_name (str) – The name to get the style for. Ignored in the current implementation.

Returns:

style – The style associated with the name.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.corner_normals_outline_NOTWORKING(color='k')
opencsp.common.lib.render_control.RenderControlFacet.corner_normals_outline_name_NOTWORKING(color='k')
opencsp.common.lib.render_control.RenderControlFacet.default()

Create a default render control for heliostat facets.

This function returns a RenderControlFacet instance with default settings.

Returns:

An instance of RenderControlFacet configured with default parameters.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.highlight_NOTWORKING(color='b')
opencsp.common.lib.render_control.RenderControlFacet.normal_mirror_surface(color='k')

Create a render control that displays the normal mirror surface.

This function returns a RenderControlFacet instance configured to draw the mirror curvature without the centroid, outline, or surface normal.

Parameters:

color (str, optional) – Color of the outline. By default, ‘k’ (black).

Returns:

An instance of RenderControlFacet configured to display the normal mirror surface.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.normal_outline(color='k')

Create a render control that displays the normal and outline of the facet.

This function returns a RenderControlFacet instance configured to draw the outline and the surface normal.

Parameters:

color (str, optional) – Color of the outline and surface normal. By default, ‘k’ (black).

Returns:

An instance of RenderControlFacet configured to display the normal and outline.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.outline(color='k')

Create a render control that displays only the outline of the facet.

This function returns a RenderControlFacet instance configured to draw the outline without the centroid or surface normal.

Parameters:

color (str, optional) – Color of the outline. By default, ‘k’ (black).

Returns:

An instance of RenderControlFacet configured to display only the outline.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.outline_name(color='k')

Create a render control that displays the outline and the name of the facet.

This function returns a RenderControlFacet instance configured to draw the outline and the name of the facet.

Parameters:

color (str, optional) – Color of the outline and name. By default, ‘k’ (black).

Returns:

An instance of RenderControlFacet configured to display the outline and name.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacet.outline_thin(color='k', linewidth=0.5)

Create a render control that displays a thin outline of the facet.

This function returns a RenderControlFacet instance configured to draw a thin outline of the facet without the centroid or surface normal.

Parameters:
  • color (str, optional) – Color of the outline. By default, ‘k’ (black).

  • linewidth (float, optional) – Width of the outline line. By default, 0.5.

Returns:

An instance of RenderControlFacet configured to display a thin outline.

Return type:

RenderControlFacet

class opencsp.common.lib.render_control.RenderControlFacetEnsemble.RenderControlFacetEnsemble(default_style: ~opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet = <opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet object>, draw_facets=True, special_styles: dict[str, ~opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet] | None = None, draw_centroid=False, draw_normal_vector=False, normal_vector_length=4.0, normal_vector_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, normal_vector_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=False, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal_at_corners=False, corner_normal_length=2, corner_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, corner_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>)

Bases: object

Render control for collections of named facets.

Provides a default render copntrol, with exceptions for objets with specific names.

Multiple classes of exceptions can be defineid, each with its own specialized render style.

Render styles may be of arbitrary type: RenderControlFacet, RenderControlHeliostat, etc.

__init__(default_style: ~opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet = <opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet object>, draw_facets=True, special_styles: dict[str, ~opencsp.common.lib.render_control.RenderControlFacet.RenderControlFacet] | None = None, draw_centroid=False, draw_normal_vector=False, normal_vector_length=4.0, normal_vector_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, normal_vector_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_outline=False, outline_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_surface_normal_at_corners=False, corner_normal_length=2, corner_normal_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, corner_normal_base_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>)

Render control for collections of named facets.

Provides a default render control, with exceptions for objects with specific names. Multiple classes of exceptions can be defined, each with its own specialized render style. Render styles may be of arbitrary type: RenderControlFacet, RenderControlHeliostat, etc.

Parameters:
  • default_style (RenderControlFacet, optional) – The default rendering style for facets. By default, an instance of RenderControlFacet.

  • draw_facets (bool, optional) – Whether to draw the facets. By default, True.

  • special_styles (dict[str, RenderControlFacet], optional) – A dictionary mapping facet names to their specialized rendering styles. By default, None.

  • draw_centroid (bool, optional) – Whether to draw the centroid of the facet ensemble. By default, False.

  • draw_normal_vector (bool, optional) – Whether to draw the normal vector for the facet ensemble. By default, False.

  • normal_vector_length (float, optional) – Length of the normal vector. By default, 4.0.

  • normal_vector_style (object, optional) – Style for the normal vector. By default, rcps.outline().

  • normal_vector_base_style (object, optional) – Style for the base of the normal vector. By default, rcps.marker().

  • draw_outline (bool, optional) – Whether to draw the outline of the facet ensemble. By default, False.

  • outline_style (object, optional) – Style for the facet ensemble outline. By default, rcps.outline().

  • draw_surface_normal_at_corners (bool, optional) – Whether to draw surface normals at corners. By default, False (unimplemented).

  • corner_normal_length (float, optional) – Length of the corner normal. By default, 2.0 (unimplemented).

  • corner_normal_style (object, optional) – Style for the corner normal. By default, rcps.outline() (unimplemented).

  • corner_normal_base_style (object, optional) – Style for the base of the corner normal. By default, rcps.marker() (unimplemented).

add_special_style(facet_name: str | list, facet_style: RenderControlFacet)

Add a special rendering style for a specific facet or a list of facets.

This method allows the user to associate a custom rendering style with a facet name or multiple facet names. If a facet name is None, a warning is issued.

Parameters:
  • facet_name (str or list) – The name of the facet or a list of facet names to which the special style will be applied.

  • facet_style (RenderControlFacet) – The rendering style to associate with the specified facet name(s).

Raises:

UserWarning – If facet_name is None, a warning is issued indicating that special styles should not be applied.

get_facet_style(facet_name: str)

Retrieve the rendering style for a specific facet.

This method checks if a special style exists for the given facet name and returns it. If no special style is found, the default style is returned.

Parameters:

facet_name (str) – The name of the facet for which to retrieve the rendering style.

Returns:

The rendering style associated with the specified facet name.

Return type:

RenderControlFacet

opencsp.common.lib.render_control.RenderControlFacetEnsemble.facet_ensemble_outline(color='k', normal_vector_length=4.0, **kwargs)

Create a render control ensemble with outlines and normal vectors for facets.

This function returns a RenderControlFacetEnsemble instance configured to draw outlines and normal vectors for facets.

Parameters:
  • color (str, optional) – Color for the outlines and normal vectors. By default, ‘k’ (black).

  • normal_vector_length (float, optional) – Length of the normal vectors. By default, 4.0.

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFacetEnsemble.

Returns:

An instance of RenderControlFacetEnsemble configured for outlines and normal vectors.

Return type:

RenderControlFacetEnsemble

opencsp.common.lib.render_control.RenderControlFacetEnsemble.facet_outlines(color='k', **kwargs)

Create a render control ensemble with facet outlines.

This function returns a RenderControlFacetEnsemble instance configured to draw facet outlines without normal vectors or centroids.

Parameters:
  • color (str, optional) – Color for the outlines. By default, ‘k’ (black).

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFacetEnsemble.

Returns:

An instance of RenderControlFacetEnsemble configured for facet outlines.

Return type:

RenderControlFacetEnsemble

opencsp.common.lib.render_control.RenderControlFacetEnsemble.facet_outlines_thin(color='k', linewidth=0.25, **kwargs)

Create a render control ensemble with thin facet outlines.

This function returns a RenderControlFacetEnsemble instance configured to draw thin outlines of the facets without normal vectors or centroids.

Parameters:
  • color (str, optional) – Color for the outlines. By default, ‘k’ (black).

  • linewidth (float, optional) – Width of the outline line. By default, 0.25.

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFacetEnsemble.

Returns:

An instance of RenderControlFacetEnsemble configured for thin facet outlines.

Return type:

RenderControlFacetEnsemble

opencsp.common.lib.render_control.RenderControlFacetEnsemble.normal_facet_outlines(color='k', **kwargs)

Create a render control ensemble with normal facet outlines.

This function returns a RenderControlFacetEnsemble instance configured to draw normal facet outlines with specified styles.

Parameters:
  • color (str, optional) – Color for the outlines and normal vectors. By default, ‘k’ (black).

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFacetEnsemble.

Returns:

An instance of RenderControlFacetEnsemble configured for normal facet outlines.

Return type:

RenderControlFacetEnsemble

opencsp.common.lib.render_control.RenderControlFacetEnsemble.normal_only(color='k', normal_vector_length=4.0, **kwargs)

Create a render control ensemble that displays only the normal vectors of facets.

This function returns a RenderControlFacetEnsemble instance configured to draw only the normal vectors without any outlines or centroids.

Parameters:
  • color (str, optional) – Color for the normal vectors. By default, ‘k’ (black).

  • normal_vector_length (float, optional) – Length of the normal vectors. By default, 4.0.

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFacetEnsemble.

Returns:

An instance of RenderControlFacetEnsemble configured to display only the normal vectors.

Return type:

RenderControlFacetEnsemble

opencsp.common.lib.render_control.RenderControlFacetEnsemble.only_outline(color='k')

Create a render control ensemble that displays only the outline of facets.

This function returns a RenderControlFacetEnsemble instance configured to draw only the outlines of the facets without any other visual elements.

Parameters:

color (str, optional) – Color for the outlines. By default, ‘k’ (black).

Returns:

An instance of RenderControlFacetEnsemble configured to display only the outlines.

Return type:

RenderControlFacetEnsemble

Ensemble

class opencsp.common.lib.render_control.RenderControlEnsemble.RenderControlEnsemble(default_style)

Bases: object

Render control for collections of named objects.

Provides a default render control, with exceptions for objects with specific names.

Multiple classes of exceptions can be defined, each with its own specialized render style.

Render styles may be of arbitrary type: RenderControlFacet, RenderControlHeliostat, etc.

__init__(default_style)
add_special_name(input_name: str | float, style: any)

Adds a special name to the render control ensemble. This style can then be retrieved with style().

Parameters:
  • input_name (str | float) – The name to add to the ensemble.

  • style (any) – The style associated with the name.

add_special_names(input_names: Iterable[str | float], style: any)

Adds special names to the render control ensemble.

This method is similar to add_special_name(). It differs in that the same style is added once for each input name.

Parameters:
  • input_names (Iterable[str | float]) – The names to add to the ensemble.

  • style (any) – The style associated with the names.

style(input_name: str | float)

Gets the style for the given name.

Parameters:

input_name (str | float) – The name to get the style for.

Returns:

style – The style associated with the name, or the default style if no special style is defined.

Return type:

any

Heliostats

class opencsp.common.lib.render_control.RenderControlEvaluateHeliostats3d.RenderControlEvaluateHeliostats3d(clear_previous=True, draw_evaluate_heliostats_3d=True, evaluate_heliostats_3d_points_marker='o', evaluate_heliostats_3d_points_markersize=1.5, evaluate_heliostats_3d_points_color='m', evaluate_heliostats_3d_label_horizontalalignment='center', evaluate_heliostats_3d_label_verticalalignment='center', evaluate_heliostats_3d_label_fontsize=6, evaluate_heliostats_3d_label_fontstyle='normal', evaluate_heliostats_3d_label_fontweight='bold', evaluate_heliostats_3d_label_color='m', evaluate_heliostats_3d_dpi=200, evaluate_heliostats_3d_crop=True)

Bases: object

Render control for the UFACET pipeline step EvaluateHeliostats3d.

__init__(clear_previous=True, draw_evaluate_heliostats_3d=True, evaluate_heliostats_3d_points_marker='o', evaluate_heliostats_3d_points_markersize=1.5, evaluate_heliostats_3d_points_color='m', evaluate_heliostats_3d_label_horizontalalignment='center', evaluate_heliostats_3d_label_verticalalignment='center', evaluate_heliostats_3d_label_fontsize=6, evaluate_heliostats_3d_label_fontstyle='normal', evaluate_heliostats_3d_label_fontweight='bold', evaluate_heliostats_3d_label_color='m', evaluate_heliostats_3d_dpi=200, evaluate_heliostats_3d_crop=True)

Render control for the UFACET pipeline step EvaluateHeliostats3d.

This class manages the rendering settings for the EvaluateHeliostats3d step in the UFACET pipeline, allowing customization of various visual elements related to heliostat evaluation.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_evaluate_heliostats_3d (bool, optional) – Whether to draw the video track figures. By default, True.

  • evaluate_heliostats_3d_points_marker (str, optional) – Marker style for video track points. By default, ‘o’.

  • evaluate_heliostats_3d_points_markersize (float, optional) – Size of the marker for video track points. By default, 1.5.

  • evaluate_heliostats_3d_points_color (str, optional) – Color for video track points. By default, ‘m’ (magenta).

  • evaluate_heliostats_3d_label_horizontalalignment (str, optional) – Horizontal alignment for heliostat labels. By default, ‘center’.

  • evaluate_heliostats_3d_label_verticalalignment (str, optional) – Vertical alignment for heliostat labels. By default, ‘center’.

  • evaluate_heliostats_3d_label_fontsize (int, optional) – Font size for heliostat labels. By default, 6.

  • evaluate_heliostats_3d_label_fontstyle (str, optional) – Font style for heliostat labels. By default, ‘normal’.

  • evaluate_heliostats_3d_label_fontweight (str, optional) – Font weight for heliostat labels. By default, ‘bold’.

  • evaluate_heliostats_3d_label_color (str, optional) – Color for heliostat labels. By default, ‘m’ (magenta).

  • evaluate_heliostats_3d_dpi (int, optional) – DPI for saving figures to disk. By default, 200.

  • evaluate_heliostats_3d_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, True.

opencsp.common.lib.render_control.RenderControlEvaluateHeliostats3d.default(color='m')

Create a default render control for evaluating heliostats in 3D.

This function returns a RenderControlEvaluateHeliostats3d instance with default settings, using the specified color for the points and labels.

Parameters:

color (str, optional) – Color for the video track points and heliostat labels. By default, ‘m’ (magenta).

Returns:

An instance of RenderControlEvaluateHeliostats3d configured with default parameters.

Return type:

RenderControlEvaluateHeliostats3d

opencsp.common.lib.render_control.RenderControlEvaluateHeliostats3d.fast()

Create a fast render control for evaluating heliostats in 3D.

This function returns a RenderControlEvaluateHeliostats3d instance configured to skip drawing the video track figures, which can speed up the rendering process.

Returns:

An instance of RenderControlEvaluateHeliostats3d configured for fast rendering.

Return type:

RenderControlEvaluateHeliostats3d

class opencsp.common.lib.render_control.RenderControlHeliostat.RenderControlHeliostat(draw_centroid=False, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_facet_ensemble=True, facet_ensemble_style=<opencsp.common.lib.render_control.RenderControlFacetEnsemble.RenderControlFacetEnsemble object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, post=0)

Bases: object

Render control for heliostats.

__init__(draw_centroid=False, centroid_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, draw_facet_ensemble=True, facet_ensemble_style=<opencsp.common.lib.render_control.RenderControlFacetEnsemble.RenderControlFacetEnsemble object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, post=0)

Render control for heliostats.

This class manages the rendering settings for heliostats, allowing customization of various visual elements such as centroids, facet ensembles, and names.

Parameters:
  • draw_centroid (bool, optional) – Whether to draw the centroid of the heliostat. By default, False.

  • centroid_style (object, optional) – Style for the centroid marker. By default, rcps.marker().

  • draw_facet_ensemble (bool, optional) – Whether to draw the facet ensemble. By default, True.

  • facet_ensemble_style (object, optional) – Style for the facet ensemble. By default, rcfe.RenderControlFacetEnsemble(rcf.outline()).

  • draw_name (bool, optional) – Whether to draw the name of the heliostat. By default, False (unimplemented).

  • name_style (object, optional) – Style for the name text. By default, rctxt.default(color=’k’).

  • post (int, optional) – Identifier for the post associated with the heliostat. By default, 0 (no post).

opencsp.common.lib.render_control.RenderControlHeliostat.blank()

Create a blank render control for heliostats.

This function returns a RenderControlHeliostat instance with no visual elements drawn, suitable for cases where heliostats are added as special cases.

Returns:

An instance of RenderControlHeliostat with no visual elements.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.centroid(color='k')

Create a render control that displays only the centroid of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw only the centroid.

Parameters:

color (str, optional) – Color of the centroid marker. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display only the centroid.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.centroid_name(color='k')

Create a render control that displays both the centroid and the name of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw both the centroid and the name.

Parameters:

color (str, optional) – Color of the centroid marker. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display both the centroid and the name.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.centroid_name_outline(color='k', horizontalalignment='center', verticalalignment='center')

Create a render control that displays the centroid, name, and overall outline of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the centroid, the name, and the outline.

Parameters:
  • color (str, optional) – Color of the centroid marker and outline. By default, ‘k’ (black).

  • horizontalalignment (str, optional) – Horizontal alignment of the name text. By default, ‘center’.

  • verticalalignment (str, optional) – Vertical alignment of the name text. By default, ‘center’.

Returns:

An instance of RenderControlHeliostat configured to display the centroid, name, and outline.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.default()

Create a default render control for heliostats.

This function returns a RenderControlHeliostat instance with default settings.

Returns:

An instance of RenderControlHeliostat configured with default parameters.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.facet_outlines(color='k', **kwargs)

Create a render control that displays facet outlines only.

This function returns a RenderControlHeliostat instance configured to draw only the outlines of the facets.

Parameters:
  • color (str, optional) – Color of the facet outlines. By default, ‘k’ (black).

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlHeliostat.

Returns:

An instance of RenderControlHeliostat configured to display facet outlines only.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.facet_outlines_names(color='k')

Create a render control that displays facet outlines and facet name labels.

This function returns a RenderControlHeliostat instance configured to draw the outlines of the facets along with their corresponding names.

Parameters:

color (str, optional) – Color of the facet outlines and names. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display facet outlines and names.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.facet_outlines_normals(color='k')

Create a render control that displays facet outlines with normal vectors.

This function returns a RenderControlHeliostat instance configured to draw the outlines of the facets along with their normal vectors.

Parameters:

color (str, optional) – Color of the facet outlines and normal vectors. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display facet outlines with normal vectors.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.low_res_heliostat()

Create a low-resolution render control for heliostats.

This function returns a RenderControlHeliostat instance configured for low-resolution rendering of the heliostat, with specific styles for facets.

Returns:

An instance of RenderControlHeliostat configured for low-resolution rendering.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.mirror_surfaces(color='k', **kwargs)

Create a render control that displays the mirror surfaces of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the mirror surfaces.

Parameters:
  • color (str, optional) – Color of the mirror surfaces. By default, ‘k’ (black).

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlHeliostat.

Returns:

An instance of RenderControlHeliostat configured to display the mirror surfaces.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.name(color='k', fontsize='medium')

Create a render control that displays only the name of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the name of the heliostat.

Parameters:
  • color (str, optional) – Color of the name text. By default, ‘k’ (black).

  • fontsize (str, optional) – Font size of the name text. By default, ‘medium’.

Returns:

An instance of RenderControlHeliostat configured to display only the name.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.name_outline(color='k', horizontalalignment='center', verticalalignment='center')

Create a render control that displays the name and overall outline of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the name and the outline.

Parameters:
  • color (str, optional) – Color of the outline. By default, ‘k’ (black).

  • horizontalalignment (str, optional) – Horizontal alignment of the name text. By default, ‘center’.

  • verticalalignment (str, optional) – Vertical alignment of the name text. By default, ‘center’.

Returns:

An instance of RenderControlHeliostat configured to display the name and outline.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.normal(color='k', normal_vector_length=4)

Create a render control that displays the overall surface normal of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the surface normal.

Parameters:
  • color (str, optional) – Color of the surface normal. By default, ‘k’ (black).

  • normal_vector_length (float, optional) – Length of the surface normal. By default, 4.0.

Returns:

An instance of RenderControlHeliostat configured to display the surface normal.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.normal_facet_outlines(color='k')

Create a render control that displays normal facet outlines.

This function returns a RenderControlHeliostat instance configured to draw the outlines of the facets with normal vectors.

Parameters:

color (str, optional) – Color of the facet outlines. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display normal facet outlines.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.normal_facet_outlines_names(color='k')

Create a render control that displays facet outlines and facet name labels with normal vectors.

This function returns a RenderControlHeliostat instance configured to draw the outlines of the facets along with their corresponding names and normal vectors.

Parameters:

color (str, optional) – Color of the facet outlines and names. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display facet outlines, names, and normal vectors.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.normal_outline(color='k', normal_vector_length=4, **kwargs)

Create a render control that displays both the overall surface normal and the outline of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw the surface normal and the outline.

Parameters:
  • color (str, optional) – Color of the surface normal and outline. By default, ‘k’ (black).

  • normal_vector_length (float, optional) – Length of the surface normal. By default, 4.0.

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlHeliostat.

Returns:

An instance of RenderControlHeliostat configured to display the surface normal and outline.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlHeliostat.outline(color='k')

Create a render control that displays only the overall outline of the heliostat.

This function returns a RenderControlHeliostat instance configured to draw only the outline.

Parameters:

color (str, optional) – Color of the outline. By default, ‘k’ (black).

Returns:

An instance of RenderControlHeliostat configured to display only the outline.

Return type:

RenderControlHeliostat

class opencsp.common.lib.render_control.RenderControlHeliostatTracks.RenderControlHeliostatTracks(clear_previous=True, draw_heliostat_tracks=True, heliostat_tracks_points_marker='o', heliostat_tracks_points_markersize=1.5, heliostat_tracks_points_color='m', heliostat_tracks_label_horizontalalignment='center', heliostat_tracks_label_verticalalignment='center', heliostat_tracks_label_fontsize=6, heliostat_tracks_label_fontstyle='normal', heliostat_tracks_label_fontweight='bold', heliostat_tracks_label_color='m', heliostat_tracks_dpi=200, heliostat_tracks_crop=True)

Bases: object

Render control for the UFACET pipeline step HeliostatTracks.

__init__(clear_previous=True, draw_heliostat_tracks=True, heliostat_tracks_points_marker='o', heliostat_tracks_points_markersize=1.5, heliostat_tracks_points_color='m', heliostat_tracks_label_horizontalalignment='center', heliostat_tracks_label_verticalalignment='center', heliostat_tracks_label_fontsize=6, heliostat_tracks_label_fontstyle='normal', heliostat_tracks_label_fontweight='bold', heliostat_tracks_label_color='m', heliostat_tracks_dpi=200, heliostat_tracks_crop=True)

Render control for the UFACET pipeline step HeliostatTracks.

This class manages the rendering settings for the HeliostatTracks step in the UFACET pipeline, allowing customization of various visual elements related to heliostat tracks.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_heliostat_tracks (bool, optional) – Whether to draw the video track figures for heliostats. By default, True.

  • heliostat_tracks_points_marker (str, optional) – Marker style for the video track points. By default, ‘o’.

  • heliostat_tracks_points_markersize (float, optional) – Size of the marker for video track points. By default, 1.5.

  • heliostat_tracks_points_color (str, optional) – Color for the video track points. By default, ‘m’ (magenta).

  • heliostat_tracks_label_horizontalalignment (str, optional) – Horizontal alignment for the heliostat label. By default, ‘center’.

  • heliostat_tracks_label_verticalalignment (str, optional) – Vertical alignment for the heliostat label. By default, ‘center’.

  • heliostat_tracks_label_fontsize (int, optional) – Font size for the heliostat label. By default, 6.

  • heliostat_tracks_label_fontstyle (str, optional) – Font style for the heliostat label. By default, ‘normal’.

  • heliostat_tracks_label_fontweight (str, optional) – Font weight for the heliostat label. By default, ‘bold’.

  • heliostat_tracks_label_color (str, optional) – Color for the heliostat label. By default, ‘m’ (magenta).

  • heliostat_tracks_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • heliostat_tracks_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, True.

opencsp.common.lib.render_control.RenderControlHeliostatTracks.default(color='m')

Create a default render control for heliostat tracks.

This function returns a RenderControlHeliostatTracks instance with default settings, using the specified color for the points and labels.

Parameters:

color (str, optional) – Color for the video track points and heliostat labels. By default, ‘m’ (magenta).

Returns:

An instance of RenderControlHeliostatTracks configured with default parameters.

Return type:

RenderControlHeliostatTracks

opencsp.common.lib.render_control.RenderControlHeliostatTracks.fast()

Create a fast render control for heliostat tracks.

This function returns a RenderControlHeliostatTracks instance configured to skip drawing the heliostat tracks, which can speed up the rendering process.

Returns:

An instance of RenderControlHeliostatTracks configured for fast rendering.

Return type:

RenderControlHeliostatTracks

class opencsp.common.lib.render_control.RenderControlHeliostats3d.RenderControlHeliostats3d(clear_previous=True, draw_heliostats_3d=True, heliostats_3d_points_marker='o', heliostats_3d_points_markersize=1.5, heliostats_3d_points_color='m', heliostats_3d_label_horizontalalignment='center', heliostats_3d_label_verticalalignment='center', heliostats_3d_label_fontsize=6, heliostats_3d_label_fontstyle='normal', heliostats_3d_label_fontweight='bold', heliostats_3d_label_color='m', heliostats_3d_dpi=200, heliostats_3d_crop=True)

Bases: object

Render control for the UFACET pipeline step Heliostats3d.

__init__(clear_previous=True, draw_heliostats_3d=True, heliostats_3d_points_marker='o', heliostats_3d_points_markersize=1.5, heliostats_3d_points_color='m', heliostats_3d_label_horizontalalignment='center', heliostats_3d_label_verticalalignment='center', heliostats_3d_label_fontsize=6, heliostats_3d_label_fontstyle='normal', heliostats_3d_label_fontweight='bold', heliostats_3d_label_color='m', heliostats_3d_dpi=200, heliostats_3d_crop=True)

Render control for the UFACET pipeline step Heliostats3d.

This class manages the rendering settings for the Heliostats3d step in the UFACET pipeline, allowing customization of various visual elements related to 3D heliostat tracks.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_heliostats_3d (bool, optional) – Whether to draw the 3D video track figures for heliostats. By default, True.

  • heliostats_3d_points_marker (str, optional) – Marker style for the 3D video track points. By default, ‘o’.

  • heliostats_3d_points_markersize (float, optional) – Size of the marker for 3D video track points. By default, 1.5.

  • heliostats_3d_points_color (str, optional) – Color for the 3D video track points. By default, ‘m’ (magenta).

  • heliostats_3d_label_horizontalalignment (str, optional) – Horizontal alignment for the heliostat label. By default, ‘center’.

  • heliostats_3d_label_verticalalignment (str, optional) – Vertical alignment for the heliostat label. By default, ‘center’.

  • heliostats_3d_label_fontsize (int, optional) – Font size for the heliostat label. By default, 6.

  • heliostats_3d_label_fontstyle (str, optional) – Font style for the heliostat label. By default, ‘normal’.

  • heliostats_3d_label_fontweight (str, optional) – Font weight for the heliostat label. By default, ‘bold’.

  • heliostats_3d_label_color (str, optional) – Color for the heliostat label. By default, ‘m’ (magenta).

  • heliostats_3d_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • heliostats_3d_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, True.

opencsp.common.lib.render_control.RenderControlHeliostats3d.default(color='m')

Create a default render control for 3D heliostats.

This function returns a RenderControlHeliostats3d instance with default settings, using the specified color for the points and labels.

Parameters:

color (str, optional) – Color for the 3D video track points and heliostat labels. By default, ‘m’ (magenta).

Returns:

An instance of RenderControlHeliostats3d configured with default parameters.

Return type:

RenderControlHeliostats3d

opencsp.common.lib.render_control.RenderControlHeliostats3d.fast()

Create a fast render control for 3D heliostats.

This function returns a RenderControlHeliostats3d instance configured to skip drawing the 3D heliostat tracks, which can speed up the rendering process.

Returns:

An instance of RenderControlHeliostats3d configured for fast rendering.

Return type:

RenderControlHeliostats3d

LightPath

class opencsp.common.lib.render_control.RenderControlLightPath.RenderControlLightPath(init_length: float = 1, current_length: float = 1, end_at_plane: tuple[~opencsp.common.lib.geometry.Pxyz.Pxyz, ~opencsp.common.lib.geometry.Uxyz.Uxyz] | None = None, line_render_control: float = <opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>)

Bases: object

Render control for visualizing light paths.

This class manages the rendering settings for light paths, allowing customization of various parameters related to the light path’s length and rendering.

__init__(init_length: float = 1, current_length: float = 1, end_at_plane: tuple[~opencsp.common.lib.geometry.Pxyz.Pxyz, ~opencsp.common.lib.geometry.Uxyz.Uxyz] | None = None, line_render_control: float = <opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>) None

Render control for visualizing light paths.

This class manages the rendering settings for light paths, allowing customization of various parameters related to the light path’s length and rendering.

Parameters:
  • init_length (float, optional) – The initial length of the light path. By default, 1.0.

  • current_length (float, optional) – The current length of the light path. By default, 1.0.

  • end_at_plane (tuple[Pxyz, Uxyz], optional) – A tuple containing the position (Pxyz) and orientation (Uxyz) of the plane where the light path ends. By default, None.

  • line_render_control (RenderControlPointSeq, optional) – Control settings for rendering the light path line. By default, rcps.thin().

opencsp.common.lib.render_control.RenderControlLightPath.default_path() RenderControlLightPath

Create a default render control for light paths.

This function returns a RenderControlLightPath instance with default settings.

Returns:

An instance of RenderControlLightPath configured with default parameters.

Return type:

RenderControlLightPath

opencsp.common.lib.render_control.RenderControlLightPath.end_at_plane(plane: tuple[Pxyz, Uxyz])

Create a render control for a light path that ends at a specified plane.

This function returns a RenderControlLightPath instance configured to end at the specified plane.

Parameters:

plane (tuple[Pxyz, Uxyz]) – A tuple containing the position (Pxyz) and orientation (Uxyz) of the plane where the light path ends.

Returns:

An instance of RenderControlLightPath configured to end at the specified plane.

Return type:

RenderControlLightPath

Trajectory Analysis

class opencsp.common.lib.render_control.RenderControlTrajectoryAnalysis.RenderControlTrajectoryAnalysis(clear_previous=True, draw_heliostats_3d=True, heliostats_3d_points_marker='o', heliostats_3d_points_markersize=1.5, heliostats_3d_points_color='m', heliostats_3d_label_horizontalalignment='center', heliostats_3d_label_verticalalignment='center', heliostats_3d_label_fontsize=6, heliostats_3d_label_fontstyle='normal', heliostats_3d_label_fontweight='bold', heliostats_3d_label_color='m', heliostats_3d_dpi=200, heliostats_3d_crop=True)

Bases: object

Render control for the UFACET pipeline step TrajectoryAnalysis.

This class manages the rendering settings for the TrajectoryAnalysis step in the UFACET pipeline,

allowing customization of various visual elements related to the 3D trajectories of heliostats.

__init__(clear_previous=True, draw_heliostats_3d=True, heliostats_3d_points_marker='o', heliostats_3d_points_markersize=1.5, heliostats_3d_points_color='m', heliostats_3d_label_horizontalalignment='center', heliostats_3d_label_verticalalignment='center', heliostats_3d_label_fontsize=6, heliostats_3d_label_fontstyle='normal', heliostats_3d_label_fontweight='bold', heliostats_3d_label_color='m', heliostats_3d_dpi=200, heliostats_3d_crop=True)

Render control for the UFACET pipeline step TrajectoryAnalysis.

This class manages the rendering settings for the TrajectoryAnalysis step in the UFACET pipeline, allowing customization of various visual elements related to the 3D trajectories of heliostats.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_heliostats_3d (bool, optional) – Whether to draw the 3D video track figures for heliostats. By default, True.

  • heliostats_3d_points_marker (str, optional) – Marker style for the 3D video track points. By default, ‘o’.

  • heliostats_3d_points_markersize (float, optional) – Size of the marker for 3D video track points. By default, 1.5.

  • heliostats_3d_points_color (str, optional) – Color for the 3D video track points. By default, ‘m’ (magenta).

  • heliostats_3d_label_horizontalalignment (str, optional) – Horizontal alignment for the heliostat label. By default, ‘center’.

  • heliostats_3d_label_verticalalignment (str, optional) – Vertical alignment for the heliostat label. By default, ‘center’.

  • heliostats_3d_label_fontsize (int, optional) – Font size for the heliostat label. By default, 6.

  • heliostats_3d_label_fontstyle (str, optional) – Font style for the heliostat label. By default, ‘normal’.

  • heliostats_3d_label_fontweight (str, optional) – Font weight for the heliostat label. By default, ‘bold’.

  • heliostats_3d_label_color (str, optional) – Color for the heliostat label. By default, ‘m’ (magenta).

  • heliostats_3d_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • heliostats_3d_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, True.

opencsp.common.lib.render_control.RenderControlTrajectoryAnalysis.default(color='m')

Create a default render control for trajectory analysis.

This function returns a RenderControlTrajectoryAnalysis instance with default settings, using the specified color for the points and labels.

Parameters:

color (str, optional) – Color for the 3D video track points and heliostat labels. By default, ‘m’ (magenta).

Returns:

An instance of RenderControlTrajectoryAnalysis configured with default parameters.

Return type:

RenderControlTrajectoryAnalysis

opencsp.common.lib.render_control.RenderControlTrajectoryAnalysis.fast()

Create a fast render control for trajectory analysis.

This function returns a RenderControlTrajectoryAnalysis instance configured to skip drawing the 3D heliostat tracks, which can speed up the rendering process.

Returns:

An instance of RenderControlTrajectoryAnalysis configured for fast rendering.

Return type:

RenderControlTrajectoryAnalysis

Mirror

class opencsp.common.lib.render_control.RenderControlMirror.RenderControlMirror(centroid: bool = False, surface_normals: bool = False, resolution: ~opencsp.common.lib.geometry.Resolution.Resolution | None = None, norm_len: float = 1, norm_res: int = 5, norm_base_style: ~opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq = <opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_style: ~opencsp.common.lib.render_control.RenderControlSurface.RenderControlSurface = <opencsp.common.lib.render_control.RenderControlSurface.RenderControlSurface object>, point_styles: ~opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq | None = None, number_of_edge_points: int = 20)

Bases: object

A class for controlling the rendering of a mirror in a graphical environment.

This class allows for the configuration of various visual aspects of a mirror, including its centroid, surface normals, resolution, and styles for rendering.

__init__(centroid: bool = False, surface_normals: bool = False, resolution: ~opencsp.common.lib.geometry.Resolution.Resolution | None = None, norm_len: float = 1, norm_res: int = 5, norm_base_style: ~opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq = <opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, surface_style: ~opencsp.common.lib.render_control.RenderControlSurface.RenderControlSurface = <opencsp.common.lib.render_control.RenderControlSurface.RenderControlSurface object>, point_styles: ~opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq | None = None, number_of_edge_points: int = 20) None

Initializes a RenderControlMirror object with the specified parameters.

Parameters:
  • centroid (bool, optional) – If True, renders the centroid of the mirror (default is False).

  • surface_normals (bool, optional) – If True, renders the surface normals of the mirror (default is False).

  • resolution (Resolution, optional) – The resolution of the rendering, specified as a Resolution object (default is None).

  • norm_len (float, optional) – The length of the normals to be rendered (default is 1).

  • norm_res (int, optional) – The resolution of the normals (default is 5).

  • norm_base_style (RenderControlPointSeq, optional) – The style for rendering the normals (default is a marker with size 2).

  • surface_style (RenderControlSurface, optional) – The style for rendering the surface of the mirror (default is a new RenderControlSurface object).

  • point_styles (RenderControlPointSeq, optional) – The styles for rendering points on the mirror (default is None, which sets it to a marker with size 2).

  • number_of_edge_points (int, optional) – The number of edge points to be rendered (default is 20).

opencsp.common.lib.render_control.RenderControlMirror.low_res_mirror()

Creates a RenderControlMirror object with low resolution.

Returns:

A RenderControlMirror object initialized with a resolution of 5 pixels in the x direction.

Return type:

RenderControlMirror

opencsp.common.lib.render_control.RenderControlMirror.normal_mirror()

Creates a default RenderControlMirror object with standard settings.

Returns:

A RenderControlMirror object initialized with default parameters.

Return type:

RenderControlMirror

Ray Trace

class opencsp.common.lib.render_control.RenderControlRayTrace.RenderControlRayTrace(light_path_control=<opencsp.common.lib.render_control.RenderControlLightPath.RenderControlLightPath object>)

Bases: object

A class for controlling the rendering of ray traces in a graphical environment.

This class manages the rendering settings for light paths during ray tracing.

Parameters:

light_path_control (RenderControlLightPath, optional) – The control settings for rendering light paths (default is the default light path control).

__init__(light_path_control=<opencsp.common.lib.render_control.RenderControlLightPath.RenderControlLightPath object>) None
opencsp.common.lib.render_control.RenderControlRayTrace.init_current_lengths(init_len=1, current_len=1, line_render: float = <opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>)

Initializes a RenderControlRayTrace object with specified initial and current lengths for light paths.

This function creates a RenderControlRayTrace object with a RenderControlLightPath configured with the provided initial and current lengths.

Parameters:
  • init_len (float, optional) – The initial length of the light paths (default is 1).

  • current_len (float, optional) – The current length of the light paths (default is 1).

Returns:

A RenderControlRayTrace object initialized with the specified lengths.

Return type:

RenderControlRayTrace

Solar Field

class opencsp.common.lib.render_control.RenderControlSolarField.RenderControlSolarField(draw_origin=False, draw_heliostats=True, heliostat_styles=<opencsp.common.lib.render_control.RenderControlHeliostat.RenderControlHeliostat object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, special_styles: dict[str, ~opencsp.common.lib.render_control.RenderControlHeliostat.RenderControlHeliostat] | None = None)

Bases: object

Render control for solar fields.

This class manages the rendering settings for solar fields, allowing customization of various visual elements related to heliostats and their configurations.

__init__(draw_origin=False, draw_heliostats=True, heliostat_styles=<opencsp.common.lib.render_control.RenderControlHeliostat.RenderControlHeliostat object>, draw_name=False, name_style=<opencsp.common.lib.render_control.RenderControlText.RenderControlText object>, special_styles: dict[str, ~opencsp.common.lib.render_control.RenderControlHeliostat.RenderControlHeliostat] | None = None)

Render control for solar fields.

This class manages the rendering settings for solar fields, allowing customization of various visual elements related to heliostats and their configurations.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_origin (bool, optional) – Whether to draw the origin point of the solar field. By default, False.

  • draw_heliostats (bool, optional) – Whether to draw the heliostats in the solar field. By default, True.

  • heliostat_styles (RenderControlHeliostat, optional) – Styles for rendering the heliostats. By default, an instance of RenderControlHeliostat().

  • draw_name (bool, optional) – Whether to draw the names of the heliostats. By default, False (unimplemented).

  • name_style (RenderControlText, optional) – Style for the names of the heliostats. By default, rctxt.default(color=’k’).

  • special_styles (dict[str, RenderControlHeliostat], optional) – A dictionary mapping heliostat names to their specialized rendering styles. By default, None.

add_special_names(heliostat_names: str | list, heliostat_style: RenderControlHeliostat)

Adds special names to the solar field render control, for rendering individual heliostats with their own styles.

The same style is registered independently for each of the named heliostats.

Parameters:
  • heliostat_names (str | list) – The names to add to the solar field render control.

  • heliostat_style (RenderControlHeliostat) – The style associated with the names.

get_special_style(heliostat_name: str)

Gets the special style for the given heliostat name.

Parameters:

heliostat_name (str) – The name of the heliostat.

Returns:

style – The special style associated with the heliostat name, or the default style if no special style is defined.

Return type:

RenderControlHeliostat

opencsp.common.lib.render_control.RenderControlSolarField.default()

Create a default render control for solar fields.

This function returns a RenderControlSolarField instance with default settings.

Returns:

An instance of RenderControlSolarField configured with default parameters.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_blanks(color='k')

Create a render control that draws nothing for heliostats.

This function returns a RenderControlSolarField instance configured to not draw any heliostats, allowing for special rendering categories to be added later.

Parameters:

color (str, optional) – Color for the heliostat outlines. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField with no heliostats drawn.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_centroids(color='k')

Create a render control that displays the centroids of the heliostats.

This function returns a RenderControlSolarField instance configured to draw the centroids of the heliostats.

Parameters:

color (str, optional) – Color for the centroid markers. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display heliostat centroids.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_centroids_names(color='k')

Create a render control that displays both the centroids and names of the heliostats.

This function returns a RenderControlSolarField instance configured to draw the centroids and names of the heliostats.

Parameters:

color (str, optional) – Color for the centroid markers and names. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display both centroids and names.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_centroids_outlines_names(color='k', horizontalalignment='center', verticalalignment='center')

Create a render control that displays heliostat centroids, outlines, and names.

This function returns a RenderControlSolarField instance configured to draw the centroids, outlines, and names of the heliostats.

Parameters:
  • color (str, optional) – Color for the centroid markers and outlines. By default, ‘k’ (black).

  • horizontalalignment (str, optional) – Horizontal alignment of the name text. By default, ‘center’.

  • verticalalignment (str, optional) – Vertical alignment of the name text. By default, ‘center’.

Returns:

An instance of RenderControlSolarField configured to display centroids, outlines, and names.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_names(color='k')

Create a render control that displays the names of the heliostats.

This function returns a RenderControlSolarField instance configured to draw the heliostats with their corresponding names.

Parameters:

color (str, optional) – Color for the heliostat names. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display heliostat names.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_normals_outlines(color='k')

Create a render control that displays heliostat outlines with normal vectors.

This function returns a RenderControlSolarField instance configured to draw the outlines of the heliostats along with their normal vectors.

Parameters:

color (str, optional) – Color for the heliostat outlines and normal vectors. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display heliostat outlines with normals.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_outlines(color='k')

Create a render control that displays outlines of the heliostats.

This function returns a RenderControlSolarField instance configured to draw the outlines of the heliostats.

Parameters:

color (str, optional) – Color for the heliostat outlines. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display heliostat outlines.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_outlines_names(color='k')

Create a render control that displays heliostat outlines and names.

This function returns a RenderControlSolarField instance configured to draw the outlines of the heliostats along with their corresponding names.

Parameters:

color (str, optional) – Color for the heliostat outlines and names. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display heliostat outlines and names.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_vector_field(color='k', vector_length=9)

Create a render control that displays a vector field for heliostats.

This function returns a RenderControlSolarField instance configured to draw the heliostats with normal vectors representing their orientations.

Parameters:
  • color (str, optional) – Color for the vector field. By default, ‘k’ (black).

  • vector_length (float, optional) – Length of the vectors. By default, 9.

Returns:

An instance of RenderControlSolarField configured to display a vector field for heliostats.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.heliostat_vector_field_outlines(color='k', vector_length=9)

Create a render control that displays a vector field with outlines for heliostats.

This function returns a RenderControlSolarField instance configured to draw the heliostats with outlines and normal vectors representing their orientations.

Parameters:
  • color (str, optional) – Color for the outlines and vectors. By default, ‘k’ (black).

  • vector_length (float, optional) – Length of the vectors. By default, 9.

Returns:

An instance of RenderControlSolarField configured to display a vector field with outlines.

Return type:

RenderControlSolarField

opencsp.common.lib.render_control.RenderControlSolarField.outline(color='k')

Create a render control that displays only the overall outline of the solar field.

This function returns a RenderControlSolarField instance configured to draw only the outline.

Parameters:

color (str, optional) – Color for the outline. By default, ‘k’ (black).

Returns:

An instance of RenderControlSolarField configured to display only the outline.

Return type:

RenderControlSolarField

Surface

class opencsp.common.lib.render_control.RenderControlSurface.RenderControlSurface(draw_title=True, color: str | Color | None = 'silver', color_map: str | Colormap | None = None, alpha: float = 0.25, edgecolor='black', linewidth=0.05, contour: None | bool | str = True, contour_color_map: str | None = None)

Bases: object

Render control information for how to style surface plots (see View3d function plot_surface and plot_trisurface).

__init__(draw_title=True, color: str | Color | None = 'silver', color_map: str | Colormap | None = None, alpha: float = 0.25, edgecolor='black', linewidth=0.05, contour: None | bool | str = True, contour_color_map: str | None = None) None

Render control information for how to style surface plots (see View3d function plot_surface and plot_trisurface).

Parameters:
  • draw_title (bool, optional) – If True then the title will be drawn on graph, default is True

  • color (str | Color | None, optional) – The color of the plot if not using a color map. For example color.plot_colors.blue. By default “silver”.

  • color_map (str | Colormap None, optional) – The color map of the plot to help discern different plot values. See https://matplotlib.org/stable/gallery/color/colormap_reference.html for common options. By default None.

  • alpha (float, optional) – The opacity of the plot between 0 (fully transparent) and 1 (fully opaque), by default 0.25

  • edgecolor (str, optional) – The color to use for the lines between the faces, default is ‘black’

  • linewidth (float, optional) – The width of the edge lines between the faces in points, default is 0.3

  • contour (None | bool | str, optional) – If False or None, then don’t include a contour plot alongside the 3d plot. If True, then draw a 2D contour plot below the 3D surface plot (on z-axis). If a string, can be any combination of ‘x’, ‘y’, and ‘z’. Default is True.

  • contour_color_map (str, optional) – If set, then this determines the color map for the contour. If None, then use the same color map for the contour as for the surface. If None and the color_map argument is also None, then we should create a custom color map based on the given color. Default is None.

property color: tuple[float, float, float, float] | None

Tower

class opencsp.common.lib.render_control.RenderControlTower.RenderControlTower(centroid=False, draw_name=False, name_style=None, draw_outline=True, point_styles: RenderControlPointSeq | None = None, wire_frame: RenderControlPointSeq | None = None, target: RenderControlPointSeq | None = None, bcs: RenderControlPointSeq | None = None, g3p3: RenderControlPointSeq | None = None)

Bases: object

Render control for towers.

This class manages the rendering settings for towers, allowing customization of various visual elements related to the tower’s representation.

__init__(centroid=False, draw_name=False, name_style=None, draw_outline=True, point_styles: RenderControlPointSeq | None = None, wire_frame: RenderControlPointSeq | None = None, target: RenderControlPointSeq | None = None, bcs: RenderControlPointSeq | None = None, g3p3: RenderControlPointSeq | None = None) None

Render control for towers.

This class manages the rendering settings for towers, allowing customization of various visual elements related to the tower’s representation.

Parameters:
  • centroid (bool, optional) – If True, the centroid will be drawn on the graph as the origin of the tower. Default is False.

  • draw_name (bool, optional) – If True, the name of the tower will be drawn on the graph. Default is False.

  • name_style (None | str, optional) – If draw_name is True, styles the name using RenderControlText. By default, it uses the default style from RenderControlText, with color ‘black’.

  • draw_outline (bool, optional) – If True, draws the outline of the tower using the wire frame style. Default is True.

  • point_styles (RenderControlPointSeq, optional) – Styles for drawing the target as a point on the tower. Default is None.

  • wire_frame (RenderControlPointSeq, optional) – Outline style of the tower that draws the walls and edges. Default is RenderControlPointSeq outline with color ‘black’ and linewidth ‘1’.

  • target (RenderControlPointSeq, optional) – If provided, draws a point on the tower. Default is a red ‘x’ marker with a size of 6.

style(any)

“style” is a method commonly used by RenderControlEnsemble. We add this method here so that RenderControlHeliostat can be used similarly to RenderControlEnsemble.

opencsp.common.lib.render_control.RenderControlTower.no_bcs()

Create a render control for a tower outline without boundary control points (BCS).

This function returns a RenderControlTower instance configured to draw the tower outline without any boundary control points.

Returns:

An instance of RenderControlTower configured to display the tower outline without boundary control points.

Return type:

RenderControlTower

opencsp.common.lib.render_control.RenderControlTower.no_target()

Create a render control for a tower outline without a target.

This function returns a RenderControlTower instance configured to draw the tower outline without any target point.

Returns:

An instance of RenderControlTower configured to display the tower outline without a target.

Return type:

RenderControlTower

opencsp.common.lib.render_control.RenderControlTower.normal_tower()

Create a render control for a normal tower.

This function returns a RenderControlTower instance configured to display the overall outline of the tower.

Returns:

An instance of RenderControlTower configured for a normal tower outline.

Return type:

RenderControlTower

Figure

class opencsp.common.lib.render_control.RenderControlFigure.RenderControlFigure(tile=True, tile_array: tuple[int, int] | None = (3, 2), tile_square=False, num_figures: int | None = None, figsize=(6.4, 4.8), upper_left_xy=None, grid=True, draw_whitespace_padding=True, maximize=False)

Bases: object

Render control for figures.

__init__(tile=True, tile_array: tuple[int, int] | None = (3, 2), tile_square=False, num_figures: int | None = None, figsize=(6.4, 4.8), upper_left_xy=None, grid=True, draw_whitespace_padding=True, maximize=False)

Set of controls for how to render figures.

Example:

plt.close('all')
fm.reset_figure_management()
figure_control = rcfg.RenderControlFigure()
axis_control = rca.RenderControlAxis(x_label='Time (s)', y_label='Collected Energy (W)')
view_spec_2d = vs.view_spec_xy()

fig_record = fm.setup_figure_for_3d_data(figure_control, axis_control, view_spec_2d, name="energy_over_time", code_tag=f"{__file__}.main()")
style = rcps.RenderControlPointSeq(color=None, marker=None)
view = fig_record.view

view.draw_pq_list(energy_values, style=style)
view.show(block=True)

Params:

tilebool, optional

True => Lay out figures in grid. False => Place at upper_left or default screen center. If True, then figsize, upper_left_xy, and maximize are ignored. Default True

tile_arraytuple[int] | None, optional

How many tiles across and down (n_x, n_y). If None then the tiling pattern is guessed based on num_figures. Default (3, 2)

tile_squarebool, optional

Set to True for equal-axis 3d plots. Default False

figsizetuple[float], optional

Size of the figure in inches. Ignored if tile is True. Default (6.4, 4.8)

upper_left_xytuple[int], optional

Pixel placement for the first tile. (0,0) –> Upper left corner of screen. Ignored if tile is True. Default None

gridbool, optional

Whether or not to draw grid lines. Note: this value seems to be inverted. Default True

draw_whitespace_paddingbool, optional

If False then don’t pad the figure with whitespace. Default True

maximizebool, optional

Whether the figure should be maximized (made full screen) as soon as it is made visible. Ignored if tile is True. Default False.

static full_screen_inches(remove_taskbar=True) tuple[float, float]

Returns the number of inches (width and height) necessary to show a graph fullscreen.

static num_tiles_4x3aspect(num_figures: int)

Calculates the number of rows and colums to evenly spread the given number of tiles in a 4x3 aspect ratio. It is assumed that the tiles are square.

It is guaranteed that rows * cols >= num_figures. There might be more spaces in the grid than figures to fill it.

Parameters:

num_figures (int) – The number of figures/tiles to be presented in rows x columns grid.

Returns:

rows_cols – The number of rows and columns in a 4x3 aspect ratio.

Return type:

tuple[int, int]

static pixel_resolution_inches(width: int, height: int) tuple[float, float]

Returns the number of inches (width and height) necessary to show the given pixel dimensions.

FigureRecord

class opencsp.common.lib.render_control.RenderControlFigureRecord.RenderControlFigureRecord(name: str, title: str, caption: str, figure_num: int, figure: Figure, axis_control=None)

Bases: object

Tracks figures that have been generated.

This class manages the registration and saving of Matplotlib figures, including their metadata, comments, and other relevant information.

__init__(name: str, title: str, caption: str, figure_num: int, figure: Figure, axis_control=None)

Register for a render figure.

This constructor initializes a RenderControlFigureRecord instance with the provided parameters.

Parameters:
  • name (str) – Figure handle and title of figure window.

  • title (str) – Title of the plot.

  • caption (str) – Caption for the plot.

  • figure_num (int) – Number of this figure in the generated sequence. A unique key.

  • figure (Figure) – Matplotlib figure object.

  • axis_control (RenderControlAxis, optional) – Axis control instance used in figure_management.setup_figure. Default is None.

add_comment_line(comment_line: str) None

Add a comment line to the figure record.

Parameters:

comment_line (str) – The comment line to add.

add_metadata_line(metadata_line: str) None

Add a metadata line to the figure record.

Parameters:

metadata_line (str) – The metadata line to add.

clear()

Clears the old plot data without deleting the window, listeners, or orientation.

This method is useful for updating a plot interactively.

close()

Closes any matplotlib window opened with this instance’s view

static figure_to_array(figure: Figure)

Convert a Matplotlib figure to a NumPy array.

This method forces Matplotlib to render to its internal buffer and converts the buffer to a NumPy array.

Parameters:

figure (Figure) – The Matplotlib figure to convert.

Returns:

A NumPy array representation of the figure.

Return type:

np.ndarray

print_comments()

Prints all comments associated with this figure record.

save(output_dir: str, output_file_body: str | None = None, format: str | None = None, dpi=600, close_after_save: bool = True, include_view_suffix: bool = True, include_limit_suffix: bool = True)

Saves this figure record to an image file.

Parameters:
  • output_dir (str) – The directory to save to.

  • output_file_body (str, optional) – Name of the file to save to. None for self.name. Defaults to None.

  • format (str, optional) – The file format to save with. None for “svg”. Defaults to None.

  • dpi (int, optional) – Dots per inch used to format the figure. Defaults to 600.

  • close_after_save (bool, optional) – If True, closes the plot after saving. Defaults to True.

  • include_view_suffix (bool, optional) – If True, adds view type (xy, 3-d, etc) to filename. Defaults to True.

  • include_limit_suffix (bool, optional) – If True, adds plot limits to filename. Defaults to True.

Returns:

A tuple containing: - str: The path to the saved image file. - str: The path to the saved text file containing metadata and comments.

Return type:

tuple

to_array(size: tuple[float, float] | float | None = None) ndarray

Renders this figure to a new numpy array at the given size. The visualization figure (and thus the matplotlib window) will be temporarily resized in order to accomodate this.

It is suggested to use a default default standard size of 8 inches so that all sized elements of a style (markersize, linewidth, markeredgewidth) are consistently sized in our rendered images.

Parameters:

size (tuple[float, float] | float, optional) – The height of the image to be returned, or the (x,y) dimensions of the image to be returned, in inches. None to not adjust the figure size. Default is None.

Returns:

rendered_image – The rendered result as a numpy array.

Return type:

np.ndarray

axis_control

Axis control instance used in figure_management.setup_figure. Can be None|RenderControlAxis.

property title: str

Get the title of the figure.

Returns:

The title of the figure.

Return type:

str

Frames

class opencsp.common.lib.render_control.RenderControlFramesNoDuplicates.RenderControlFramesNoDuplicates(frame_format='JPG', clear_dir=True, draw_example_frames=True, example_dpi=200, **kwargs)

Bases: RenderControlVideoFrames

Render control for the UFACET pipeline step FramesNoDuplicates.

__init__(frame_format='JPG', clear_dir=True, draw_example_frames=True, example_dpi=200, **kwargs)

Render control for the UFACET pipeline step FramesNoDuplicates.

This class manages the rendering settings for the FramesNoDuplicates step in the UFACET pipeline, allowing customization of frame formats and rendering options.

Parameters:
  • frame_format (str, optional) – The format of the frames to be rendered. By default, “JPG”.

  • clear_dir (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_example_frames (bool, optional) – Whether to draw example frames during rendering. By default, True.

  • example_dpi (int, optional) – DPI (dots per inch) for the example frames. By default, 200.

  • **kwargs (keyword arguments) – Additional keyword arguments passed to the parent class RenderControlVideoFrames.

opencsp.common.lib.render_control.RenderControlFramesNoDuplicates.default()

Create a default render control for frames without duplicates.

This function returns a RenderControlFramesNoDuplicates instance with default settings.

Returns:

An instance of RenderControlFramesNoDuplicates configured with default parameters.

Return type:

RenderControlFramesNoDuplicates

opencsp.common.lib.render_control.RenderControlFramesNoDuplicates.fast(**kwargs)

Create a fast render control for frames without duplicates.

This function returns a RenderControlFramesNoDuplicates instance configured to skip drawing example frames, which can speed up the rendering process.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFramesNoDuplicates.

Returns:

An instance of RenderControlFramesNoDuplicates configured for fast rendering.

Return type:

RenderControlFramesNoDuplicates

class opencsp.common.lib.render_control.RenderControlKeyFramesGivenManual.RenderControlKeyFramesGivenManual(clear_previous=True, draw_key_frames=True, key_frame_polygon_linewidth=3, key_frame_polygon_color='m', key_frame_label_horizontalalignment='center', key_frame_label_verticalalignment='center', key_frame_label_fontsize=10, key_frame_label_fontstyle='normal', key_frame_label_fontweight='bold', key_frame_label_color='m', key_frame_dpi=200, key_frame_crop=False)

Bases: object

Render control for the UFACET pipeline step KeyFrames (manual input version).

__init__(clear_previous=True, draw_key_frames=True, key_frame_polygon_linewidth=3, key_frame_polygon_color='m', key_frame_label_horizontalalignment='center', key_frame_label_verticalalignment='center', key_frame_label_fontsize=10, key_frame_label_fontstyle='normal', key_frame_label_fontweight='bold', key_frame_label_color='m', key_frame_dpi=200, key_frame_crop=False)

Render control for the UFACET pipeline step KeyFrames (manual input version).

This class manages the rendering settings for the KeyFrames step in the UFACET pipeline, allowing customization of various visual elements related to manually input key frames.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_key_frames (bool, optional) – Whether to draw the key frame figures. By default, True.

  • key_frame_polygon_linewidth (float, optional) – Line width for the expected heliostat polygon. By default, 3.

  • key_frame_polygon_color (str, optional) – Color for the expected heliostat polygon. By default, ‘m’ (magenta).

  • key_frame_label_horizontalalignment (str, optional) – Horizontal alignment for the heliostat label. By default, ‘center’.

  • key_frame_label_verticalalignment (str, optional) – Vertical alignment for the heliostat label. By default, ‘center’.

  • key_frame_label_fontsize (int, optional) – Font size for the heliostat label. By default, 10.

  • key_frame_label_fontstyle (str, optional) – Font style for the heliostat label. By default, ‘normal’.

  • key_frame_label_fontweight (str, optional) – Font weight for the heliostat label. By default, ‘bold’.

  • key_frame_label_color (str, optional) – Color for the heliostat label. By default, ‘m’ (magenta).

  • key_frame_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • key_frame_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, False.

opencsp.common.lib.render_control.RenderControlKeyFramesGivenManual.default()

Create a default render control for key frames.

This function returns a RenderControlKeyFramesGivenManual instance with default settings.

Returns:

An instance of RenderControlKeyFramesGivenManual configured with default parameters.

Return type:

RenderControlKeyFramesGivenManual

opencsp.common.lib.render_control.RenderControlKeyFramesGivenManual.fast()

Create a fast render control for key frames.

This function returns a RenderControlKeyFramesGivenManual instance configured to skip drawing the key frame figures, which can speed up the rendering process.

Returns:

An instance of RenderControlKeyFramesGivenManual configured for fast rendering.

Return type:

RenderControlKeyFramesGivenManual

FunctionXY

class opencsp.common.lib.render_control.RenderControlFunctionXY.RenderControlFunctionXY(draw_heatmap: bool = True, draw_contours: bool = False, cmap: str = 'jet', colorbar: bool = False, colorbar_min_max: tuple[float, float] | None = None, bounds: tuple[float, float, float, float] | None = None)

Bases: object

Render control for visualizing functions in XY space.

This class manages the rendering settings for visualizing functions using heatmaps and contours.

__init__(draw_heatmap: bool = True, draw_contours: bool = False, cmap: str = 'jet', colorbar: bool = False, colorbar_min_max: tuple[float, float] | None = None, bounds: tuple[float, float, float, float] | None = None) None

Render control for visualizing functions in XY space.

This class manages the rendering settings for visualizing functions using heatmaps and contours.

Parameters:
  • draw_heatmap (bool, optional) – Whether to draw a heatmap representation of the function. By default, True.

  • draw_contours (bool, optional) – Whether to draw contour lines for the function. By default, False.

  • cmap (str, optional) – Colormap to use for the heatmap. By default, “jet”.

  • colorbar (bool, optional) – Whether to display a colorbar alongside the heatmap. By default, False.

  • colorbar_min_max (tuple[float, float], optional) – Minimum and maximum values for the colorbar. By default, None.

  • bounds (tuple[float, float, float, float], optional) – Bounds for the visualization area (xmin, xmax, ymin, ymax). By default, None (unverified).

opencsp.common.lib.render_control.RenderControlFunctionXY.countours(**kwargs)

Create a render control for drawing contours only.

This function returns a RenderControlFunctionXY instance configured to draw only contour lines, without the heatmap representation.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFunctionXY.

Returns:

An instance of RenderControlFunctionXY configured to display contours only.

Return type:

RenderControlFunctionXY

opencsp.common.lib.render_control.RenderControlFunctionXY.heatmap(**kwargs)

Create a render control for drawing a heatmap.

This function returns a RenderControlFunctionXY instance configured to draw a heatmap representation of the function.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFunctionXY.

Returns:

An instance of RenderControlFunctionXY configured to display a heatmap.

Return type:

RenderControlFunctionXY

opencsp.common.lib.render_control.RenderControlFunctionXY.heatmap_and_contours(**kwargs)

Create a render control for drawing both heatmap and contours.

This function returns a RenderControlFunctionXY instance configured to draw both the heatmap representation and contour lines for the function.

Parameters:

**kwargs (keyword arguments) – Additional keyword arguments to pass to the RenderControlFunctionXY.

Returns:

An instance of RenderControlFunctionXY configured to display both heatmap and contours.

Return type:

RenderControlFunctionXY

Heatmap

class opencsp.common.lib.render_control.RenderControlHeatmap.RenderControlHeatmap(linestyle_unimplemented='None', linewidth_unimplemented=1, cmap: str | Colormap = 'Viridis')

Bases: object

Render control for a heatmap.

This class controls the style of the heatmap, allowing customization of line styles, line widths, and color maps.

Choices for line styles and color maps can be found in the Matplotlib documentation: - Line styles: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html - Color maps: https://matplotlib.org/stable/gallery/color/colormap_reference.html

Line styles

‘-’ solid line style ‘–’ dashed line style ‘-.’ dash-dot line style ‘:’ dotted line style ‘None’ no lines

Perceptually uniform color maps

‘Viridis’ purple -> turquoise -> yellow (default) ‘Plasma’ blue -> purple -> yellow-green ‘Inferno’ black -> rust -> yellow-white ‘Magma’ black -> maroon -> white ‘Cividis’ navy -> grey -> yellow

Sequential color maps

‘Greys’ white -> grey -> black ‘Purples’ white -> light purple -> royal purple ‘Blues’ white -> light blue -> dark blue ‘Greens’ white -> light green -> forest green ‘Oranges’ white -> orange -> burnt orange ‘Reds’ white -> tangerine -> dark red ‘YlOrBr’ white -> yellow -> orange -> brown ‘YlOrRd’ white -> yellow -> orange -> dark red ‘OrRd’ white -> orange -> dark red ‘PuRd’ white -> purple -> dark red ‘RdPu’ white -> pink -> purple ‘BuPu’ white -> light blue -> faded blue -> dark purple ‘GrBu’ white -> light green -> aqua -> dark blue ‘PuBu’ white -> light purple -> faded blue -> dark blue ‘YlGnBl’ white -> yellow -> green -> aqua -> blue -> dark blue ‘PuBlGn’ white -> light purple -> sky blue -> forest green ‘BuGn’ white -> aqua -> green -> forest green ‘YlGn’ white -> yellow -> yellow green -> forest green

Miscellaneous colormaps

‘jet’ navy -> green -> rust

__init__(linestyle_unimplemented='None', linewidth_unimplemented=1, cmap: str | Colormap = 'Viridis')

Initialize the RenderControlHeatmap instance.

Parameters:
  • linestyle_unimplemented (str, optional) – The line style to use for the heatmap. Default is “None”.

  • linewidth_unimplemented (int, optional) – The width of the lines in the heatmap. Default is 1.

  • cmap (str or Colormap, optional) – The color map to use for the heatmap. Default is “Viridis”.

Intersection

class opencsp.common.lib.render_control.RenderControlIntersection.RenderControlIntersection(dots_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, plot_limits: tuple[tuple, tuple] | None = None)

Bases: object

A class for controlling the rendering of intersection points in a graphical representation.

This class allows for the configuration of the style of dots used to represent intersection points and the limits of the plot area.

dots_style

The style of the dots used for rendering intersection points.

Type:

rcps.RenderControlPointSeq

plot_limits

The limits of the plot area, or None if not set.

Type:

tuple[tuple, tuple] or None

__init__(dots_style=<opencsp.common.lib.render_control.RenderControlPointSeq.RenderControlPointSeq object>, plot_limits: tuple[tuple, tuple] | None = None) None

Initializes the RenderControlIntersection instance with specified dot style and plot limits.

Parameters:
  • dots_style (rcps.RenderControlPointSeq, optional) – The style of the dots used for rendering intersection points. Defaults to a marker style.

  • plot_limits (tuple[tuple, tuple], optional) – A tuple defining the limits of the plot area as ((xmin, xmax), (ymin, ymax)). If None, the plot limits are not set.

Powerpoint

class opencsp.common.lib.render_control.RenderControlPowerpointPresentation.RenderControlPowerpointPresentation(new_slides: list[PowerpointSlide] | None = None, existing_presentation_path_name_ext: str | None = None)

Bases: object

Create a new presentation instance to which to add slides.

__init__(new_slides: list[PowerpointSlide] | None = None, existing_presentation_path_name_ext: str | None = None)

Create a new presentation instance to which to add slides.

Example:

# create the presentation to add our slides to
presentation = rcpp.RenderControlPowerpointPresentation()

# create each slide
slide = pp.PowerpointSlide.template_content_grid(nrows=2, ncols=3)
slide.add_image(top_left_image)
slide.add_image(top_center_image)
slide.add_image(top_right_image)
slide.add_image(bottom_left_image)
slide.add_image(bottom_center_image)
slide.add_image(bottom_right_image)

# add the slides
slide.save_and_bake()
presentation.add_slide(slide)

# save the presentation
presentation.save(home_dir() + "example.pptx")
Parameters:
  • new_slides (list[pps.PowerpointSlide]) – Some of the slides to be added to the presentation. Defaults to None.

  • existing_presentation_path_name_ext (str) – An already existing presentation to which we want to add additional slides. Defaults to None.

add_slide(slide: PowerpointSlide)

Adds the given slide to this presentation and saves the associated images to temporary files.

For this reason (saving images), adding the slide to the presentation should happen after the slide has been fully populated with contents.

static clear_tmp()

Clears the temporary files associated with rendering the presentation.

get_content_layout()

Gets the layout of the presentation’s content slides, as determined by the slide master’s second layout.

See also

  • Presentation.slide_layout

  • SlideMasters

Returns:

layout – The layout of the presentation’s content slides.

Return type:

pptx.slide_layout

get_title_layout()

Gets the layout of the presentation’s title slide.

Returns:

layout – The layout of the presentation’s title slide.

Return type:

pptx.slide_layout

save(dest_path_name_ext: str, overwrite=False)

Saves the presentation to a pptx formatted file.

This process can take a little while (10s of seconds) depending on the size of the presentation and especially the number of images.

It is suggested that clear_tmp() be called after the presentation has been rendered/saved for the last time.

Parameters:
  • dest_path_name_ext (str) – The path to save the presentation to.

  • overwrite (bool) – Whether to overwrite the file if it already exists.

Raises:

RuntimeError – If the file already exists and overwrite is False. A check is done both when this function starts and before the final file is written to, in case the file was created by another process in the intervening time.

class opencsp.common.lib.render_control.RenderControlPowerpointSlide.RenderControlPowerpointSlide(title_size=30, title_location: tuple[float, float] = (0.48, 0.25), text_size=16, text_location: tuple[float, float] = (0.53, 0.83), image_caption_size=14, is_title_slide=False, slide_index=-1, slide_size: tuple[float, float] = (13.33, 7.5), inter_cell_buffer: float = 0.35, reduced_image_size_scale: float = -1)

Bases: object

Controls for how to render a power slide.

__init__(title_size=30, title_location: tuple[float, float] = (0.48, 0.25), text_size=16, text_location: tuple[float, float] = (0.53, 0.83), image_caption_size=14, is_title_slide=False, slide_index=-1, slide_size: tuple[float, float] = (13.33, 7.5), inter_cell_buffer: float = 0.35, reduced_image_size_scale: float = -1)

Controls for how to render a power slide.

Parameters:
  • title_size (int) – Font size of the title text box. Defaults to 30.

  • title_location (tuple) – Top-left location of the title text box in inches. Defaults to (.48,.25).

  • text_size (int) – Font size of the content text box. Defaults to 16.

  • text_location (tuple) – Top-left location of the content text box in inches. Defaults to (.53,.83).

  • image_caption_size (int) – Font size of image captions. Defaults to 14.

  • is_title_slide (bool) – True for the title slide, False for all content slides. Defaults to False.

  • slide_index (int) – Where to put this slide in the presentation, or -1 to put it at the end. Defaults to -1.

  • slide_size (tuple) – Size of the slide in inches. Defaults to (13.33,7.5).

  • inter_cell_buffer (float) – Default amount of space between cells in inches, for slides that are arranged in a grid.

  • reduced_image_size_scale (float) – How much to reduce image size to relative to its rendered size, assuming 300 dpi, in order to save on space. -1 for no reduction. Defaults to -1.

get_text_dims()

Get the [x,y,width,height] of the contents text box.

get_title_dims()

Get the [x,y,width,height] of the title text box.

classmethod title_slide()

Default settings for the first frame slide

image_caption_size

Size of the image caption font, in pnts

inter_cell_buffer

Space between cells, when generating slides with PowerpointSlide.template_content_grid()

is_title_slide

True if this is the title slide, or False otherwise

reduced_image_size_scale

When images are reduced to save on disk space, this is the cutoff threshold at which images are scaled down.

slide_dpi

Assumed dots per inch of the slide

slide_index

Index to insert into the powerpoint, or -1 to insert in add order.

slide_size

Width, height of the slide, in inches

text_location

Default left, top location of text, in inches

text_size

Size of the text font, in pnts

title_location

Left, top location of title, in inches

title_size

Size of the title font, in pnts

Text

class opencsp.common.lib.render_control.RenderControlText.RenderControlText(horizontalalignment: str = 'center', verticalalignment: str = 'center', fontsize: str | float = 'medium', fontstyle: str = 'normal', fontweight: int | str = 'normal', zdir: str | tuple[int, int, int] | None = None, color: str | Color = 'b', rotation: float = 0)

Bases: object

Render control for text labels added to plots.

This class manages the rendering of text labels in plots, allowing customization of font styles, colors, and alignments.

Primary parameters from: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html

Font Weight

A numeric value in range 0-1000 ‘ultralight’ ‘light’ ‘normal’ ‘regular’ ‘book’ ‘medium’ ‘roman’ ‘semibold’ ‘demibold’ ‘demi’ ‘bold’ ‘heavy’ ‘extra bold’ ‘black’

zdir choices from: https://matplotlib.org/stable/gallery/mplot3d/text3d.html

Color choices from: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html

Colors

‘b’ blue ‘g’ green ‘r’ red ‘c’ cyan ‘m’ magenta ‘y’ yellow ‘k’ black ‘w’ white

For more colors, see: https://matplotlib.org/stable/api/colors_api.html#module-matplotlib.colors

__init__(horizontalalignment: str = 'center', verticalalignment: str = 'center', fontsize: str | float = 'medium', fontstyle: str = 'normal', fontweight: int | str = 'normal', zdir: str | tuple[int, int, int] | None = None, color: str | Color = 'b', rotation: float = 0)

Controls for how text gets rendered.

Parameters:
  • horizontalalignment (str, optional) – Horizontal alignment, one of ‘center’, ‘right’, ‘left’. Default is ‘center’.

  • verticalalignment (str, optional) – Vertical alignment, one of ‘center’, ‘top’, ‘bottom’, ‘baseline’, ‘center_baseline’. Default is ‘center’.

  • fontsize (str | float, optional) – Font size, specified as a float or one of ‘xx-small’, ‘x-small’, ‘small’, ‘medium’, ‘large’, ‘x-large’, ‘xx-large’. Default is ‘medium’.

  • fontstyle (str, optional) – Font style, one of ‘normal’, ‘italic’, ‘oblique’. Default is ‘normal’.

  • fontweight (int | str, optional) – Font weight, specified as an integer (0-1000) or one of ‘light’, ‘normal’, ‘bold’. Default is ‘normal’.

  • zdir (str | tuple[int, int, int] | None, optional) – Direction that is considered “up” when rendering in 3D. Can be ‘x’, ‘y’, ‘z’, or a direction such as (1,1,0), (1,1,1), or None for the default. Default is None.

  • color (str | Color, optional) – Color of the text, specified as a matplotlib named color or a Color instance. Default is ‘b’ (blue).

  • rotation (float, optional) – Orientation of the text in radians, where 0 is horizontal and pi/2 is vertical. Default is 0.

property color: tuple[float, float, float, float] | None

Get the RGBA color value for the text.

Returns:

The RGBA color value or None if not set.

Return type:

tuple[float, float, float, float] | None

opencsp.common.lib.render_control.RenderControlText.bold(fontsize='medium', color='b')

Create a bold text rendering control for emphasis.

This function returns a RenderControlText instance configured for bold text.

Parameters:
  • fontsize (str | float, optional) – Font size for the text. Default is ‘medium’.

  • color (str, optional) – Color for the text. Default is ‘b’ (blue).

Returns:

An instance of RenderControlText configured for bold text.

Return type:

RenderControlText

opencsp.common.lib.render_control.RenderControlText.default(fontsize='medium', color='b')

Create a default text rendering control.

This function returns a RenderControlText instance with default settings.

Parameters:
  • fontsize (str | float, optional) – Font size for the text. Default is ‘medium’.

  • color (str, optional) – Color for the text. Default is ‘b’ (blue).

Returns:

An instance of RenderControlText configured with default parameters.

Return type:

RenderControlText

Video

Key Corners

class opencsp.common.lib.render_control.RenderControlKeyCorners.RenderControlKeyCorners(clear_previous=True, draw_key_corners=True, key_corners_points_marker='o', key_corners_points_markersize=1.5, key_corners_points_color='m', key_corners_label_horizontalalignment='center', key_corners_label_verticalalignment='center', key_corners_label_fontsize=6, key_corners_label_fontstyle='normal', key_corners_label_fontweight='bold', key_corners_label_color='m', key_corners_dpi=200, key_corners_crop=False)

Bases: object

Render control for the UFACET pipeline step KeyCorners.

__init__(clear_previous=True, draw_key_corners=True, key_corners_points_marker='o', key_corners_points_markersize=1.5, key_corners_points_color='m', key_corners_label_horizontalalignment='center', key_corners_label_verticalalignment='center', key_corners_label_fontsize=6, key_corners_label_fontstyle='normal', key_corners_label_fontweight='bold', key_corners_label_color='m', key_corners_dpi=200, key_corners_crop=False)

Render control for the UFACET pipeline step KeyCorners.

This class manages the rendering settings for the KeyCorners step in the UFACET pipeline, allowing customization of various visual elements related to key corners.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_key_corners (bool, optional) – Whether to draw the key corner figures. By default, True.

  • key_corners_points_marker (str, optional) – Marker style for the key corner points. By default, ‘o’.

  • key_corners_points_markersize (float, optional) – Size of the marker for key corner points. By default, 1.5.

  • key_corners_points_color (str, optional) – Color for the key corner points. By default, ‘m’ (magenta).

  • key_corners_label_horizontalalignment (str, optional) – Horizontal alignment for the key corner label. By default, ‘center’.

  • key_corners_label_verticalalignment (str, optional) – Vertical alignment for the key corner label. By default, ‘center’.

  • key_corners_label_fontsize (int, optional) – Font size for the key corner label. By default, 6.

  • key_corners_label_fontstyle (str, optional) – Font style for the key corner label. By default, ‘normal’.

  • key_corners_label_fontweight (str, optional) – Font weight for the key corner label. By default, ‘bold’.

  • key_corners_label_color (str, optional) – Color for the key corner label. By default, ‘m’ (magenta).

  • key_corners_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • key_corners_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, False.

opencsp.common.lib.render_control.RenderControlKeyCorners.default()

Create a default render control for key corners.

This function returns a RenderControlKeyCorners instance with default settings.

Returns:

An instance of RenderControlKeyCorners configured with default parameters.

Return type:

RenderControlKeyCorners

opencsp.common.lib.render_control.RenderControlKeyCorners.fast()

Create a fast render control for key corners.

This function returns a RenderControlKeyCorners instance configured to skip drawing the key corner figures, which can speed up the rendering process.

Returns:

An instance of RenderControlKeyCorners configured for fast rendering.

Return type:

RenderControlKeyCorners

Key Tracks

class opencsp.common.lib.render_control.RenderControlKeyTracks.RenderControlKeyTracks(clear_previous=True, draw_key_tracks=True, key_tracks_points_marker='o', key_tracks_points_markersize=1.5, key_tracks_points_color='m', key_tracks_label_horizontalalignment='center', key_tracks_label_verticalalignment='center', key_tracks_label_fontsize=6, key_tracks_label_fontstyle='normal', key_tracks_label_fontweight='bold', key_tracks_label_color='m', key_tracks_dpi=200, key_tracks_crop=False)

Bases: object

Render control for the UFACET pipeline step KeyTracks.

__init__(clear_previous=True, draw_key_tracks=True, key_tracks_points_marker='o', key_tracks_points_markersize=1.5, key_tracks_points_color='m', key_tracks_label_horizontalalignment='center', key_tracks_label_verticalalignment='center', key_tracks_label_fontsize=6, key_tracks_label_fontstyle='normal', key_tracks_label_fontweight='bold', key_tracks_label_color='m', key_tracks_dpi=200, key_tracks_crop=False)

Render control for the UFACET pipeline step KeyTracks.

This class manages the rendering settings for the KeyTracks step in the UFACET pipeline, allowing customization of various visual elements related to key frame tracks.

Parameters:
  • clear_previous (bool, optional) – Whether to remove any existing files in the designated output directory. By default, True.

  • draw_key_tracks (bool, optional) – Whether to draw the key frame track figures. By default, True.

  • key_tracks_points_marker (str, optional) – Marker style for the key frame track points. By default, ‘o’.

  • key_tracks_points_markersize (float, optional) – Size of the marker for key frame track points. By default, 1.5.

  • key_tracks_points_color (str, optional) – Color for the key frame track points. By default, ‘m’ (magenta).

  • key_tracks_label_horizontalalignment (str, optional) – Horizontal alignment for the key track label. By default, ‘center’.

  • key_tracks_label_verticalalignment (str, optional) – Vertical alignment for the key track label. By default, ‘center’.

  • key_tracks_label_fontsize (int, optional) – Font size for the key track label. By default, 6.

  • key_tracks_label_fontstyle (str, optional) – Font style for the key track label. By default, ‘normal’.

  • key_tracks_label_fontweight (str, optional) – Font weight for the key track label. By default, ‘bold’.

  • key_tracks_label_color (str, optional) – Color for the key track label. By default, ‘m’ (magenta).

  • key_tracks_dpi (int, optional) – DPI (dots per inch) for saving figures to disk. By default, 200.

  • key_tracks_crop (bool, optional) – Whether to crop annotations outside the image frame. By default, False.

opencsp.common.lib.render_control.RenderControlKeyTracks.default()

Create a default render control for key tracks.

This function returns a RenderControlKeyTracks instance with default settings.

Returns:

An instance of RenderControlKeyTracks configured with default parameters.

Return type:

RenderControlKeyTracks

opencsp.common.lib.render_control.RenderControlKeyTracks.fast()

Create a fast render control for key tracks.

This function returns a RenderControlKeyTracks instance configured to skip drawing the key frame track figures, which can speed up the rendering process.

Returns:

An instance of RenderControlKeyTracks configured for fast rendering.

Return type:

RenderControlKeyTracks

class opencsp.common.lib.render_control.RenderControlVideo.RenderControlVideo(framerate: int = 30, width=None, height=None, min_scale=False, codec: str = 'H.264', low_bitrate: bool = False)

Bases: object

A class to control the rendering of videos with customizable parameters.

This class allows users to specify various settings for video rendering, including framerate, resolution, codec, and bitrate options. It provides methods to retrieve ffmpeg arguments for video processing and to calculate parameters for generating videos from a set of images.

framerate

The framerate for the video.

Type:

int

width

The width of the video.

Type:

int or None

height

The height of the video.

Type:

int or None

min_scale

Indicates whether to apply minimum scaling.

Type:

bool

codec

The codec used for encoding the video.

Type:

str

low_bitrate

Indicates whether to use low bitrate encoding.

Type:

bool

__init__(framerate: int = 30, width=None, height=None, min_scale=False, codec: str = 'H.264', low_bitrate: bool = False)

Initialize the RenderControlVideo object.

Parameters:
  • framerate (int, optional) – Framerate for the video in frames per second, or None (uses source framerate). Defaults to 30.

  • width (int, optional) – Sets the width of the video. None to scale relative to height. Defaults to None.

  • height (int, optional) – Sets the height of the video. None to scale relative to width. Defaults to None.

  • min_scale (bool, optional) – When True, width=min(width, curr) and height=min(height, curr). Defaults to False.

  • codec (str, optional) – How to encode new videos. Can be one of ‘undefined’, ‘H.264’, ‘H.265’, or ‘copy’. Defaults to ‘H.264’.

  • low_bitrate (bool, optional) – Should videos be encoded for a reduced file size? If True, then this sets the ‘-crf’ option. Defaults to False.

Raises:

RuntimeError – If an unrecognized codec option is provided or if low_bitrate is True with an undefined or copy codec.

classmethod default()

Create a default instance of RenderControlVideo.

Returns:

A default instance of the class with preset parameters.

Return type:

RenderControlVideo

get_ffmpeg_args(video_or_image_path_name_ext: str = '') tuple[str, dict[str, str]]

Get the arguments and directories to be passed to ffmpeg.

Parameters:

video_or_image_path_name_ext (str, optional) – Needed for width or height relative to the original video. Defaults to “”.

Returns:

The arguments string to pass to ffmpeg and any additional options as a dictionary.

Return type:

tuple[str, dict[str, str]]

get_frames_to_video_parameters()

Get the duration for the desired framerate to generate a video from a set of images.

Returns:

How long each image should be shown for, and the ffmpeg files list line for that duration.

Return type:

tuple[float, str]

classmethod power_point(framerate=10, width=320, height=None, codec='H.264', low_bitrate=False)

Returns a set of defaults suitable for embedding videos into PowerPoint.

Parameters:
  • framerate (int, optional) – Framerate for the video in frames per second. Defaults to 10.

  • width (int, optional) – Sets the width of the video. Defaults to 320.

  • height (int, optional) – Sets the height of the video. Defaults to None.

  • codec (str, optional) – How to encode new videos. Defaults to ‘H.264’.

  • low_bitrate (bool, optional) – Should videos be encoded for a reduced file size? Defaults to False.

Returns:

An instance of RenderControlVideo with parameters suitable for PowerPoint.

Return type:

RenderControlVideo

class opencsp.common.lib.render_control.RenderControlVideoFrames.RenderControlVideoFrames(inframe_format: str = 'png', outframe_name: str = '-%05d', outframe_format: str = 'png', outframe_dpi: int | None = None, example_name: str | None = None, example_format: str | None = None, example_dpi: int | None = None, example_freq: int = 1, draw_example_frames=True, clear_dir=True, concat_video_frame_names=True)

Bases: object

Render control for extracting frames from videos.

This class manages the extraction of frames from videos, allowing customization of frame formats, names, and extraction settings.

inframe_format

The format for input frames (for video construction). Defaults to “png”.

Type:

str

outframe_name

The format for frame names. Example “-%05d” with a video “foo.mp4” will produce “foo-00001”, “foo-00002”, etc. Defaults to “-%05d”.

Type:

str

outframe_format

Format for extracted frames. Defaults to “png”.

Type:

str

outframe_dpi

Placeholder for dots per inch setting. Defaults to None.

Type:

Optional[int]

example_name

Name format for example frames. Defaults to outframe_name.

Type:

Optional[str]

example_format

Format for example (human consumable) extracted frames. Defaults to outframe_format.

Type:

Optional[str]

example_dpi

Placeholder for dpi setting for example frames. Defaults to outframe_dpi.

Type:

Optional[int]

example_freq

The frequency of example frames. Defaults to 1 frame per second of video.

Type:

int

draw_example_frames

If True, export example frames. Defaults to True.

Type:

bool

clear_dir

Whether to clear the existing directory before writing extracted frames. Defaults to True.

Type:

bool

concat_video_frame_names

Creates output names from concatenating the video and frame names. Defaults to True.

Type:

bool

__init__(inframe_format: str = 'png', outframe_name: str = '-%05d', outframe_format: str = 'png', outframe_dpi: int | None = None, example_name: str | None = None, example_format: str | None = None, example_dpi: int | None = None, example_freq: int = 1, draw_example_frames=True, clear_dir=True, concat_video_frame_names=True)

Controls for how frames are used in VideoHandler.

There are two types of extracted frames:
  • Example: some small number of example frames can optionally be extracted into a separate directory. These are intended for human consumption.

  • Outframe: All extracted frames from a video. These are more meant for machine processing and consumption.

Parameters:
  • inframe_format (str, optional) – The format for input frames (for video construction). Defaults to “png”.

  • outframe_name (str, optional) – The format for frame names. Defaults to “-%05d”.

  • outframe_format (str, optional) – Format for extracted frames. Defaults to “png”.

  • outframe_dpi (Optional[int], optional) – Placeholder for dots per inch setting. Defaults to None.

  • example_name (Optional[str], optional) – Name format for example frames. Defaults to outframe_name.

  • example_format (Optional[str], optional) – Format for example extracted frames. Defaults to outframe_format.

  • example_dpi (Optional[int], optional) – Placeholder for dpi setting for example frames. Defaults to outframe_dpi.

  • example_freq (int, optional) – The frequency of example frames. Defaults to 1 frame per second of video.

  • draw_example_frames (bool, optional) – If True, export example frames. Defaults to True.

  • clear_dir (bool, optional) – Whether to clear the existing directory before writing extracted frames. Defaults to True.

  • concat_video_frame_names (bool, optional) – Creates output names from concatenating the video and frame names. Defaults to True.

clean_dir(dir: str, remove_only_images=False)

Remove images and/or all files in the specified directory.

If self.clear_dir is True, this method will remove files based on the specified conditions.

Parameters:
  • dir (str) – The directory to clean.

  • remove_only_images (bool, optional) – If True, only remove files with the specified image extensions. If False, remove all files. Default is False.

classmethod default()

Create a default instance of RenderControlVideoFrames.

Returns:

An instance of RenderControlVideoFrames with default settings.

Return type:

RenderControlVideoFrames

classmethod fast()

Create a fast instance of RenderControlVideoFrames.

This instance is configured to not draw example frames.

Returns:

An instance of RenderControlVideoFrames configured for fast processing.

Return type:

RenderControlVideoFrames

get_ffmpeg_args(destination_dir: str, source_video_dir_body_ext: str | None = None, is_example_frames=False) tuple[str, dict[str, str]]

Get the ffmpeg arguments for extracting either extracted or example frames.

Example usage:

ffmpeg_args = frame_control.get_ffmpeg_args(dest_dir, input_video_dir_body_ext) cmd = f”ffmpeg -i {input_video_dir_body_ext} {ffmpeg_args}”

Parameters:
  • destination_dir (str) – The directory where extracted frames will be located.

  • source_video_dir_body_ext (str, optional) – If provided, the input video name will be used as the first part of the extracted frame names.

  • is_example_frames (bool, optional) – If True, get the arguments for the example frames. Example frames are the same as standard frames, except that only a smaller fraction of total video frames are extraced. Default is False.

Returns:

A tuple containing: - str: The arguments string to pass to ffmpeg. - dict: A dictionary with the key ‘DESTDIR’ pointing to the output path for the frames.

Return type:

tuple[str, dict[str, str]]

get_outframe_name(source_video_dir_body_ext: str | None = None, is_example_frames=False)

Returns the format string for generating frame names (name + ext only).

Parameters:
  • source_video_dir_body_ext (str, optional) – The source video directory and file name. If provided, it will be used to prefix the frame names.

  • is_example_frames (bool, optional) – If True, generate names for example frames. Default is False.

Returns:

The formatted frame name with extension.

Return type:

str

get_outframe_path_name_ext(destination_dir: str, source_video_dir_body_ext: str | None = None, is_example_frames=False)

Get the full path for the output frame name including directory and extension.

Parameters:
  • destination_dir (str) – The directory where the extracted frames will be saved.

  • source_video_dir_body_ext (str, optional) – The source video directory and file name. If provided, it will be used to prefix the frame names.

  • is_example_frames (bool, optional) – If True, get the path for example frames. Default is False.

Returns:

The full path for the output frame name including directory and extension.

Return type:

str

class opencsp.common.lib.render_control.RenderControlVideoTracks.RenderControlVideoTracks(clear_previous=True, draw_video_tracks=True, video_tracks_points_marker='o', video_tracks_points_markersize=1.5, video_tracks_points_color='m', video_tracks_label_horizontalalignment='center', video_tracks_label_verticalalignment='center', video_tracks_label_fontsize=6, video_tracks_label_fontstyle='normal', video_tracks_label_fontweight='bold', video_tracks_label_color='m', video_tracks_dpi=200, video_tracks_crop=True)

Bases: object

Render control for the UFACET pipeline step VideoTracks.

This class manages the rendering of video tracks within the UFACET pipeline. It provides options for customizing the appearance of video track markers and labels, as well as controlling the output settings for the rendered figures.

__init__(clear_previous=True, draw_video_tracks=True, video_tracks_points_marker='o', video_tracks_points_markersize=1.5, video_tracks_points_color='m', video_tracks_label_horizontalalignment='center', video_tracks_label_verticalalignment='center', video_tracks_label_fontsize=6, video_tracks_label_fontstyle='normal', video_tracks_label_fontweight='bold', video_tracks_label_color='m', video_tracks_dpi=200, video_tracks_crop=True)

Render control for the UFACET pipeline step VideoTracks.

This class manages the rendering of video tracks within the UFACET pipeline. It provides options for customizing the appearance of video track markers and labels, as well as controlling the output settings for the rendered figures.

Parameters:
  • clear_previous (bool, optional) – If True, removes any existing files in the designated output directory. Defaults to True.

  • draw_video_tracks (bool, optional) – If True, draws the video track figures. Defaults to True.

  • video_tracks_points_marker (str, optional) – Marker style for video track points. Defaults to ‘o’.

  • video_tracks_points_markersize (float, optional) – Size of the marker for video track points. Defaults to 1.5.

  • video_tracks_points_color (str, optional) – Color for video track points. Defaults to ‘m’.

  • video_tracks_label_horizontalalignment (str, optional) – Horizontal alignment for heliostat labels. Defaults to ‘center’.

  • video_tracks_label_verticalalignment (str, optional) – Vertical alignment for heliostat labels. Defaults to ‘center’.

  • video_tracks_label_fontsize (int, optional) – Font size for heliostat labels. Defaults to 6.

  • video_tracks_label_fontstyle (str, optional) – Font style for heliostat labels. Defaults to ‘normal’.

  • video_tracks_label_fontweight (str, optional) – Font weight for heliostat labels. Defaults to ‘bold’.

  • video_tracks_label_color (str, optional) – Color for heliostat labels. Defaults to ‘m’.

  • video_tracks_dpi (int, optional) – Dots per inch (DPI) for saving figures to disk. Defaults to 200.

  • video_tracks_crop (bool, optional) – If True, crops annotations that are outside the image frame. Defaults to True.

opencsp.common.lib.render_control.RenderControlVideoTracks.default(color='m')

Create a default instance of RenderControlVideoTracks with specified color.

Parameters:

color (str, optional) – Color for video track points and labels. Defaults to ‘m’.

Returns:

An instance of RenderControlVideoTracks with default settings and the specified color.

Return type:

RenderControlVideoTracks

opencsp.common.lib.render_control.RenderControlVideoTracks.fast()

Create a fast instance of RenderControlVideoTracks with drawing disabled.

Returns:

An instance of RenderControlVideoTracks with drawing of video tracks disabled.

Return type:

RenderControlVideoTracks