{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://raw.githubusercontent.com/kit-data-manager/Metadata-Schemas-for-Materials-Science/main/TEM/TEM_schema.json",
  "type": "object",
  "description": "Note: The purpose of this JSON Schema is to provide description of a transmission electron microscopy (TEM) measurement. The cardinality of all properties are either defined as required or optional and wherever possible a list of controlled vocabularies is provided. Also each property is labelled to indicate if it is automatically extractable (AE) or not automatically extractable (NAE). Note that some of the items which are of the type - object might have some properties which are AE and some others which are NAE, so the overall automatic extractability of these objects would be given as NAE. The automatic extractability of the individual properties of dimensional quantities are, on the contrary, is not always possible to be labelled in the definition, as these are repeated in multiple instances, with each instance having its own automatic extractability. Contributors: Ali Ahmadian (KIT -- INT), Carina B. Maliakkal (KIT -- INT), Christian Kübel (KIT -- INT), Dorothee-Vinga Szabo (KIT -- INT), Di Wang (KIT -- INT), Maximilian Töllner (KIT -- INT), Reetu Elza Joseph (KIT -- SCC), Regina Ciancio (CNR-IOM- Trieste), Rossella Aversa (KIT -- SCC), Sabine Schlabach (KIT -- INT), Shyam Chethala Neelakandhan (KIT -- INT), Xiaoke Mu (KIT -- INT), Yuting Dai (KIT -- INT).",
  "properties": {
    "technique": {
      "type": "string",
      "description": "(Required, AE) - Any experimental, theoretical or computational method used during Data Acquisition or during any of the processes included in the Data Analysis Lifecycle to acquire, process or analyse Research Data about a System or a set of them with an Instrument, which is used to generate this metadata."
    },
    "measurementPurpose": {
      "type": "string",
      "description": "(Required, NAE) - Measurement is experimental Data Acquisition, typically performed on a Sample using an experimental Technique. It may also be performed during Fabrication or Sample Preparation, e.g., to characterise the intermediate stages and/or the final resulting Precursor(s) or Sample(s), respectively. A Measurement may require the use of Consumables. The purpose of the measurement needs to be selected from a controlled list - assessment (to given categories or values), completeness check (presence or absence of given properties), exploratory (routine check of known properties),feasibility (quick check, rough estimate), high quality measurement (precise, careful treatment), test specific hypothesis (focus only on given aspects)",
      "enum": [
        "assessment (to given categories or values)",
        "completeness check (presence or absence of given properties)",
        "correlative characterization (dedicated sample treatment to emphasise given features)",
        "exploratory (routine check of known properties)",
        "feasibility (quick check, rough estimate)",
        "high quality measurement (precise, careful treatment)",
        "test specific hypothesis (focus only on given aspects)"
      ]
    },
    "measurementDescription": {
      "type": "string",
      "description": "(Optional, NAE) - Description about the measurement."
    },
    "equipment": {
      "type": "string",
      "description": "(Optional, NAE) - Any kind of physical or virtual item, device, machine or other tools used to perform one or more Fabrication(s), Sample Preparation(s), Model Preparation(s), Data Acquisition(s) and/or any of the processes included in the Data Analysis Lifecycle. Usually, the Equipment is located in a Laboratory hosted by an Institution and/or can be virtually or remotely accessed. Equipment is usually an investment. According to this definition, an Instrument is a particular type of Equipment."
    },
    "consumables": {
      "type": "array",
      "minItems": 1,
      "description": "(Optional, NAE) - Auxiliary entity used during Fabrication, Sample Preparation or Measurement which has a limited time capacity or is limited in its number of uses before it is disposed of, necessary to the process itself and normally bought from third party manufacturers. Examples are: gloves, syringes, wipes, etching solutions, glass slides, spatulas, weighing paper, two-sided tape.",
      "items": {
        "type": "string"
      }
    },
    "parents": {
      "type": "array",
      "minItems": 1,
      "description": "(Required, NAE) - Parents of this metadata like the metadata document of the sample with which the measurement was performed.",
      "items": {
        "type": "object",
        "properties": {
          "parentType": {
            "type": "string",
            "description": "(Required, NAE) - Type of the parent. If no parent data is availbale, select *not applicable*.",
            "enum": [
              "not applicable",
              "sample"
            ],
            "default": "sample"
          },
          "parentReferenceType": {
            "type": "string",
            "description": "(Optional, NAE) - Type of the parent reference.",
            "enum": [
              "plain text",
              "external URL",
              "MetaStore URI"
            ],
            "default": "MetaStore URI"
          },
          "parentReference": {
            "type": "string",
            "description": "(Optional, NAE) - A link or relative reference to the parent in the form of a URI - reference.",
            "format": "uri-reference"
          }
        },
        "required": [
          "parentType"
        ],
        "if": {
          "properties": {
            "parentType": {
              "not": {
                "const": "not applicable"
              }
            }
          }
        },
        "then": {
          "required": [
            "parentReferenceType",
            "parentReference"
          ]
        }
      }
    },
    "entryID": {
      "$ref": "#/$defs/identifier",
      "description": "(Optional, NAE) - Identifier of the metadata entry usually provided by the project or the laboratory."
    },
    "measurementTitle": {
      "type": "string",
      "description": "(Required, AE) - Extended title of the measurement, which could also be the file name."
    },
    "startTime": {
      "type": "string",
      "description": "(Required, NAE) - Start time of the measurement in the ISO 8601 format YYYY-MM-DDThh:mm:ss.sss.",
      "pattern": "^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z?)$"
    },
    "endTime": {
      "type": "string",
      "description": "(Required, AE) - End time of the measurement in the ISO 8601 format YYYY-MM-DDThh:mm:ss.sss.",
      "pattern": "^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z?)$"
    },
    "program": {
      "$ref": "#/$defs/program",
      "description": "(Required, AE) - Details concerning the program (or software) used for aquisition."
    },
    "revision": {
      "$ref": "#/$defs/revision",
      "description": "(Optional, NAE) - Details concerning any revision to the document due to e.g. re-calibration, reprocessing, new analysis, new instrument definition format."
    },
    "user": {
      "$ref": "#/$defs/user",
      "description": "(Required, NAE)- The contact information of the user responsible for the measurement."
    },
    "instrument": {
      "$ref": "#/$defs/instrumentDetails",
      "description": "(Required, NAE)- Details concerning the instrument settings. Instrument is a physical or virtual identifiable piece of Equipment used to perform a Data Acquisition and to generate Raw Data. The Instrument is located in a Laboratory hosted by an Institution and/or can be virtually or remotely accessed. A virtual Instrument may be any computational resource or HPC infrastructure (cloud infrastructure or supercomputer) needed to perform Calculations or Simulations."
    }
  },
  "required": [
    "title",
    "technique",
    "definition",
    "parents",
    "measurementPurpose",
    "startTime",
    "endTime",
    "program",
    "user",
    "instrument"
  ],
  "$defs": {
    "identifier": {
      "type": "object",
      "description": "(Optional, NAE) - Details of an identifier element",
      "additionalProperties": false,
      "properties": {
        "identifierValue": {
          "type": "string",
          "description": "(Optional, NAE) - a string containing the value of an identifier."
        },
        "identifierType": {
          "type": "string",
          "description": "(Optional, NAE) - type of the identifier to be chosen from a controlled list of values -*ROR *GRID *ISNI *URL *DOI *Handle *Internal.",
          "enum": [
            "ROR",
            "GRID",
            "ISNI",
            "URL",
            "DOI",
            "Handle",
            "Internal"
          ]
        }
      }
    },
    "program": {
      "type": "object",
      "description": "(Optional, NAE) - Details concerning the program (or software) used for aquisition.",
      "additionalProperties": false,
      "properties": {
        "programName": {
          "type": "string",
          "description": "(Optional, AE) - Name of the program (or software) used for acquisition of datatype string."
        },
        "programVersion": {
          "type": "string",
          "description": "(Optional, AE)- Program (or software) version number of datatype string."
        }
      }
    },
    "revision": {
      "type": "object",
      "additionalProperties": false,
      "description": "(Optional, NAE) - Details concerning any revision to the xml document due to e.g. re-calibration, reprocessing, new analysis, new instrument definition format.",
      "properties": {
        "revisonID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier of the file."
        },
        "revisionComment": {
          "type": "string",
          "description": "(Optional, NAE)- any comments to the revision of the datatype string."
        }
      }
    },
    "user": {
      "type": "object",
      "additionalProperties": false,
      "description": "Lists the contact information of the user responsible for the measurement.",
      "properties": {
        "userName": {
          "type": "string",
          "description": "(Required, NAE) - the full name of the user preferrably written in the order (familyName, givenName) defined to be of the datatype string."
        },
        "givenName": {
          "type": "string",
          "description": "(Optional, NAE)-Given name (first name) of the user."
        },
        "familyName": {
          "type": "string",
          "description": "(Optional, NAE) - Family name or last name of the user."
        },
        "role": {
          "type": "string",
          "description": "(Optional, NAE) - Role of the user to be selected from an enumerated list - *Data Curator *Instrument Scientist *Principal Investigator *Project Member *Research User *Site Leader *Work Package Leader.",
          "enum": [
            "Data Curator",
            "Instrument Scientist",
            "Team Leader",
            "Team Member"
          ]
        },
        "affiliation": {
          "$ref": "#/$defs/institutionDetails",
          "description": "(Optional, NAE) - Details of the institution to which the user is affiliated."
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "(Optional, NAE) - Email of the userof datatype string (only valid email-ids are acceptable)."
        },
        "ORCID": {
          "type": "string",
          "description": "(Optional, NAE) - Open Researcher and Contributor ID expressed as a URI.",
          "pattern": "^https://orcid\\.org/[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[X0-9]{1}$"
        }
      },
      "required": [
        "userName"
      ]
    },
    "institutionDetails": {
      "type": "object",
      "additionalProperties": false,
      "description": "Details of the institution to which the user is affiliated.",
      "properties": {
        "institutionName": {
          "type": "string",
          "description": "(Optional, NAE) - Full name of an institution of datatype string."
        },
        "institutionAcronym": {
          "type": "string",
          "description": "(Optional, NAE) - Acronym of the institution of datatype string. Note that authors often cite with acronyms, so this information can be important in matching a query."
        },
        "institutionDepartment": {
          "type": "string",
          "description": "(Optional, NAE)- The department within an institution of datatype string."
        },
        "institutionID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier pertaining to the institution."
        }
      }
    },
    "distanceDetails": {
      "type": "object",
      "description": "Describes a distance, size or length.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required) Distance, size or length expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "description": "(Optional) - the unit of the value to be selected from a controlled list (nm, µm, mm, cm, m, N.A.) of datatype string. If the distance or length is expressed as a relative number, the unit should be selected as 'N.A.' meaning 'not applicable' as the value is then dimensionless.",
          "enum": [
            "nm",
            "µm",
            "mm",
            "cm",
            "m",
            "N.A."
          ]
        },
        "qualifier": {
          "type": "string",
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string.",
          "enum": [
            "max",
            "min",
            "average"
          ]
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value,(choice between an absolute uncertainty or relative uncertainty)."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "value",
        "unit"
      ]
    },
    "uncertaintyDetails": {
      "type": "object",
      "description": "Describes an uncertainty",
      "additionalProperties": false,
      "properties": {
        "uncertaintyType": {
          "type": "string",
          "description": "(Required, NAE) - type of the uncertainty to be chosen between absolute or relative of datatype string.",
          "enum": [
            "absolute",
            "relative"
          ]
        },
        "value": {
          "type": "number",
          "description": "(Required, NAE) -  value of the uncertainty expressed as a number."
        }
      },
      "required": [
        "value",
        "unit"
      ]
    },
    "eBeamSensitivityDetails": {
      "type": "object",
      "description": "Describes the details concerning the type of sensitivity to the electron beam.",
      "additionalProperties": false,
      "properties": {
        "radiolysis": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - to be set as true if the material undergoes radiolysis upon interaction with the electron beam (of the datatype boolean)."
        },
        "knockON": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - to be set as true if the material undergoes knockON upon interaction with the electron beam (of the datatype boolean)."
        },
        "optimizedIncidentEnergy": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Optional, NAE) - The optimized incident energy of electrons selected to reduce effect of the e-beam on the sample usually expressed in keV."
        },
        "comment": {
          "type": "string",
          "description": "(Optional, NAE) - To include any relevant details about the e-beam contamination of the sample of the datatype string."
        },
        "beamContaminated": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - to be set as true is the sample is already contaminated by the e-beam of the datatype boolean."
        }
      }
    },
    "iBeamSensitivityDetails": {
      "type": "object",
      "description": "Describes the details concerning the type of sensitivity to the ion beam.",
      "properties": {
        "GaSensitive": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - to be set as true if the material is sensitive to Ga ions (of the datatype boolean)."
        },
        "HeSensitive": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - to be set as true if the material is sensitive to He ions (of the datatype boolean)."
        },
        "other": {
          "type": "string",
          "description": "(Optional, NAE) - option to include any other type of ions other than Ga or He (of the datatype string)."
        }
      }
    },
    "plasmaCleaningDetails": {
      "type": "object",
      "description": "(Optional, NAE) -  Details of the plasma cleaning procedure if performed.",
      "properties": {
        "gasComposition": {
          "type": "string",
          "description": "(Optional, NAE) - Description of the composition of gases used for plasma cleaning (of the datatype string)."
        },
        "power": {
          "$ref": "#/$defs/powerDetails",
          "description": "(Optional, NAE) - power used for plasma cleaning."
        },
        "percentPower": {
          "type": "number",
          "description": "(Optional, NAE) - percentage (out of 100) of the total power of the plasma cleaning device used (of the datatype number)."
        },
        "duration": {
          "$ref": "#/$defs/timeDetails",
          "description": "(Optional, NAE) - Duration of time (in seconds) for which plasma cleaning is performed."
        },
        "noOfCycles": {
          "type": "number",
          "description": "(Optional, NAE) - Number of cycles of plasma cleaning performed, of datatype integer."
        }
      }
    },
    "powerDetails": {
      "type": "object",
      "description": "Describes a power.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, NAE) - The power expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "description": "(Required, NAE) - the unit of the value to be selected from a controlled list (mW, W, kW, typical unit - W) of datatype string.",
          "enum": [
            "nW",
            "µW",
            "mW",
            "W",
            "kW",
            "GW"
          ]
        },
        "qualifier": {
          "type": "string",
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string.",
          "enum": [
            "max",
            "min",
            "average"
          ]
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, (choice between absolute uncertainty or relative uncertainty)."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "value",
        "unit"
      ]
    },
    "instrumentDetails": {
      "type": "object",
      "additionalProperties": false,
      "description": "Details giving the relevant instrument settings and the collection of the components of the instrument.",
      "properties": {
        "instrumentName": {
          "type": "string",
          "description": "(Required, AE) - Name of the instrument of datatype string."
        },
        "instrumentID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier for the instrument."
        },
        "instrumentManufacturer": {
          "$ref": "#/$defs/manufacturerDetails",
          "description": "(Optional, AE) - details like manufacturer name, model name and manufacturer ID, grouped together."
        },
        "additionalAttachments": {
          "type": "string",
          "description": "(Optional, NAE) - Additional attachments or features included which is relevant for the measurement, if any."
        },
        "setMagnification": {
          "type": "number",
          "description": "(Required, AE) - The magnification set for the diffraction pattern or image (of the datatype number)."
        },
        "actualMagnification": {
          "type": "number",
          "description": "(Optional, AE) - The actual magnification observed which might differ from the set magnification (of the datatype number)."
        },
        "driftCorrectionApplied": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, AE) - To bet set as true if  drift correction is applied to compensate for xy drift (of the datatype boolean)."
        },
        "setCameraLength": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, AE) - the effective distance or magnification between the specimen and the detector plane."
        },
        "actualCameraLength": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - The actual camera length as opposed to the set camera length."
        },
        "operationMode": {
          "type": "string",
          "enum": [
            "TEM",
            "STEM",
            "4D-STEM"
          ],
          "description": "(Required, AE) - to select the operation mode between TEM, STEM or 4D-STEM (of the datatype string)."
        },
        "4DSTEMType": {
          "type": "string",
          "enum": [
            "Centre of Mass",
            "Strain Mapping",
            "Ptychography",
            "Automated Crystal Orientation",
            "Paired Distribution Function",
            "Virtual Detector"
          ],
          "description": "(Optional/Required, NAE) - to select the type of 4D-STEM measurement from a controlled list (of the datatype string). If the operationMode is selected as '4D-STEM', this property is required."
        },
        "objectiveLensMode": {
          "type": "string",
          "enum": [
            "HM",
            "LM",
            "SA",
            "Lorentz",
            "normal"
          ],
          "description": "(Optional, NAE) - to select the objective lens mode used from a controlled list (of the datatype string)."
        },
        "illuminationMode": {
          "type": "string",
          "enum": [
            "probe",
            "parallel"
          ],
          "description": "(Optional, NAE) - to select the illumination mode used from a controlled list (of the datatype string)."
        },
        "probeMode": {
          "type": "string",
          "enum": [
            "micro probe mode",
            "nano probe mode"
          ],
          "description": "(Optional, AE) - to select the type of probe mode used (nano probe mode or micro probe mode; of the datatype string)."
        },
        "imageMode": {
          "type": "string",
          "enum": [
            "TEM",
            "STEM",
            "SAD",
            "EDS",
            "NBD",
            "CBED"
          ],
          "description": "(Required, NAE) - to select the image mode out of a controlled list of strings consisiting of * TEM * STEM * Selected Area Diffraction (SAD) * Energy-Dispersive X-Ray Spectroscopy (EDXS) * Scanning Transmission Electron Microscopy (STEM) * Nano-Beam Diffraction (NBD) * Convergent Beam Electron Diffraction (CBED)."
        },
        "fieldMode": {
          "type": "string",
          "enum": [
            "dark field",
            "bright field"
          ],
          "description": "(Optional, AE) - to select between dark field and bright field modes (of the datatype string)."
        },
        "spotSize": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, NAE) - Spotsize (diameter) of the beam or a parameter (integer) indicating the spread of the beam entering the aperture such that a lower number means more electrons are hitting the sample (alternatively it is the size of the first spot formed by the beam after being emitted from the gun); it is the size of the first spot formed by the beam after being emitted from the gun."
        },
        "defocus": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, AE) - Value indicating how far the sample is away from the focus of the electron beam."
        },
        "probeSize": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, NAE) - Size of the beam at the sample. Typical unit - nm."
        },
        "chamberPressure": {
          "$ref": "#/$defs/pressureDetails",
          "description": "(Required, AE) - Pressure maintained inside the chamber (in which the sample is housed) during the measurement."
        },
        "stage": {
          "$ref": "#/$defs/stageDetails",
          "description": "(Required, AE) - Details pertaining to the stage."
        },
        "source": {
          "$ref": "#/$defs/sourceDetails",
          "description": "(Required, NAE) - Details pertaining to the source of the electron beam."
        },
        "aperture": {
          "$ref": "#/$defs/apertureDetails",
          "description": "(Optional, AE) - Details pertaining to the apertures used."
        },
        "lens": {
          "$ref": "#/$defs/lensDetails",
          "description": "(Required, AE) - Details pertaining to the lenses used."
        },
        "scan": {
          "$ref": "#/$defs/scanDetails",
          "description": "(Required, AE) - Details pertaining to the scanning."
        },
        "ASTAR": {
          "$ref": "#/$defs/ASTARdetails",
          "description": "(Optional, AE) - Details about an ASTAR attachment used with the microscope for orientation-phase imaging."
        },
        "EFTEM": {
          "$ref": "#/$defs/EFTEMdetails",
          "description": "(Optional, AE) -  Details about Energy Filtered TEM (EFTEM) Mode."
        },
        "monochromator": {
          "$ref": "#/$defs/monochromatorDetails",
          "description": "(Optional, AE) - Details pertaining to the monochromator."
        },
        "detector": {
          "$ref": "#/$defs/detectorDetails",
          "description": "(Required, NAE) - Details pertaining to the detector used."
        }
      },
      "required": [
        "instrumentName",
        "setMagnification",
        "setCameraLength",
        "operationMode",
        "imageMode",
        "spotSize",
        "defocus",
        "source",
        "stage",
        "aperture",
        "lens",
        "detector"
      ],
      "if": {
        "properties": {
          "operationMode": {
            "const": "4D-STEM"
          }
        }
      },
      "then": {
        "required": [
          "4DSTEMType"
        ]
      }
    },
    "manufacturerDetails": {
      "type": "object",
      "description": "Details like the name of the manufacturer and model of the instrument and an identifier.",
      "additionalProperties": false,
      "properties": {
        "manufacturerName": {
          "type": "string",
          "description": "(Optional, AE) - Name of the manufacturer of datatype string."
        },
        "modelName": {
          "type": "string",
          "description": "(Optional, AE) - Model of the instrument of datatype string."
        },
        "manufacturerID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier for the manufacturer."
        }
      }
    },
    "precessionDetails": {
      "type": "object",
      "description": "(Optional, AE) - Details about the precession.",
      "additionalProperties": false,
      "properties": {
        "precessionAngle": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, AE) - Angle of the precession."
        },
        "precessionFrequency": {
          "$ref": "#/$defs/frequencyDetails",
          "description": "(Optional, AE) - Frequency of the precession."
        },
        "beamScanAlignment": {
          "type": "string",
          "description": "(Optional, AE) - Description of how the beam scan is aligned, of datatype string."
        },
        "precessionAlignment": {
          "type": "string",
          "description": "(Optional, AE) - Description of how precession is aligned, of datatype string."
        },
        "precessionOn": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set to True if precession is turned on."
        },
        "descanOn": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set to True if descan is turned on."
        },
        "precessionsPerFrame": {
          "type": "number",
          "description": "(Optional, AE) - Number of precessions per frame, of datatype number."
        },
        "interactionMode": {
          "type": "string",
          "description": "(Optional, AE) - Manual or Auto interaction mode.",
          "enum": [
            "Auto",
            "Manual"
          ]
        },
        "Optimization": {
          "type": "object",
          "description": "(Optional, AE) - Description of the optimization done in terms of x and y compensation points.",
          "additionalProperties": false,
          "properties": {
            "xCompensationPoints": {
              "type": "number",
              "description": "(Optional, AE) - Number of compensation points in x dimension."
            },
            "yCompensationPoints": {
              "type": "number",
              "description": "(Optional, AE) - Number of compensation points in y dimension."
            }
          }
        },
        "diffraction": {
          "type": "object",
          "description": "(Optional, AE) - Settings of the diffraction.",
          "additionalProperties": false,
          "properties": {
            "frameSize": {
              "type": "number",
              "description": "(Optional, AE) - Size of the frame eg:- 512, 256, 128.",
              "default": 512,
              "enum": [
                1024,
                512,
                256,
                128
              ]
            },
            "frameTime": {
              "$ref": "#/$defs/timeDetails",
              "description": "(Optional, AE) - Time per frame, typical unit - s."
            },
            "cameraLength": {
              "$ref": "#/$defs/distanceDetails",
              "description": "(Optional, AE) - Distance which is present between the specimen surface and the detector plane."
            }
          }
        },
        "thresholdOverlayEnabled": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set to true if threshold overlay is enabled."
        },
        "scanning": {
          "type": "object",
          "description": "(Optional, AE) - Description of scanning with respect to precession.",
          "additionalProperties": false,
          "properties": {
            "frameSize": {
              "type": "number",
              "description": "(Optional, AE) - Size of the frame eg:- 512, 256, 128.",
              "default": 512,
              "enum": [
                1024,
                512,
                256,
                128
              ]
            },
            "rotation": {
              "description": "(Optional -AE) - Angle of rotation.",
              "$ref": "#/$defs/angleDetails"
            },
            "virtualSTEMSignal": {
              "type": "string",
              "description": "(Optional -AE) - Is the virtual STEM signal inside or outside?",
              "enum": [
                "inside",
                "outside"
              ]
            }
          }
        },
        "focus": {
          "type": "object",
          "description": "(Optional, AE) - Description of focus with respect to precession.",
          "additionalProperties": false,
          "properties": {
            "frameSize": {
              "type": "number",
              "description": "(Optional, AE) - Size of the frame eg:- 512, 256, 128.",
              "default": 512,
              "enum": [
                1024,
                512,
                256,
                128
              ]
            },
            "frameTime": {
              "$ref": "#/$defs/timeDetails",
              "description": "(Optional, AE) - Time per frame, typical unit - s."
            }
          }
        },
        "capture": {
          "type": "object",
          "description": "(Optional, AE) - Description of capture with respect to precession.",
          "additionalProperties": false,
          "properties": {
            "frameSize": {
              "type": "number",
              "description": "(Optional, AE) - Size of the frame eg:- 512, 256, 128.",
              "default": 512,
              "enum": [
                1024,
                512,
                256,
                128
              ]
            },
            "frameTime": {
              "$ref": "#/$defs/timeDetails",
              "description": "(Optional, AE) - Time per frame, typical unit - s."
            }
          }
        },
        "scanRange": {
          "type": "object",
          "description": "(Optional - AE) - Details regarding STEM with respect to precession.",
          "additionalProperties": false,
          "properties": {
            "alignmentPlatform": {
              "type": "boolean",
              "description": "(Optional - AE) - To be set to true if alignment platform is used."
            },
            "STEMMagnification": {
              "type": "number",
              "description": "(Optional -AE) - Set Magnification of the STEM."
            },
            "scanrotation": {
              "$ref": "#/$defs/angleDetails",
              "description": "(Optional - AE) - Angle of scan rotation, typical unit - degree."
            }
          }
        }
      }
    },
    "frequencyDetails": {
      "type": "object",
      "description": "Describes a frequency.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The frequency expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "Hz",
            "kHz",
            "MHz"
          ],
          "description": "(Required, AE) - The unit of the value to be selected from a controlled list (Hz, kHz, default value - Hz) of datatype string."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min), default value - max) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "pressureDetails": {
      "type": "object",
      "description": "Describes a pressure measurement.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The pressure expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "Pa",
            "hPa",
            "kPa",
            "MPa",
            "GPa",
            "mbar",
            "bar",
            "psi"
          ],
          "description": "(Required, AE) - The unit of the value to be selected from a controlled list (Pa, hPa, kPa, MPa, GPa, mbar, bar, psi, default value - Pa) of datatype string."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min)."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "EFTEMdetails": {
      "type": "object",
      "description": "(Optional, AE) - Details about energy filtered transmission electron microscopy (EFTEM).",
      "additionalProperties": false,
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set to true if EFTEM mode is enabled."
        },
        "zeroEnergyLoss": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set to true if energy loss is set at zero."
        },
        "setEnergyLoss": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Optional, AE) - The value of the specific non-zero energy loss selected for the filter."
        },
        "inColumnFilter": {
          "type": "object",
          "description": "(Optional, AE) - Description about the in-column filter used between the intermediate and projector lenses.",
          "additionalProperties": false,
          "properties": {
            "inColumnFilterType": {
              "description": "(Optional, AE) - Type of the in-column filter used. E.g. JEOL omega filter",
              "type": "string"
            },
            "slitOffset": {
              "description": "(Optional, AE) - Offset used to adjust the slit position when an omega filter allows only positive energy shifts.",
              "$ref": "#/$defs/energyDetails"
            },
            "slitWidth": {
              "description": "(Optional, AE) - Slit width in electron volts (It also represents a physical slit opening in µm).",
              "$ref": "#/$defs/energyDetails"
            }
          }
        },
        "postColumnFilter": {
          "type": "object",
          "description": "(Optional, NAE) - Details about a post column filter like the gatan image filter (GIF) used with EFTEM.",
          "additionalProperties": false,
          "properties": {
            "energyOffset": {
              "description": "(Optional, NAE) - The centroid or the middle of the energy range used for forming the EFTEM. This offset is normally expressed in eV.",
              "$ref": "#/$defs/energyDetails"
            },
            "slitWidth": {
              "description": "(Optional, NAE) - The width of the slit used in EFTEM normally expressed in eV.",
              "$ref": "#/$defs/energyDetails"
            },
            "matchPixelSizeON": {
              "type": "boolean",
              "description": "(Optional, NAE) - To be set to true if the function to adjust the magnification to minimize the change in pixel size when switching between EFTEM and regular magnification is enabled."
            },
            "matchIntensityON": {
              "type": "boolean",
              "description": "(Optional, NAE) - To be set to true if the program changes the beam intensity when switching between regular and EFTEM magnifications, so as to maintain a constant electron flux per camera pixel."
            }
          }
        }
      }
    },
    "monochromatorDetails": {
      "type": "object",
      "description": "(Optional, AE) - Details about the monochromator if it is used in the measurement.",
      "additionalProperties": false,
      "properties": {
        "monochromatorActive": {
          "type": "boolean",
          "default": false,
          "description": "(Required, AE) - To be set as true if the monochromator is active in the measurement (of the datatype boolean)"
        },
        "monoShiftX": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Required, AE) - Voltage shift applied in the X dimension."
        },
        "monoShiftY": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Required, AE) - Voltage shift applied in the Y dimension."
        },
        "monoStigmatorX": {
          "type": "number",
          "description": "(Required, AE) - Strength of monochromator stigmator X applied to correct for astigmatism (of the datatype number)."
        },
        "monoStigmatorY": {
          "type": "number",
          "description": "(Required, AE) - Strength of monochromator stigmator Y applied to correct for astigmatism (of the datatype number)."
        },
        "monoFocus": {
          "type": "number",
          "description": "(Required, AE) - Value of the mono focus used by the monochromator (of the datatype number)."
        },
        "selectedSlitNo": {
          "type": "number",
          "description": "(Optional, AE) - Serial number of the selected slit (of the datatype number)."
        },
        "monoPotential": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - Voltage (potential) applied to the monochromator."
        },
        "monoExcitation": {
          "type": "number",
          "description": "(Optional, AE) - A number which indicates how sensitive the monochromator is (of the datatype number)."
        }
      },
      "required": [
        "monochromatorActive",
        "monoShiftX",
        "monoShiftY",
        "monoStigmatorX",
        "monoStigmatorY",
        "monoFocus"
      ]
    },
    "voltageDetails": {
      "type": "object",
      "description": "describes a voltage.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The voltage expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "µV",
            "mV",
            "V",
            "kV",
            "MV"
          ],
          "description": "(Required, AE) - The unit of the value to be selected from a controlled list - µV, mV, V, kV, MV, GV (of datatype string)."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "sourceDetails": {
      "type": "object",
      "description": "Details about the electron beam source.",
      "additionalProperties": false,
      "properties": {
        "sourceName": {
          "type": "string",
          "description": "(Optional, AE) - Local name of the e-beam source of datatype string."
        },
        "sourceID": {
          "$ref": "#/$defs/identifier",
          "description": " (Optional, NAE) - Identifier for the e-beam source."
        },
        "accelerationVoltage": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Required, AE) - Voltage with which the e-beam is accelerated. Includes the voltage value, optional uncertainty, optional qualifier like max or min, optional note of the type string, and a controlled list of units from which one can be chosen - µV, mv, V, kV, MV."
        },
        "beamCurrent": {
          "$ref": "#/$defs/currentDetails",
          "description": "(Optional, NAE) - Measured current of the e-beam. Includes the current value, Optional uncertainty, Optional qualifier like max or min, Optional note of the type string, and a controlled list of units from which one can be chosen - pA, nA, µA, mA, A, kA."
        },
        "currentDensity": {
          "$ref": "#/$defs/currentDensityDetails",
          "description": "(Optional, NAE) - Current density on the filament, which also indicates the brightness of the gun with typical unit pA/cm^2."
        },
        "beamEnergy": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Optional, NAE) - Energy of the e-beam.  Includes the energy value, Optional uncertainty, Optional qualifier like max or min, Optional note of the type string, and a controlled list of units from which one can be chosen - meV, eV, keV, MeV, nJ, mJ, J, kJ, MJ."
        },
        "sourceLifetime": {
          "$ref": "#/$defs/lifetimeDetails",
          "description": "(Optional, NAE) - Lifetime of the e-beam source (typical unit - uAh) of datatype string."
        },
        "gunType": {
          "type": "string",
          "enum": [
            "normal thermal FEG",
            "extra bright FEG",
            "cold FEG",
            "LaB6",
            "W"
          ],
          "description": "(Optional, NAE) - Type of the electron gun used as source for the e-beam which is to be selected from a controlled list of values - normal thermal FEG, extra bright FEG, cold FEG, LaB6, W (of the datatype string)."
        },
        "gunLens": {
          "type": "string",
          "description": "(Optional, AE) - Serial number of the lens used in front of the electron gun (datatype string) which is a control parameter for the field emission gun (FEG)."
        },
        "extractorVoltage": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, NAE)- Extractor voltage used for the electorn gun."
        }
      },
      "required": [
        "accelerationVoltage"
      ]
    },
    "currentDetails": {
      "type": "object",
      "description": "Describes a current.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The voltage expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "pA",
            "nA",
            "µA",
            "mA",
            "A"
          ],
          "description": "(Required, AE) - Unit of the value to be selected from a controlled list - pA, nA, µA, mA, A."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of the datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "currentDensityDetails": {
      "type": "object",
      "description": "Describes a current density.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The current density expressed as an integer or floating point value of datatype number"
        },
        "unit": {
          "type": "string",
          "enum": [
            "pA/cm2",
            "nA/cm2",
            "nA/nm2",
            "µA/cm2",
            "mA/cm2",
            "A/cm2",
            "A/m2"
          ],
          "description": "(Required) - Unit of the value to be selected from a controlled list - pA/cm2, nA/cm2, nA/nm2, µA/cm2 mA/cm2, A/cm2, A/m2."
        },
        "qualifier": {
          "type": "string",
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "energyDetails": {
      "type": "object",
      "description": "Describes an energy.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required,AE) - The energy expressed as an integer or floating point value of datatype number"
        },
        "unit": {
          "type": "string",
          "enum": [
            "meV",
            "eV",
            "keV",
            "MeV",
            "nJ",
            "mJ",
            "J",
            "kJ",
            "MJ"
          ],
          "description": "(Required, AE) - Unit of the value to be selected from a controlled list - meV, eV, keV, MeV, nJ, mJ, J, kJ, MJ."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string"
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value with an option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "lifetimeDetails": {
      "type": "object",
      "description": "Describes the lifetime of a source.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The lifetime of the source expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "description": "(Required, AE) - the unit of the value (default value - µAh) of datatype string."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string"
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "stageDetails": {
      "type": "object",
      "description": "(Required, NAE) - Describes the stage settings during a measurement.",
      "additionalProperties": false,
      "properties": {
        "specimenPosition": {
          "$ref": "#/$defs/coordinateSet",
          "description": "(Required, NAE) - Gives the position of the specimen as a set of three coordinates."
        },
        "tiltAngleAlpha": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - angle by which the stage is tilted along the x axis (with the angle value, optional uncertainty, optional notes, optional qualifier and choice of units between degree and radian)."
        },
        "tiltAngleBeta": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - angle by which the stage is tilted along the y axis (with the angle value, optional uncertainty, optional notes, optional qualifier and choice of units between degree and radian)."
        },
        "rotation": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, AE) - the angle by which the stage is rotated (along the z axis) (with the angle value, optional uncertainty, optional notes, optional qualifier and choice of units between degree and radian)"
        },
        "sampleHolder": {
          "type": "object",
          "description": "(Optional, NAE) - Description of the sample holder mounted on the stage (includes holderType, holderUsed, washer1, washer2, clamper and fixingMethod).",
          "additionalProperties": false,
          "properties": {
            "holderUsed": {
              "description": "(Optional, NAE) - Name of the sample holder used.",
              "type": "string",
              "enum": [
                "FEI analytical double tilt Holder (with clamp)",
                "FEI analytical double tilt Holder (with hex-ring)",
                "Analytical Single Tilt Holder",
                "Gatan double tilt Cryo-Transfer Holder 915",
                "Gatan double-tilt Vacuum Transfer Holder 648",
                "Fishione Tomography +/- 80° single tilt",
                "Fishione Analytical Tomography +/- 80° single tilt",
                "Fishione on Axis 360° tomography holder for needle-like specimen",
                "Bruker Picoindenter (PTP) in-situ mechanical deformation",
                "Protochips \"Aduro\" in-situ heating and electrical biasing",
                "Protochips \"Fusion\" double tilt heating and electrical biasing",
                "Protochips \"Poseidon\" in-situ electrochemistry holder",
                "Protochips \"Atmoshere\" in -situ gas holder",
                "ZEPTools TEM-STM double tilt",
                "Gatan in-situ heating",
                "Gatan Straining 654 in-situ heating and straining"
              ]
            },
            "holderName": {
              "description": "(Optional, NAE) - Specific name of the sample holder used if not available in the drop down list under holderUsed.",
              "type": "string"
            },
            "holderType": {
              "description": "(Optional, NAE) - Type of the sample holder used if this information is relevant.",
              "type": "string"
            },
            "washer1": {
              "description": "(Optional, NAE) - Material of an additional frame used for supporting/ protecting TEM lamella or a TEM sample holder.",
              "type": "string"
            },
            "washer2": {
              "description": "(Optional, NAE) - Material of an additional washer used in addition to washer1.",
              "type": "string"
            },
            "clamper": {
              "description": "(Optional, NAE) - Material of the clamper.",
              "type": "string"
            },
            "fixingMethod": {
              "description": "(Optional, NAE) - Description about the adhesive used to bond/weld specimen to grid, adhere multiple samples for TEM cross-sections, pre-coat samples prior to encapsulation and for other mounting application.",
              "type": "string"
            }
          }
        },
        "grid": {
          "$ref": "#/$defs/gridDetails",
          "description": "(Optional, NAE) - Description of the grid used to mount the sample (includes gridUsed, gridSupplier, gridTypeNo and plasmaCleaning)"
        },
        "inSituChip": {
          "$ref": "#/$defs/inSituChipDetails",
          "description": "(Optional, NAE) - Description of the inSituChip used (includes inSituChipName, inSituChipSerialNo, inSituChipAtmosphere and inSituChipGasMixture)"
        },
        "measurementConditions": {
          "type": "string",
          "description": "(Optional, NAE) - Conditions to be maintained during the measurement inside the machine (e.g., water vapor, cryogenic temperature, gas atmosphere) - of datatype string"
        }
      },
      "required": [
        "specimenPosition",
        "tiltAngleAlpha",
        "tiltAngleBeta"
      ]
    },
    "gridDetails": {
      "type": "object",
      "description": "(Optional, NAE) - Details regarding the grid used to support the sample",
      "additionalProperties": false,
      "properties": {
        "gridUsed": {
          "type": "string",
          "description": "(Optional, NAE) - Name of the grid used to be selected from a drop down list - no grid used, Holey Carbon Film on Grid, Formvar-Film on Grid, Carbon Support Film on Grid, Lacey Carbon Film on Grid, Quantifoil (please specify exact Type), Cu- / Au- / Ni- / Mo -Grid without coating, FIB-Liftout Grid, Asymmetric grid for Tomo, ScienceServices, Other. If the name of the grid is not available in the controlled list, 'Other' can be selected and then specified in the field 'otherGridName'.",
          "enum": [
            "no grid used",
            "Holey Carbon Film on Grid",
            "Formvar-Film on Grid",
            "Carbon Support Film on Grid",
            "Lacey Carbon Film on Grid",
            "Quantifoil (please specify exact Type)",
            "Cu- / Au- / Ni- / Mo -Grid without coating",
            "FIB-Liftout Grid",
            "Asymmetric grid for Tomo",
            "ScienceServices",
            "Other"
          ]
        },
        "otherGridName": {
          "type": "string",
          "description": "(Optional, NAE) - Name of the grid when it is not already listed in the 'gridUsed' field."
        },
        "gridSupplier": {
          "type": "string",
          "description": "(Optional, NAE) - Name of the supplier of the grid to be selected from a controlled list - Plano, Quantifoil, ScienceServices, Other. If the name of the supplier of the grid is not available in the controlled list, 'Other' can be selected and then specified in the field 'otherGridSupplier'.",
          "enum": [
            "Plano",
            "Quantifoil",
            "ScienceServices",
            "Other"
          ]
        },
        "otherGridSupplier": {
          "type": "string",
          "description": "(Optional, NAE) - Name of the supplier of the grid when it is not already listed in the 'gridSupplier' field."
        },
        "gridTypeNo": {
          "type": "string",
          "description": "(Optional, NAE) - Type No. of TEM grid, e.g. S166-2, S166A3, etc."
        },
        "plasmaCleaning": {
          "$ref": "#/$defs/plasmaCleaningDetails",
          "description": "(Optional, NAE) - Details of the plasma cleaning performed to the grid used for supporting the sample"
        }
      },
      "required": [
        "gridUsed"
      ]
    },
    "inSituChipDetails": {
      "type": "object",
      "description": "(Optional, NAE) - Details about the inSitu Chip(MEMS), if used.",
      "additionalProperties": false,
      "properties": {
        "inSituChipName": {
          "type": "string",
          "description": "(Optional, NAE) - Name of the inSitu Chip(MEMS) to be selected from a controlled list - Electrical E-Chip 4 Point Configuration, Electrical E-Chip FIB-optimized, Electrical E-Chip Finger Configuration, Electrothermal E-Chip, Heating E-Chip, Atmosphere STEM-EDS: Configuration bottom window / top heater, Atmosphere STEM-EDS: Configuration bottom heater / top window, Atmosphere TEM: Configuration bottom window / top heater, Atmosphere TEM: Configuration bottom heater / top window, Top E-chips - Electrochemistry - Concentric Configuration, Top E-chips - Electrochemistry - FIB-Optimized E-chip, Top E-chips - Electrochemistry - Linear Configuration, Bottom E-chips - Electrochemistry.",
          "enum": [
            "Electrical E-Chip 4 Point Configuration",
            "Electrical E-Chip FIB-optimized",
            "Electrical E-Chip Finger Configuration",
            "Electrothermal E-Chip",
            "Heating E-Chip",
            "Atmosphere STEM-EDS: Configuration bottom window / top heater",
            "Atmosphere STEM-EDS: Configuration bottom heater / top window",
            "Atmosphere TEM: Configuration bottom window / top heater",
            "Atmosphere TEM: Configuration bottom heater / top window",
            "Top E-chips - Electrochemistry - Concentric Configuration",
            "Top E-chips - Electrochemistry - FIB-Optimized E-chip",
            "Top E-chips - Electrochemistry - Linear Configuration",
            "Bottom E-chips - Electrochemistry"
          ]
        },
        "inSituChipSerialNo": {
          "type": "string",
          "description": "(Optional, NAE) - Serial number of the inSitu Chip(MEMS) as a string."
        },
        "inSituChipAtmosphere": {
          "type": "string",
          "description": "(Optional, NAE) - Atmosphere maintained inside the inSituChip (e.g., temperature, pressure, water vapor, cryogenic temperature, gas atmosphere)."
        },
        "inSituChipGasMixture": {
          "type": "string",
          "description": "(Optional, NAE) - Composition of the gas mixture inside inSituChip."
        }
      }
    },
    "coordinateSet": {
      "type": "object",
      "description": "The set of xyz values describing a point of reference which is important for correlative characterization.",
      "additionalProperties": false,
      "properties": {
        "xValue": {
          "type": "number",
          "description": "(Optional, NAE) - value of the x coordinate of datatype number."
        },
        "xUncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - uncertainty in the x value."
        },
        "yValue": {
          "type": "number",
          "description": "(Optional, NAE) - value of the y coordinate of datatype number."
        },
        "yUncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - uncertainty in the y value."
        },
        "zValue": {
          "type": "number",
          "description": "(Optional, NAE) - value of the z coordinate of datatype number."
        },
        "zUncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - uncertainty in the z value."
        },
        "coordinatesUnit": {
          "type": "string",
          "enum": [
            "nm",
            "um",
            "mm",
            "cm",
            "m"
          ],
          "description": "(Optional, NAE) - unit of the coordinates (allowed units - nm, um, mm, cm, m)."
        }
      },
      "required": [
        "xValue",
        "yValue",
        "zValue",
        "coordinatesUnit"
      ]
    },
    "angleDetails": {
      "type": "object",
      "description": "Describes an angle.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The angle expressed as an integer or floating point value of datatype number"
        },
        "unit": {
          "type": "string",
          "enum": [
            "degree",
            "radian"
          ],
          "description": "(Required, AE) - the unit of the value to be selected from a controlled list (degree, radian; default value - degree) of datatype string"
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min; default value - max) of datatype string"
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number"
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string"
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "apertureDetails": {
      "type": "object",
      "description": "Describes the details of the apertures used during the measurement.",
      "additionalProperties": false,
      "properties": {
        "condenser1": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, AE) - Size of condenser1 normally expressed in micrometers."
        },
        "condenser2": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, AE) - Size of condenser2 normally expressed in micrometers."
        },
        "condenser3": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - Size of condenser3 normally expressed in micrometers (when used)"
        },
        "grating": {
          "$ref": "#/$defs/gratingDetails",
          "description": "(Optional, NAE) - Details of any additional grating used and its position."
        },
        "objectiveAperture": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - Size of the objective aperture normally expressed in micrometers."
        },
        "selectedAreaAperture": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - Size of the aperture used for selected area diffraction pattern (SADP) normally expressed in micrometers."
        }
      }
    },
    "gratingDetails": {
      "type": "object",
      "description": "Details of any additional grating used and its position.",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string",
          "description": "(Optional, NAE) - Description of a grating used in addition and where it is placed - objective or condenser (or biprism in case of holography) for beam shaping or similar use."
        },
        "position": {
          "$ref": "#/$defs/coordinateSet",
          "description": "(Optional, NAE) - Position of the additional grating."
        },
        "azimuthAngle": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, NAE) - Azimuth angle if a biprism is used as an additional grating normally expressed in degrees."
        },
        "voltage": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, NAE) - Voltage applied to the addiitonal grating. Typical unit - V."
        }
      }
    },
    "lensDetails": {
      "type": "object",
      "description": "(Required, AE) - Describes of the excitation percentage of the lenses used in the system.",
      "additionalProperties": false,
      "properties": {
        "c1": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of condenser1 of the datatype number."
        },
        "c2": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of condenser2 of the datatype number."
        },
        "c3": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of condenser3 of the datatype number."
        },
        "minicondenser": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of minicondenser of the datatype number."
        },
        "objective": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of objective lens of the datatype number."
        },
        "lorentz": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of the lorentz lens of the datatype number."
        },
        "diffraction": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of diffraction lens of the datatype number."
        },
        "intermediate": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of intermediate lens of the datatype number."
        },
        "p1": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of projector lens 1 of the datatype number."
        },
        "p2": {
          "type": "number",
          "description": "(Optional, AE) - Percentage of excitation of projector lens 2 of the datatype number."
        },
        "beamConvergence": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - Angle of the electron beam as it enters the objective lens with typical unit mrad."
        }
      },
      "required": [
        "beamConvergence"
      ]
    },
    "ASTARdetails": {
      "type": "object",
      "description": "(Optional) - Details pertaining to an ASTAR attachment used for orientation-phase imaging.",
      "additionalProperties": false,
      "properties": {
        "ASTARactive": {
          "type": "boolean",
          "default": true,
          "description": "(Required, NAE) - Set to be true if ASTAR attchment is used of the datatype boolean."
        },
        "ASTARname": {
          "type": "string",
          "description": "(Optional, AE) - Name or nickname of the ASTAR system used, of the datatype string."
        },
        "ASTARmanufacturer": {
          "$ref": "#/$defs/manufacturerDetails",
          "description": "(Optional, AE) - Details pertaining to the manufacturer of the ASTAR system."
        },
        "bufferSize": {
          "type": "number",
          "description": "(Optional, AE) - Size of the buffer in bits expressed as a number. E.g. 1024."
        },
        "speedRate": {
          "type": "string",
          "enum": [
            "slow",
            "medium",
            "fast"
          ],
          "description": "(Optional, AE) - Rate of acquision (fast, medium) of the datatype string."
        },
        "operationMode": {
          "type": "string",
          "enum": [
            "normal",
            "other"
          ],
          "description": "(Optional, AE) - Operation Mode of the ASTAR. E.g.- normal, of the datatype string."
        },
        "systemClockLocked": {
          "type": "boolean",
          "default": true,
          "description": "(Optional, AE) - To be set to true if system clock is locked, of the datatype boolean."
        },
        "objectiveApertureRetracted": {
          "type": "boolean",
          "default": true,
          "description": "(Optional, NAE) - To be set as true if the objective aperture is retracted for using the ASTAR of the datatype boolean. Normally the smallest condenser should be used and the objective aperture has to be retracted while using ASTAR."
        },
        "precession": {
          "$ref": "#/$defs/precessionDetails",
          "description": "(Optional, AE) - Details about precession like the angle and frequency of precession, when precession electron diffraction (PED) is used."
        }
      },
      "required": [
        "ASTARactive"
      ]
    },
    "detectorDetails": {
      "type": "object",
      "description": "Settings of a detector.",
      "additionalProperties": false,
      "properties": {
        "detectorType": {
          "type": "string",
          "description": "(Required, NAE) - Detector type to be selected from a controlled list - direct electron detector, scintillator, fission chamber, proportion counter, ion chamber, ccd, pixel, image plate, CMOS, He3 gas cylinder, He3 PSD, other… of the datatype string. If 'other' is selected, the detector type can be specified under the field 'otherDetectorType'.",
          "enum": [
            "direct electron detector",
            "scintillator",
            "fission chamber",
            "proportion counter",
            "ion chamber",
            "ccd",
            "pixel",
            "image plate",
            "CMOS",
            "He3 gas cylinder",
            "He3 PSD",
            "other"
          ]
        },
        "otherDetectorType": {
          "type": "string",
          "description": "(Optional, NAE) - Specific type of the detector when it is not already listed under 'detectorType', of the datatype string."
        },
        "detectorName": {
          "type": "string",
          "description": "(Required, AE) - Name of the detector of datatype string."
        },
        "detectorID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier for the detector/camera."
        },
        "detectorManufacturer": {
          "$ref": "#/$defs/manufacturerDetails",
          "description": "(Optional, NAE) - Details of the detector (manufacturerName, modelName and detectorID)."
        },
        "lastCalibration": {
          "type": "string",
          "pattern": "^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z?)$",
          "description": "(Optional, NAE) - Date and time of last calibration (YYYY-MM-DDThh:mm:ss.sssZ) of the date-time format ISO 8601."
        },
        "isCorrelationImage": {
          "type": "boolean",
          "default": false,
          "description": "(Required, NAE) - Set to be true if the acquired image is to be correlated with other data for correlative characterization of the datatype boolean."
        },
        "coordinates": {
          "$ref": "#/$defs/coordinateSet",
          "description": "(Optional, NAE) - XYZ coordinates describing the region of interest (position where measurement is done)."
        },
        "coordinateReferenceType": {
          "type": "string",
          "description": "(Optional, NAE) - Type of reference point on the sample used for defining the coordinates of the datatype string. For e.g., origin at fixed distances from two edges, origin at centre of the sample, etc."
        },
        "bitDepthReadout": {
          "type": "number",
          "description": "(Optional, AE) - Number of bits read by the electronics per pixel defined to be of the datatype number (can be an integer or floating point number depending on the type of the detector)"
        },
        "numberOfPixelsCamera": {
          "$ref": "#/$defs/pixelNumberType",
          "description": "(Optional, AE) - Number of (CCD) pixels of the camera in the x and y dimensions."
        },
        "pixelSizeImage": {
          "$ref": "#/$defs/pixelSize3D",
          "description": "(Optional, NAE) - Distance on the image represented by a single pixel in each of the three dimensions - X, Y, and Z."
        },
        "pixelCalibration": {
          "$ref": "#/$defs/pixelResolutionDetails",
          "description": "(Required, NAE) - Resolution of the image usually in pixels/nm."
        },
        "pixelOffset": {
          "$ref": "#/$defs/pixelOffsetDetails",
          "description": "(Optional, AE) - Pixel offset in x and y dimensions."
        },
        "verticallyFlipped": {
          "type": "boolean",
          "default": false,
          "description": "(Required, AE) - Set to be true if the image is vertically flipped because of the camera setting defined to be of the datatype boolean."
        },
        "horizontallyFlipped": {
          "type": "boolean",
          "default": false,
          "description": "(Required, AE) - Set to be true if the image is horizontally flipped because of the camera setting defined to be of the datatype boolean."
        },
        "diagonallyFlipped": {
          "type": "boolean",
          "default": false,
          "description": "(Required, AE) - Set to be true if the image is diagonally flipped because of the camera setting defined to be of the datatype boolean."
        },
        "rotationAngle": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, AE) - Angle by which the image is rotated."
        },
        "exposureTime": {
          "$ref": "#/$defs/timeDetails",
          "description": "(Optional, AE) - Time for which a camera pixel is exposed usually with units µs or ms."
        },
        "binning": {
          "type": "number",
          "enum": [
            1,
            8,
            16,
            32,
            64,
            128,
            256
          ],
          "description": "(Optional, NAE) - Number of detector counts binned together of the datatype number - usually 1, 8 or 16."
        },
        "measurementModeDectris": {
          "description": " (Optional, AE) - For the Dectris Camera: Option to select internal trigger (INTE) or external trigger (EXTE) and the aquisition time of the signal. (INTS, EXTS -> acquisition time = image Time, for the other options, acquisition time = Frame Time )",
          "type": "string",
          "enum": [
            "INTE",
            "INTS",
            "EXTE",
            "EXTS"
          ]
        },
        "collectionMethod": {
          "type": "string",
          "enum": [
            "normal",
            "averaging",
            "integration",
            "summation"
          ],
          "description": "(Required, NAE) - Type of collection method- normal, averaging, integration, summation defined to be of the datatype string."
        },
        "numberOfCycles": {
          "type": "number",
          "description": "(Optional, NAE) - Number of CCD images used for averaging."
        },
        "darkReferenceCorrection": {
          "type": "array",
          "description": "(Optional, NAE) - Dark field correction data as a 2D array of numbers.",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        }
      },
      "required": [
        "detectorName",
        "detectorType",
        "isCorrelationImage",
        "pixelCalibration",
        "verticallyFlipped",
        "horizontallyFlipped",
        "diagonallyFlipped"
      ]
    },
    "pixelNumberType": {
      "type": "object",
      "description": "Describes the resolution of the image split into number of pixels in x and y directions.",
      "additionalProperties": false,
      "properties": {
        "xPixels": {
          "type": "number",
          "description": "(Required, AE) - Number of pixels in horizontal direction of datatype number."
        },
        "yPixels": {
          "type": "number",
          "description": "(Required, AE) - Number of pixels in vertical direction of datatype number."
        }
      }
    },
    "pixelSize3D": {
      "type": "object",
      "description": "Distance on the sample imaged by a single pixel, normally expressed in nm/pixel, is expressed in 3D for the mapping along x,y and z directions. ",
      "additionalProperties": false,
      "properties": {
        "xPixelSize": {
          "$ref": "#/$defs/pixelSizeDetails",
          "description": "(Required, NAE) -  Distance on the sample covered by a pixel in the x direction."
        },
        "yPixelSize": {
          "$ref": "#/$defs/pixelSizeDetails",
          "description": "(Optional, NAE) - Distance on the sample covered by a pixel in the y direction."
        },
        "zPixelSize": {
          "$ref": "#/$defs/pixelSizeDetails",
          "description": "(Optional, NAE) - Distance on the sample covered by a pixel in the z direction; The z-pixel-size can be ignored if it is greater than the voxel size."
        }
      },
      "required": [
        "xPixelSize"
      ]
    },
    "pixelSizeDetails": {
      "type": "object",
      "description": "describes the size of a pixel.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required) - The pixel-size expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "description": "(Required) - Unit of the value (default value - nm/pixel) of datatype string."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional) - A qualifier to describe the value (e.g., avg, max, min; default value - max) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional) - Uncertainty in the value defined as a complex type uncertaintyDetails, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "pixelResolutionDetails": {
      "type": "object",
      "description": "Describes the size of a pixel. Properties: value , unit , qualifier , uncertainty r, notes ",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The pixel-size expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "description": "(Required, AE) - the unit of the value (default value - nm/pixel) of datatype string."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string"
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value defined as a complex type uncertaintyDetails, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "pixelOffsetDetails": {
      "type": "object",
      "description": "Offset applied to a pixel in x and y dimensions normally expressed in nm. Properties: xPixelOffset , yPixelOffset ",
      "additionalProperties": false,
      "properties": {
        "xPixelOffset": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - Offset applied to a pixel in x dimension."
        },
        "yPixelOffset": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - the offset applied to a pixel in y dimension."
        }
      }
    },
    "timeDetails": {
      "type": "object",
      "description": "Describes a time.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required) - The time expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "ps",
            "ns",
            "us",
            "ms",
            "s"
          ],
          "description": "(Required) - the unit of the value to be selected from a controlled list - ps, ns, us, ms, s (of datatype string)."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional) - A qualifier to describe the value (e.g., avg, max, min) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional) - Uncertainty in the value defined as a complex type uncertaintyDetails, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "STEMdetails": {
      "type": "object",
      "description": "Settings and parameters when a scanning transmission electron microscopy measurement is performed. Properties: gainCorrection , darkGainCorrectionType , ADF ",
      "additionalProperties": false,
      "properties": {
        "gainCorrection": {
          "type": "array",
          "description": "(Optional, NAE) - The flat field correction data applied to correct the gain as an array of numbers.",
          "items": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        },
        "darkGainCorrectionType": {
          "type": "string",
          "description": "(Optional, NAE) - Description of the kind of correction used, of the datatype string."
        },
        "detectorName": {
          "type": "array",
          "description": "(Optional, NAE) - The list of the names of the detectors used, in the form of an array.",
          "items": {
            "type": "string",
            "enum": [
              "BF",
              "DF1",
              "DF2",
              "DF3",
              "DF4",
              "DF5",
              "DF6",
              "DF7",
              "DF8",
              "HAADF"
            ]
          }
        },
        "BF": {
          "$ref": "#/$defs/fieldDetectorDetails",
          "description": "(Optional, NAE) - Details about a bright field detector (ADF)."
        },
        "DF": {
          "type": "array",
          "description": "(Optional, NAE) - Details about an annular dark field detector (ADF).",
          "items": {
            "type": "object",
            "$ref": "#/$defs/fieldDetectorDetails"
          }
        },
        "HAADF": {
          "$ref": "#/$defs/fieldDetectorDetails",
          "description": "(Optional, NAE) - Details about an high angle annular dark field detector (HAADF)."
        }
      }
    },
    "fieldDetectorDetails": {
      "type": "object",
      "description": "Details about an field detector, could be bright field (BF), dark field (DF) or HAADF.",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "(Required, NAE) - Name of the detector. E.g. - DF1, BF, HAADF, DF4"
        },
        "details": {
          "type": "string",
          "description": "(Optional, NAE) - Additional details about the detector like if it is segmented or not, of the datatype string."
        },
        "enabled": {
          "type": "boolean",
          "default": false,
          "description": "(Required, AE) - To be set as true if the detector is enabled, of the datatype boolean."
        },
        "gain": {
          "$ref": "#/$defs/gainDetails",
          "description": "(Required, AE) - The set gain for the detector."
        },
        "offset": {
          "type": "number",
          "description": "(Required, AE) - The offset applied to the detector expressed as an integer of the datatype number."
        },
        "collectionAngleRange": {
          "$ref": "#/$defs/rangeDetails",
          "description": "(Required, AE) - the min and max angles of the annular detector within which the signal is detected."
        }
      },
      "required": [
        "enabled",
        "name",
        "gain",
        "offset",
        "collectionAngleRange"
      ]
    },
    "gainDetails": {
      "type": "object",
      "description": "Describes a gain.",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number",
          "description": "(Required, AE) - The gain expressed as an integer or floating point value of datatype number."
        },
        "unit": {
          "type": "string",
          "enum": [
            "dB",
            "%"
          ],
          "description": "(Required, AE) - the unit of the value to be selected from a controlled list - dB, % (of datatype string)."
        },
        "qualifier": {
          "type": "string",
          "enum": [
            "max",
            "min",
            "average"
          ],
          "description": "(Optional, NAE) - A qualifier to describe the value (e.g., avg, max, min) of datatype string."
        },
        "uncertainty": {
          "$ref": "#/$defs/uncertaintyDetails",
          "description": "(Optional, NAE) - Uncertainty in the value defined as a complex type uncertaintyDetails, which gives the option of choosing between an absolute uncertainty or relative uncertainty and entering the value of uncertainty as a number."
        },
        "notes": {
          "type": "string",
          "description": "(Optional, NAE) - Further notes about the value of datatype string."
        }
      },
      "required": [
        "unit",
        "value"
      ]
    },
    "rangeDetails": {
      "type": "object",
      "description": "describes as range between two values - value1 and value2. Properties: value1 , value2 ",
      "additionalProperties": false,
      "properties": {
        "value1": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - The lower bound value which is a dimensional quantity defined here separately as angleDetails out of which the qualifier property is to be set as minimum."
        },
        "value2": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - The upper bound value which is a dimensional quantity defined here separately as angleDetails out of which the qualifier property is to be set as maximum."
        }
      },
      "required": [
        "value1",
        "value2"
      ]
    },
    "scanDetails": {
      "type": "object",
      "description": "(Required, AE) - Describes the scanning parameters.",
      "additionalProperties": false,
      "properties": {
        "dwellTime": {
          "$ref": "#/$defs/timeDetails",
          "description": "(Required, AE) - Time for which the electron beam stays on a pixel during the scanning process."
        },
        "scanType": {
          "type": "string",
          "enum": [
            "0D",
            "1D",
            "2D",
            "4D-STEM"
          ],
          "description": "(Required, NAE) - Choice between type of scan as 0D (spot), 1D (line), 2D (area) or 4D STEM, defined to be of the datatype string."
        },
        "scanSize": {
          "$ref": "#/$defs/pixelNumberType",
          "description": "(Optional, NAE) - Based on if scan is 1D or 2D, the corresponding no. of pixels in x and y directions are to be entered."
        },
        "mainsLock": {
          "type": "boolean",
          "default": false,
          "description": " (Optional, AE) - To be set as true if the mains lock is engaged, of the datatype boolean."
        },
        "frameTime": {
          "$ref": "#/$defs/timeDetails",
          "description": "( Optional, AE) - The time taken to acquire a frame, defined separately as timeDetails."
        },
        "scanRotation": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, AE) - The angle with which the scanning system is rotated."
        },
        "xFieldOfView": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - The full scan field of view in the x direction normally expressed in nm."
        },
        "yFieldOfView": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Optional, AE) - The full scan field of view in the y direction normally expressed in nm."
        }
      },
      "required": [
        "dwellTime",
        "scanType"
      ]
    },
    "EELSdetails": {
      "type": "object",
      "description": "Describes the parameters of Electron Energy Loss spectroscopy (EELS). ",
      "additionalProperties": false,
      "properties": {
        "continuousMode": {
          "type": "number",
          "description": "(Optional, AE) - An integer indicating the continuous mode, defined to be of the datatype number."
        },
        "dualAcquireEnabled": {
          "type": "boolean",
          "description": "(Required, AE) - To be set as true if dual Acquire mode is enabled, of the datatype boolean."
        },
        "highQualityDarkReferenceApplied": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set as true if a high quality dark reference is applied, of the datatype boolean."
        },
        "lowLossDualAcquire": {
          "type": "boolean",
          "description": "(Optional, AE) - To be set as true if low loss dual Acquire mode is enabled of the datatype boolean."
        },
        "noOfFrames": {
          "type": "number",
          "description": "(Optional, AE) - The number of frames acquired during the scan."
        },
        "saturationFraction": {
          "type": "number",
          "description": "(Optional, AE) - The fraction of saturated electrons in the scanned image, defined to be of the datatype number."
        },
        "collectionSemiAngle": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - The number of semi-angles of the scattered beam which is collected, usually expressed in mrad."
        },
        "convergenceSemiAngle": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Required, AE) - The convergence semi-angle of the electron beam, usually expressed in mrad."
        },
        "subPixelAveragingEnabled": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, AE) - To bet set to true if sub-pixel averaging is enabled, defined to be of the datatype boolean."
        },
        "spectrometer": {
          "$ref": "#/$defs/spectrometerDetails",
          "description": "(Optional, NAE) - Details pertaining to the spectrometer used in EELS."
        }
      },
      "required": [
        "dualAcquireEnabled",
        "collectionSemiAngle",
        "convergenceSemiAngle"
      ]
    },
    "spectrometerDetails": {
      "type": "object",
      "description": "Details about the spectrometer used for EELS.",
      "additionalProperties": false,
      "properties": {
        "apertureSize": {
          "$ref": "#/$defs/distanceDetails",
          "description": "(Required, AE) - Size of the aperture usually in units of mm. Aperture size may be also called aperture label by some manufacturers."
        },
        "dispersion": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Required, AE) - The energy covered by a channel of the CCD, normally expressed in eV."
        },
        "driftTubeEnabled": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, AE) - To be set as true if the drift tube is enabled, of the datatype boolean."
        },
        "driftTubeVoltage": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - Drift tube voltage applied to the electrons passing through the sample."
        },
        "driftTubeVoltage2": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - Drift tube voltage for dual acquire sibling if used."
        },
        "energyLoss": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Optional, AE) - The energy value given to indicate where the majority of the energy Loss is located on the spectrum."
        },
        "HTOffsetEnabled": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, AE) - To be set true if high tension offset is enabled defined to be of the datatype boolean."
        },
        "HTOffset": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - Details regarding the high tension offset applied."
        },
        "HTOffset2": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - The high tension offset applied for dual acquire sibling (if used)."
        },
        "spectrometerID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier for the spectrometer."
        },
        "spectrometerName": {
          "type": "string",
          "description": "(Optional, AE) - Name or nick-name of the spectrometer defined as a string."
        },
        "prismOffset": {
          "$ref": "#/$defs/voltageDetails",
          "description": "(Optional, AE) - Offset applied to the prism in the spectrometer."
        }
      },
      "required": [
        "apertureSize",
        "dispersion"
      ]
    },
    "EDXSDetails": {
      "type": "object",
      "description": "Details pertaining to Energy Dispersive Xray Spectroscopy (EDXS) system.",
      "additionalProperties": false,
      "properties": {
        "detectorName": {
          "type": "string",
          "description": "(Optional, AE) - Name or local name of the EDXS detector, of the datatype string. E.g. superXG2"
        },
        "detectorID": {
          "$ref": "#/$defs/identifier",
          "description": "(Optional, NAE) - Identifier for the EDXS detector."
        },
        "dispersion": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Required, AE) - The energy covered by a channel of the CCD, normally expressed in eV."
        },
        "offset": {
          "$ref": "#/$defs/energyDetails",
          "description": "(Required, AE) - The offset energy applied to the detector, usually expressed in eV defined to be of the type energyDetails."
        },
        "shapingTime": {
          "$ref": "#/$defs/timeDetails",
          "description": "(Optional, AE) - Time used to shape and smooth EDX peaks, defined separatelyas timeDetails."
        },
        "noOfFrames": {
          "type": "number",
          "description": " (Required, AE) - The number of frames acquired by the EDXS detector, defined to be of the datatype number."
        },
        "segmentedDetector": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, NAE) - To be set as true if a segmented detector is used for the EDXS system."
        },
        "noOfUsedSegments": {
          "type": "number",
          "description": "(Optional, NAE) - The number of segments used in a segmented detector defined to be of the datatype number."
        },
        "usedSegments": {
          "type": "array",
          "description": "(Optional, AE) - Array of properties which describe the characteristics of each segment of the segmented detector.",
          "items": {
            "$ref": "#/$defs/usedSegmentDetails"
          }
        }
      },
      "required": [
        "dispersion",
        "offset",
        "noOfFrames"
      ]
    },
    "usedSegmentDetails": {
      "type": "object",
      "description": "Describes the properties of a segment of the segmented EDXS detector.",
      "additionalProperties": false,
      "properties": {
        "segmentNo": {
          "type": "number",
          "description": "(Optional, AE) - The serial number of the segment defined to be of the datatype number."
        },
        "enabled": {
          "type": "boolean",
          "default": false,
          "description": "(Optional, AE) - To be set as true if the particular segment is enabled of the datatype boolean."
        },
        "azimuth": {
          "$ref": "#/$defs/angleDetails",
          "description": "(Optional, AE) - The angle at which the segment is located."
        },
        "inputCountRate": {
          "type": "number",
          "description": "(Optional, AE) - An integer value indicating the number of counts per second arriving at the segment of the datatype number."
        },
        "outputCountRate": {
          "type": "number",
          "description": "(Optional, AE) - An integer value indicating the number of counts per second passed by the segment to the electronics (of the datatype number)."
        }
      }
    }
  }
}