analysis.intensity#
Radiant Intensity Analysis
This module implements the logic for radiant intensity analysis in an optical system, representing power per unit solid angle.
Manuel Fragata Mendes, June 2025
Classes
|
Computes and visualizes the radiant intensity distribution. |
- class RadiantIntensity(optic: Optic, num_angular_bins_X: int = 101, num_angular_bins_Y: int = 101, angle_X_min: float = -15.0, angle_X_max: float = 15.0, angle_Y_min: float = -15.0, angle_Y_max: float = 15.0, use_absolute_units: bool = True, reference_surface_index: int = -1, fields='all', wavelengths='all', num_rays: int = 100000, distribution: DistributionType = 'random', user_initial_rays=None, source=None, skip_trace: bool = False)[source]#
Computes and visualizes the radiant intensity distribution.
By default, this analysis calculates radiant intensity in absolute physical units of Watts/steradian (W/sr). This requires that the .intensity attribute of the rays traced represents the physical power of each ray.
The angles correspond to projections, similar to Zemax’s “Angle Space” plots (Angle X, Angle Y).
- Variables:
optic (optiland.optic.Optic) – The optical system.
num_angular_bins_X (int) – Number of bins for the X-angle.
num_angular_bins_Y (int) – Number of bins for the Y-angle.
angle_X_min (float) – Minimum X-angle in degrees for binning.
angle_X_max (float) – Maximum X-angle in degrees for binning.
angle_Y_min (float) – Minimum Y-angle in degrees for binning.
angle_Y_max (float) – Maximum Y-angle in degrees for binning.
reference_surface_index (int) – Index of the surface after which ray directions are considered.
fields (list) – List of field coordinates for analysis.
wavelengths (list) – List of wavelengths for analysis.
num_rays (int) – Number of rays to trace if user_initial_rays is None.
distribution_name (str) – Ray distribution if user_initial_rays is None.
user_initial_rays (RealRays | None) – Optional user-provided initial rays.
source (BaseSource | None) – Optional extended source object (e.g., GaussianSource) to generate initial rays automatically. Cannot be used with user_initial_rays. When provided, num_rays determines how many rays to generate.
data (list[list[tuple]]) – Stores (intensity_map, angle_X_bin_edges, angle_Y_bin_edges, angle_X_bin_centers, angle_Y_bin_centers) for each (field, wavelength).
use_absolute_units (bool) – If True (default), calculates intensity in W/sr. If False, result is a relative value normalized to the peak.
- view(fig_to_plot_on=None, figsize=(8, 6), cmap='jet', cross_section=None, cross_section_style='-', cross_section_color='red', *, normalize=None, show: bool = True)[source]#
Display radiant intensity maps and/or cross-sections.
Parameters#
- fig_to_plot_onmatplotlib.figure.Figure, optional
Existing figure to plot on. If None, a new figure is created.
- figsizetuple, optional
Size of the figure (width, height) in inches for each subplot.
- cmapstr or matplotlib.colors.Colormap, optional
Colormap to use for the intensity maps.
- cross_sectiontuple[str, int], optional
If provided, plot only cross-sections. Should be a tuple of (‘cross-x’ or ‘cross-y’, index), where index is the slice index along the specified axis. Default is None (plots 2D map + cross section).
- cross_section_stylestr, optional
Line style for cross-section plots.
- cross_section_colorstr, optional
Color for cross-section plots.
- normalizebool, optional
If True, normalize intensity to peak value. If False, use absolute values (W/sr). If None (default), use the value set in class initialization.
Returns#
- figmatplotlib.figure.Figure
The figure object containing the plots.
- axsnumpy.ndarray
Array of Axes objects for the subplots, or single Axes if only one subplot.