Contenuto principale

EncircledEnergyChart

R2026b

Encircled energy chart for PSF results

Since R2026b

Description

Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

An EncircledEnergyChart object plots encircled energy curves derived from one or more point spread function (PSF) result objects.

Use an EncircledEnergyChart chart to visualize the percentage of total PSF energy enclosed within a radius for selected wavelength channels and field points.

Creation

Create an EncircledEnergyChart object by using the showEncircledEnergy object function of a GeometricPSF or HuygensPSF object. Create a PSF result object by using the psf object function.

hEE = showEncircledEnergy(psfr)

You can specify chart properties when you call showEncircledEnergy.

hEE = showEncircledEnergy(psfr,WavelengthIndices=[1 3],Grid="major")

Properties

expand all

Chart title, specified as a string scalar or character vector. The default title is "Encircled Energy".

Point spread function results to plot, specified as a GeometricPSF object, a HuygensPSF object, or an array of PSF result objects.

When you specify an array of PSF result objects, the chart displays one tile for each PSF object. All objects in the array must use the same wavelengths.

Wavelength channels to plot, specified as a vector of positive integers. Each index refers to an element of the Wavelengths property of the PSF result object. By default, the chart plots all wavelength channels.

Data Types: double

Line colors for wavelength channels, specified as a color name, RGB triplet, string vector of color names, or numeric matrix of RGB triplets. By default, line colors are computed from the wavelengths in the PSF result object.

Legend display, specified as "on" or "off", or as numeric or logical 1 (true) or 0 (false). A value of "on" is equivalent to true, and "off" is equivalent to false. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Grid lines to display, specified as one of these options.

  • "major" — The chart displays only major grid lines.

  • "minor" — The chart displays major and minor grid lines.

  • "off" — The chart does not display any grid lines.

Data Types: char | string

Parent UI container, specified as a Figure object, Panel object, GridLayout object, Tab object, or TiledChartLayout object. If you do not specify this property, MATLAB creates a new figure. You can create these UI containers using their respective creation functions.

Examples

collapse all

Load the sample Double Gauss lens system using zmximport. Define a field point at an angle of 4 degrees along the x-axis, specify a wavelength of 587.56 nm, and calculate the geometric PSF.

opsys = zmximport("DoubleGaussLens.zmx");
fp = fieldPoint(Angles=[4 0]);
lambda = 587.56;
psfr = psf(opsys, FieldPoints=fp, Wavelengths=lambda, Method="Geometric");

Visualize the fraction of total energy enclosed within a given radius using the showEncircledEnergy function. The function renders the distribution curve and returns a chart handle for further property customization.

hEE = showEncircledEnergy(psfr)

Figure contains an object of type optics.chart.encircledenergychart. The chart of type optics.chart.encircledenergychart has title Encircled Energy.

hEE = 
  EncircledEnergyChart with properties:

               Legend: on
                 Grid: "off"
                Title: "Encircled Energy"
                  PSF: [1×1 optics.result.GeometricPSF]
    WavelengthIndices: 1
                Color: [1 0.7478 0]
             Position: [0.0869 0.2349 0.8581 0.6159]
                Units: 'normalized'

  Show all properties

Load the sample Double Gauss lens system using zmximport. Define a field point at an angle of 4 degrees along the x-axis and specify an array of three wavelengths (486.13 nm, 587.56 nm, and 656.28 nm).

opsys = zmximport("DoubleGaussLens.zmx");
fp = fieldPoint(Angles=[4 0]);
lambdas = [486.13 587.56 656.28];

Compute the Huygens PSF across all specified wavelengths by setting the Method name-value argument to "Huygens". Use the showEncircledEnergy function to plot the energy curves for only the first and third wavelengths, and add a major grid to the display. Modify the Title and Legend properties of the returned chart object to update the title text and hide the legend.

psfr = psf(opsys, FieldPoints=fp, Wavelengths=lambdas, Method="Huygens");
hEE = showEncircledEnergy(psfr, WavelengthIndices=[1 3], Grid="major");
hEE.Title = "Selected Encircled Energy";
hEE.Legend = "off";

Figure contains an object of type optics.chart.encircledenergychart. The chart of type optics.chart.encircledenergychart has title Selected Encircled Energy.

More About

expand all

Version History

Introduced in R2026b