{
  "$defs": {
    "AxisName": {
      "description": "スポットの項が測る向き",
      "oneOf": [
        {
          "enum": [
            "x",
            "y"
          ],
          "type": "string"
        },
        {
          "const": "xy",
          "description": "x と y（スポットの半径、既定）",
          "type": "string"
        }
      ]
    },
    "CalcArgSpec": {
      "anyOf": [
        {
          "format": "double",
          "type": "number"
        },
        {
          "$ref": "#"
        }
      ],
      "description": "calc の引数"
    },
    "CalcName": {
      "description": "calc の演算（OpticStudio の SUMM・OSUM は sum、DIFF は diff、PROD は prod、DIVI は div、ABSO は abs、SQRT は sqrt（√|a|）、RECI は reci、MAXX・MINN は max・min、QSUM は qsum（√Σa²）、SINE〜ATAN は sin〜atan（ラジアン））",
      "enum": [
        "sum",
        "diff",
        "prod",
        "div",
        "abs",
        "sqrt",
        "reci",
        "max",
        "min",
        "qsum",
        "sin",
        "cos",
        "tan",
        "asin",
        "acos",
        "atan"
      ],
      "type": "string"
    },
    "DirName": {
      "description": "MTF の向き",
      "oneOf": [
        {
          "const": "tan",
          "description": "タンジェンシャル",
          "type": "string"
        },
        {
          "const": "sag",
          "description": "サジタル",
          "type": "string"
        },
        {
          "const": "both",
          "description": "両方（既定）",
          "type": "string"
        },
        {
          "const": "avg",
          "description": "子午と球欠の平均（mtf だけ、残差は 1 つ）",
          "type": "string"
        }
      ]
    },
    "EachName": {
      "description": "厚みの項で面ごとに比べる面の媒質",
      "oneOf": [
        {
          "const": "all",
          "description": "すべての面",
          "type": "string"
        },
        {
          "const": "air",
          "description": "空気の面（自分の媒質のない座標ブレーク・鏡も）",
          "type": "string"
        },
        {
          "const": "glass",
          "description": "空気でない媒質の面",
          "type": "string"
        }
      ]
    },
    "EdgeAxisName": {
      "description": "縁の厚みを測る向き",
      "enum": [
        "+y",
        "+x",
        "-y",
        "-x"
      ],
      "type": "string"
    },
    "FieldRef": {
      "anyOf": [
        {
          "description": "視野の番号（1 始まり）",
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        {
          "description": "正規化視野 [hx, hy]",
          "items": {
            "format": "double",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        }
      ],
      "description": "視野: 番号（1 始まり）か正規化視野 [hx, hy]"
    },
    "MacroRef": {
      "anyOf": [
        {
          "description": "番号（0〜99）",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        {
          "description": "名前",
          "type": "string"
        }
      ],
      "description": "zplm のマクロ: 番号 nn（ZPLnn.ZPL）か名前"
    },
    "MtfKindName": {
      "description": "MTF の求め方",
      "oneOf": [
        {
          "const": "diffraction",
          "description": "回折 MTF（既定）",
          "type": "string"
        },
        {
          "const": "square",
          "description": "矩形波の縞の応答（回折 MTF の奇数倍の周波数の級数）",
          "type": "string"
        },
        {
          "const": "geometric",
          "description": "幾何 MTF",
          "type": "string"
        },
        {
          "const": "huygens",
          "description": "像面の上の Huygens PSF の MTF",
          "type": "string"
        }
      ]
    },
    "Nums": {
      "anyOf": [
        {
          "format": "double",
          "type": "number"
        },
        {
          "items": {
            "format": "double",
            "type": "number"
          },
          "type": "array"
        }
      ],
      "description": "数か数の並び"
    },
    "QuadName": {
      "description": "スポット・波面の瞳の求積の点の置き方",
      "oneOf": [
        {
          "const": "lensbench",
          "description": "腕 4 rings + 2 本（既定）",
          "type": "string"
        },
        {
          "const": "opticstudio",
          "description": "OpticStudio の RSCE・RSCH・RWCE・RWCH と同じ（腕 2 rings 本を 90° 回して置く）。arms を与えると腕 arms 本を\n0° から等間隔に（評価関数の Wizard のガウス求積と同じ）",
          "type": "string"
        },
        {
          "const": "grid",
          "description": "瞳を n × n の升に分けた中心の点を等しい重みで（評価関数の Wizard の Rectangular Array と同じ。rings は使わない）",
          "type": "string"
        }
      ]
    },
    "RefName": {
      "description": "RMS の基準",
      "oneOf": [
        {
          "const": "centroid",
          "description": "重心（既定）",
          "type": "string"
        },
        {
          "const": "chief",
          "description": "主光線",
          "type": "string"
        }
      ]
    },
    "TermSpec": {
      "description": "評価関数の 1 つの項（共通のキー weight・config・min・max を除いた形）",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "spot・wavefront の項",
          "properties": {
            "arms": {
              "description": "quadrature opticstudio の腕の数（省略は 2 rings 本を 90° 回して）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "axis": {
              "anyOf": [
                {
                  "$ref": "#/$defs/AxisName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "spot の測る向き（既定 xy）"
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "quadrature grid の 1 辺の升の数",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "quadrature": {
              "anyOf": [
                {
                  "$ref": "#/$defs/QuadName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "瞳の求積の点の置き方（既定 lensbench。.zmx から読んだ行は opticstudio）"
            },
            "reference": {
              "anyOf": [
                {
                  "$ref": "#/$defs/RefName"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rings": {
              "description": "瞳の環の数（既定 3）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "spot",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号（1 始まり）。null・省略は多色",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "spot・wavefront の項",
          "properties": {
            "arms": {
              "description": "quadrature opticstudio の腕の数（省略は 2 rings 本を 90° 回して）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "axis": {
              "anyOf": [
                {
                  "$ref": "#/$defs/AxisName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "spot の測る向き（既定 xy）"
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "quadrature grid の 1 辺の升の数",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "quadrature": {
              "anyOf": [
                {
                  "$ref": "#/$defs/QuadName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "瞳の求積の点の置き方（既定 lensbench。.zmx から読んだ行は opticstudio）"
            },
            "reference": {
              "anyOf": [
                {
                  "$ref": "#/$defs/RefName"
                },
                {
                  "type": "null"
                }
              ]
            },
            "rings": {
              "description": "瞳の環の数（既定 3）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "wavefront",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号（1 始まり）。null・省略は多色",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "mtf の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "diff_limit": {
              "description": "幾何 MTF に回折限界の MTF をかけるか（kind が geometric のときだけ。既定 true）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "dir": {
              "anyOf": [
                {
                  "$ref": "#/$defs/DirName"
                },
                {
                  "type": "null"
                }
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "freq": {
              "description": "周波数 [cycles/mm]",
              "format": "double",
              "type": "number"
            },
            "kind": {
              "anyOf": [
                {
                  "$ref": "#/$defs/MtfKindName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "求め方（既定 diffraction）"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "瞳の標本数",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "description": "目標（既定 1）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "mtf",
              "type": "string"
            },
            "wave": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field",
            "freq"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "paraxial の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "description": "量（efl・pmag・enpp・epd・expp・expd・wfno・pwfn・isfn・pimh・totr・obsn・isna・amag・linv・petc・petz、OpticStudio の名前も可）",
              "type": "string"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "paraxial",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号（efl・pimh はその波長を主波長にした系の値、amag・linv・petc・petz はその波長の近軸光線）。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "ray の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "paraxial": {
              "description": "true で近軸光線（x・y を別々に近軸で追う。q は x・y・z・l・m・n・r・nl・nm・nn・tanx・tany、OpticStudio の PARX〜PATY）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "px": {
              "description": "正規化瞳座標（既定 0）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "py": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "description": "量（x・y・z・l・m・n。trax・tray・trar は主波長の主光線からのずれ、opth は光路長。gx〜gn はグローバル座標の交点と方向、\nr は交点の半径、ang は z 軸との角 [rad]、tanx・tany は l/n・m/n、nl〜nn は面の法線、aoi・aoe は入射角・射出角 [度]、\ncosi・cose はその cos）",
              "type": "string"
            },
            "surf": {
              "description": "面の番号（物体 0、既定は像面）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "description": "面 surf から to まで（q は opth で面の間の光路長、aoi・aoe は min・max と面ごとに比べてはみ出しを足す）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "ray",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "centroid の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "$ref": "#/$defs/Xy"
            },
            "rings": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "description": "目標 [レンズ単位]",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "centroid",
              "type": "string"
            },
            "wave": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "opd の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "px": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "py": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標 [波]",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "opd",
              "type": "string"
            },
            "wave": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "zernike の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "fit": {
              "description": "当てはめる項の数（term 以上。既定は term と 37 の大きい方。OpticStudio の ZERN は Fringe が 37、Standard が term）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "kind": {
              "anyOf": [
                {
                  "$ref": "#/$defs/ZernName"
                },
                {
                  "type": "null"
                }
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "格子（既定 64）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "description": "目標 [波]",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "term": {
              "description": "項の番号（1 始まり）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "type": {
              "const": "zernike",
              "type": "string"
            },
            "wave": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field",
            "term"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "coupling の項",
          "properties": {
            "clip_stop": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "grid": {
              "description": "格子（既定 101）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "na": {
              "description": "送り・受けの NA（na_source・na_receiver が優先）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "na_max": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "na_receiver": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "na_source": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "receiver": {
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": [
                "array",
                "null"
              ]
            },
            "source": {
              "description": "送りのファイバの位置 [x, y]",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 2,
              "minItems": 2,
              "type": [
                "array",
                "null"
              ]
            },
            "target": {
              "description": "目標（既定 1）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "coupling",
              "type": "string"
            },
            "wave": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "thickness の項（中心の厚み。to を書くと surf から to までの和）",
          "properties": {
            "axis": {
              "anyOf": [
                {
                  "$ref": "#/$defs/EdgeAxisName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "縁の厚みを測る向き（面の局所座標の \"+y\"（既定）・\"+x\"・\"-y\"・\"-x\"。OpticStudio の ETVA の Code 0〜3）"
            },
            "clear": {
              "description": "縁の厚みの矢高をクリア半径 × zone で測る（チップゾーンを入れない。既定 false）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "each": {
              "anyOf": [
                {
                  "$ref": "#/$defs/EachName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "和でなく面ごとに min・max と比べ、はみ出しを足す（その媒質の面だけ。OpticStudio の MNCT・MNCA・MNEG など）"
            },
            "edge": {
              "description": "縁の厚み（面とその次の面の矢高を、それぞれの面の形が終わる半径（クリア半径 + チップゾーン）× zone の高さで測る）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "surf": {
              "description": "面の番号（物体面 0）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標 [レンズ単位]",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "description": "和をとる最後の面（既定 surf）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "thickness",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            },
            "zone": {
              "description": "縁の厚みを測る高さ（面の形が終わる半径に対する割合、既定 1）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "surface の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "param": {
              "description": "面タイプのパラメータの番号（.zmx の PARM の番号、param だけ）",
              "format": "uint8",
              "maximum": 255,
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "q": {
              "description": "量（curv・conic・sag・sagx・sagy・thick・total・total_clear・diam・mech_diam・gx・gy・gz・ga・gb・gc・power・ynip・\nindex・nd・vd・dpgf・cost・tce・semi・param）",
              "type": "string"
            },
            "surf": {
              "description": "面の番号（物体面 0）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "description": "範囲の最後の面（semi・nd・vd・dpgf・cost・tce だけ）。書けば面 surf から to までを面ごとに min か max と比べ、\nはみ出しを足す（ガラスの量はガラスの面だけ）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "surface",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号（power・ynip・index だけ）。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            },
            "x": {
              "description": "sag・thick を測る点 [レンズ単位]（既定 0）。total・total_clear は測る向き（既定 +y）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "y": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "volume の項（面 surf から to までの要素の体積 [cm³] か質量 [g]）",
          "properties": {
            "clear": {
              "description": "外径をクリア半径でとる。既定は玉の半径（mech_diam の半分）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "cylinder": {
              "description": "要素の形でなく、面 surf から to + 1 を包む最小の円柱の体積 [cm³]（長さは頂点の間の厚みの和、半径は面の半径の最大。\n矢高は入れない）。mass とは使わない",
              "type": [
                "boolean",
                "null"
              ]
            },
            "mass": {
              "description": "硝材の要素だけの質量 [g]（密度はカタログ）。既定は体積",
              "type": [
                "boolean",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "surf": {
              "description": "最初の面の番号（面 i の要素は面 i と i + 1 の間、空気の間も含む）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "description": "最後の面（既定 surf）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "volume",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "tsag の項（面 surf の、点から傾けた向きに測った矢高）",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "flat": {
              "description": "面をクリア半径の外で縁の矢高のまま平らにする（玉の半径がクリア半径より大きい面だけ。既定 false）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "point": {
              "description": "測る点の面の局所座標 [x, y, z]（既定 [0, 0, 0]）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": [
                "array",
                "null"
              ]
            },
            "surf": {
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "tilt": {
              "description": "測る向き: z 軸を x・y・z 軸まわりに回す角 [deg]（既定 [0, 0, 0]）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 3,
              "minItems": 3,
              "type": [
                "array",
                "null"
              ]
            },
            "type": {
              "const": "tsag",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "bfs の項（面 surf の、削る体積が最小の最適球の量）",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "description": "量（curv・radius・vertex・depth・volume・slope・depth_rms・slope_rms）",
              "type": "string"
            },
            "rmax": {
              "description": "外側（既定 0 はクリア半径）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "rmin": {
              "description": "当てはめる半径の範囲の内側（既定 0）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "surf": {
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "bfs",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "cardinal の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "from": {
              "description": "面の範囲（既定は面 1 から像面の手前の面まで）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "description": "量（efl・f_object・f_image・focal_object・focal_image・principal_object・principal_image・anti_principal_object・\nanti_principal_image・nodal_object・nodal_image・anti_nodal_object・anti_nodal_image）。efl は空気換算の 1/パワー、\nf_* は媒質の中の焦点距離、位置は物体空間の点が面 from の頂点から、像空間の点が面 to の頂点から [レンズ単位]",
              "type": "string"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "cardinal",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "fnum の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "dir": {
              "anyOf": [
                {
                  "$ref": "#/$defs/DirName"
                },
                {
                  "type": "null"
                }
              ],
              "description": "向き（tan は瞳の y の縁、sag は x の縁の光線。既定 tan、both は書けない）"
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "fnum",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "seidel の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "q": {
              "description": "量（spha・coma・asti・fcur・dist、波面収差の係数 W040・W131・W222・W220・W311 [波]）",
              "type": "string"
            },
            "surf": {
              "description": "面の番号（0・省略は全部の面の和）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "seidel",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "distortion の項",
          "properties": {
            "abcd": {
              "description": "予測に使う [A, B, C, D]（基準の視野での J の代わり。OpticStudio の DISA）",
              "items": {
                "format": "double",
                "type": "number"
              },
              "maxItems": 4,
              "minItems": 4,
              "type": [
                "array",
                "null"
              ]
            },
            "absolute": {
              "description": "true で実像高 − 予測の像高 [レンズ単位]、false・省略で予測の像高に対する %",
              "type": [
                "boolean",
                "null"
              ]
            },
            "coef": {
              "description": "a・b・c・d で、基準の視野でのグリッド歪曲の係数 J（∂(x, y)/∂t の [[a, b], [c, d]]）を値にする（OpticStudio の ABCD）",
              "type": [
                "string",
                "null"
              ]
            },
            "component": {
              "description": "歪曲の向き: radial（既定）・x・y（x・y は差の成分と、予測の変位の成分に対する %。OpticStudio の DISA の Data）",
              "type": [
                "string",
                "null"
              ]
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "anyOf": [
                {
                  "$ref": "#/$defs/FieldRef"
                },
                {
                  "type": "null"
                }
              ],
              "description": "視野（省略は正規化視野 [0, 1]）。peak では軸上からこの視野までの線の上の最大"
            },
            "ftheta": {
              "description": "true で校正した f-θ 歪曲: y の向きの視野で、主光線の高さに原点を通る y = cθ を当てたずれの絶対値の最大\n（角度の視野だけ。OpticStudio の DISC）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "peak": {
              "description": "true で軸上から field までの絶対値の最大（OpticStudio の DIMX）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "reference": {
              "anyOf": [
                {
                  "$ref": "#/$defs/FieldRef"
                },
                {
                  "type": "null"
                }
              ],
              "description": "基準の視野（省略は軸上で、予測は近軸主光線の倍率）。ほかの視野では、その視野の主光線の点と、そこでの像の点の\n角の tan（物体高の視野では高さ）による微分から線形に予測する（OpticStudio の DISG）"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "distortion",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "energy の項（包囲エネルギー）",
          "properties": {
            "airy": {
              "description": "geometric の円で、円の割合にエアリー像の円の割合をかけるか（既定 false）",
              "type": [
                "boolean",
                "null"
              ]
            },
            "center": {
              "description": "中心: chief（既定、主波長の主光線）・centroid（光量の重心）・vertex（像面の原点）・middle（点の広がりの中心）",
              "type": [
                "string",
                "null"
              ]
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "fraction_at": {
              "description": "値にする割合の形の大きさ [レンズ単位]。size_at と片方だけ",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "method": {
              "description": "光量の分布: geometric（既定、瞳の格子の光線）・fft（FFT の回折 PSF）・huygens（Huygens PSF）",
              "type": [
                "string",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "瞳の格子（geometric は既定 256、fft・huygens は自動）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "shape": {
              "description": "形: circle（既定、半径）・x・y（帯の半幅）・square（正方形の半幅）",
              "type": [
                "string",
                "null"
              ]
            },
            "size_at": {
              "description": "値にする大きさの光量の割合（0〜1）。fraction_at と片方だけ",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "energy",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は重みのある全波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "strehl の項（ストレール比）",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "瞳の格子（省略は自動）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "strehl",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は重みのある全波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "illum の項（像点の照度）",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "$ref": "#/$defs/FieldRef"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "n": {
              "description": "瞳の縁の点の数（既定 128）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "q": {
              "description": "量: relative（軸上の像点に対する相対照度）・fno（実効 F ナンバー）",
              "type": "string"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "illum",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "field",
            "q"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "param の項（系のパラメータの値）",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "name": {
              "description": "パラメータの名前（変数と同じ書き方: \"6.t\"・\"3.c\"・\"wave1\"・\"aper\" など）。項の構成の系の値で、多重構成の値は\n`config` で選ぶ",
              "type": "string"
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "param",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "name"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "longitudinal の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標 [レンズ単位]（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "longitudinal",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号。null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "wave2": {
              "description": "差をとる波長の番号（値は wave2 の距離 − wave の距離、軸上色収差）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            },
            "zone": {
              "description": "瞳の帯 0〜1（0・省略は近軸周辺光線）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "lateral_color の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標 [レンズ単位]（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "lateral_color",
              "type": "string"
            },
            "wave": {
              "description": "波長の番号（値は wave2 の高さ − wave の高さ）。wave の null・省略は主波長",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "wave2": {
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "wave2"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "semi の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "surf": {
              "description": "面の範囲（to の既定は surf）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "target": {
              "description": "目標（min か max が要る。面ごとに半直径と比べてはみ出しを足す）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "to": {
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "type": {
              "const": "semi",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "surf"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "zplm の項",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "data": {
              "description": "OPTRETURN の番号（既定 0）",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "default_dirs": {
              "description": "false なら既定の場所（LENSBENCH_MACROS・今のフォルダ）を探さない",
              "type": [
                "boolean",
                "null"
              ]
            },
            "file": {
              "description": ".ZPL のパス",
              "type": [
                "string",
                "null"
              ]
            },
            "hx": {
              "description": "PVHX・PVHY・PVPX・PVPY（既定 0）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "hy": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "macro": {
              "anyOf": [
                {
                  "$ref": "#/$defs/MacroRef"
                },
                {
                  "type": "null"
                }
              ],
              "description": "マクロの番号か名前（file とどちらか一方）"
            },
            "macro_dirs": {
              "description": "マクロを探すフォルダの並び",
              "items": {
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "px": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "py": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "zplm",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "plugin の項",
          "properties": {
            "args": {
              "description": "設定 {\"名前\": 値}"
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "field": {
              "description": "inputs の field の略"
            },
            "index": {
              "description": "その要素だけ",
              "format": "uint",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "inputs": {
              "description": "入力 {\"名前\": 数か数の並び}"
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "name": {
              "description": "登録の名前",
              "type": "string"
            },
            "output": {
              "description": "出力の名前",
              "type": "string"
            },
            "target": {
              "anyOf": [
                {
                  "$ref": "#/$defs/Nums"
                },
                {
                  "type": "null"
                }
              ],
              "description": "目標（数か出力と同じ数の並び、既定 0）"
            },
            "type": {
              "const": "plugin",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "name",
            "output"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "calc の項: 引数（数か、1 つの値の項。項には weight・config・min・max を書かない）の op − target",
          "properties": {
            "args": {
              "items": {
                "$ref": "#/$defs/CalcArgSpec"
              },
              "type": "array"
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "op": {
              "$ref": "#/$defs/CalcName"
            },
            "target": {
              "description": "目標（既定 0）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "type": {
              "const": "calc",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "op",
            "args"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "spread の項: 1 つの値の項 term の、すべての構成での値の最大 − 最小 − target（OpticStudio の ZTHI は厚みの項の\nspread の max）。term には weight・config・min・max を書かず、target は省いてよい",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標（target・min・max のどれかが要る）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "term": {
              "$ref": "#"
            },
            "type": {
              "const": "spread",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "term"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "diff の項: 1 つの値の項 term の、構成 a の値 − 構成 b の値 − target（光束の間の光路長の差など）。a・b は構成の\n番号（1 始まり）。term には weight・config・min・max を書かない",
          "properties": {
            "a": {
              "description": "引かれる側の構成（1 始まり）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "b": {
              "description": "引く側の構成（1 始まり）",
              "format": "uint",
              "minimum": 0,
              "type": "integer"
            },
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "target": {
              "description": "目標（省略は 0。min・max も書ける）",
              "format": "double",
              "type": [
                "number",
                "null"
              ]
            },
            "term": {
              "$ref": "#"
            },
            "type": {
              "const": "diff",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type",
            "a",
            "b",
            "term"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "コメントの行（OpticStudio の BLNK）。評価関数に入らず、項の並びを読むときに飛ばす",
          "properties": {
            "config": {
              "description": "構成の番号（1 始まり、既定 1）",
              "type": [
                "integer",
                "null"
              ]
            },
            "max": {
              "description": "値 ≤ max なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "min": {
              "description": "値 ≥ min なら残差 0（target の代わり、目標が 1 つの値の項だけ）",
              "type": [
                "number",
                "null"
              ]
            },
            "text": {
              "description": "コメントの文",
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "const": "comment",
              "type": "string"
            },
            "weight": {
              "description": "重み（既定 1）",
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        }
      ],
      "title": "TermSpec"
    },
    "Xy": {
      "description": "重心の向き",
      "enum": [
        "x",
        "y"
      ],
      "type": "string"
    },
    "ZernName": {
      "description": "Zernike の並び",
      "oneOf": [
        {
          "const": "fringe",
          "description": "Fringe（既定）",
          "type": "string"
        },
        {
          "const": "standard",
          "description": "Standard",
          "type": "string"
        }
      ]
    }
  },
  "$id": "https://masa-iwm.github.io/lensbench/schema/v0.11/terms.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "$ref": "#/$defs/TermSpec"
    },
    {
      "items": {
        "$ref": "#/$defs/TermSpec"
      },
      "type": "array"
    }
  ],
  "title": "lensbench 評価関数の項（1 つか並び）"
}
