メインコンテンツ

SpotRMS

R2026b

Spot RMS metric function

Since R2026b

    Description

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

    A SpotRMS object defines a spot RMS metric that computes the weighted average RMS spot size across specified wavelengths and field points in an optical system.

    Creation

    Description

    metric = optics.metric.SpotRMS creates a spot RMS metric with default settings that evaluates all wavelengths and field points in an optical system.

    example

    metric = optics.metric.SpotRMS(PropertyName=Value) sets one or more properties using name-value arguments.

    Properties

    expand all

    Indices of the wavelengths to evaluate, specified as a vector of positive integers. An empty value means the metric evaluates all wavelengths defined in the optical system.

    Indices of the field points to evaluate, specified as a vector of positive integers. An empty value means the metric evaluates all field points defined in the optical system.

    Ray sampling grid, specified as a samplingGrid object that defines the ray distribution pattern used to compute the RMS spot size.

    Metric name, specified as a string scalar or character vector.

    Target metric value, specified as a 1-by-2 nonnegative vector. If the target metric value is only an upper bound, ub, the object represents this property as [0 ub]. If the target metric value is a range with lower bound lb and upper bound ub, the object represents this property as [lb ub]. When the target metric value is [0 0], the residual score and the raw metric value are the same.

    Object Functions

    evaluateMetricEvaluate metric function

    Examples

    collapse all

    Import an optical system into the workspace.

    opsys = zmximport("PhotographicLens.zmx");

    Define a spot metric.

    metric = optics.metric.SpotRMS
    metric = 
      SpotRMS with properties:
    
        WavelengthIndex: [1×0 double]
        FieldPointIndex: [1×0 double]
           SamplingGrid: [1×1 samplingGrid]
                   Name: "Spot"
                 Target: [0 0]
    
    

    Evaluate the spot metric for the optical system.

    [score,rawMetricValues] = evaluateMetric(metric,opsys)
    score = 
    0.0076
    
    rawMetricValues = 
    0.0076
    

    Version History

    Introduced in R2026b