Contenido principal

WavefrontPeakToValley

R2026b

Peak-to-valley wavefront error metric for optical system merit function

Since R2026b

Description

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

A WavefrontPeakToValley object computes the weighted peak-to-valley wavefront error across specified field points and wavelengths for use in an optical system merit function. Evaluate the metric and compute the normalized residual score using the evaluateMetric object function.

Creation

There are two ways to create a WavefrontPeakToValley object.

  • Use the addWavefrontPeakToValley object function when you want to add this metric to an opticalMeritFunction object.

  • Use the optics.metric.WavefrontPeakToValley function described here. Use this function when you want to create a peak‑to‑valley wavefront error metric without adding it to the optical merit function, or modify the properties of a peak‑to‑valley wavefront error metric already in the merit function. After creating the object, you can specify the peak‑to‑valley wavefront error properties by modifying the properties of the object.

Description

metric = optics.metric.WavefrontPeakToValley creates a peak‑to‑valley wavefront error metric for use with the optical system merit function.

example

metric = optics.metric.WavefrontPeakToValley(PropertyName=Value) sets writable properties using one or more name-value arguments. For example, Target=[0 0.25] specifies a target peak‑to‑valley wavefront error range of 0 to 0.25 waves.

Properties

expand all

Descriptive name for the metric, specified as a string scalar.

Data Types: string

Target peak‑to‑valley wavefront error value, specified as a numeric scalar or 1-by-2 vector [lower, upper], where lower and upper are the lower and upper bounds of the target peak‑to‑valley wavefront error value, respectively. If you specify this argument as a scalar, the object considers the target metric as the upper bound. Units are in waves with respect to the primary wavelength of the optical system.

Data Types: double

Indices of wavelengths to evaluate, specified as a vector of positive integers. By default, the object computes the metric for all wavelengths in the optical system.

Data Types: double

Indices of field points to evaluate, specified as a vector of positive integers. By default, the object computes the metric for all field points in the optical system.

Data Types: double

Ray sampling pattern for peak‑to‑valley wavefront error computation, specified as a SamplingGrid object.

Object Functions

evaluateMetricEvaluate metric function

Examples

collapse all

Create an optical merit function.

mf = opticalMeritFunction;

To compute the peak-to-valley wavefront error metric, create a WavefrontPeakToValley object.

PVMetric = optics.metric.WavefrontPeakToValley
PVMetric = 
  WavefrontPeakToValley with properties:

    WavelengthIndex: [1×0 double]
    FieldPointIndex: [1×0 double]
       SamplingGrid: [1×1 samplingGrid]
               Name: "Wavefront Peak To Valley"
             Target: [0 0]

Add the peak-to-valley wavefront error metric to the optical merit function by setting the Metrics property of the opticalMeritFunction object.

mf.Metrics = PVMetric
mf = 
  opticalMeritFunction with properties:

         Metrics: [1×1 optics.metric.WavefrontPeakToValley]
         Weights: 1
    MetricsTable: [1×4 table]

Algorithms

The WavefrontPeakToValley metric computes the weighted peak-to-valley (P-V) wavefront error across multiple field points and wavelengths using these steps.

  1. Compute the optical path difference (OPD) for each combination of field point and wavelength specified by the FieldPointIndex and WavelengthIndex properties. If either property is empty, all field points or wavelengths defined in the optical system are used.

  2. Extract the peak-to-valley wavefront error from each OPD result to form a NumFP-by-NumWL matrix of values in waves, where NumFP is the number of field points and NumWL is the number of wavelengths.

  3. Normalize the FieldPointWeights and WavelengthWeights vectors from the optical system so that each sums to 1.

  4. Form a combined weights matrix as the outer product of the normalized field point weights and wavelength weights. Each element wij represents the joint weight for field point i at wavelength j.

  5. Compute the weighted peak-to-valley wavefront error across all selected field point and wavelength combinations:

    PV=i,jwij·rij2i,jwij

    where rij is the peak-to-valley wavefront error for field point i at wavelength j, and wij is the corresponding weight.

    The overall metric value is the weighted RMS of the raw OPD peak-to-valley values:

    metricValue=i=1Nfpj=1Nwlwij·PVij2i=1Nfpj=1Nwlwij

Version History

Introduced in R2026b