{
  "$defs": {
    "Amplifier": {
      "description": "A struct that holds information about an amplifier.",
      "properties": {
        "assembled_raw_geometry": {
          "anyOf": [
            {
              "$ref": "#/$defs/AmplifierRawGeometry"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Geometry of this amplifier in an assembled but untrimmed raw image that has all amplifiers."
        },
        "bbox": {
          "description": "Bounding box of the amplifier data region in a trimmed, assembled detector.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "name": {
          "description": "Name of the amplifier.",
          "title": "Name",
          "type": "string"
        },
        "nominal_calibrations": {
          "anyOf": [
            {
              "$ref": "#/$defs/AmplifierCalibrations"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Nominal calibration information that may be superseded by separate calibration datasets."
        },
        "readout_corner": {
          "$ref": "#/$defs/ReadoutCorner",
          "description": "Readout corner of the amplifier in the final assembled, trimmed image (with x increasing to the right and y increasing up). "
        },
        "unassembled_raw_geometry": {
          "anyOf": [
            {
              "$ref": "#/$defs/AmplifierRawGeometry"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Geometry of this amplifier in an unassembled, untrimmed raw image that has just this amplifier."
        }
      },
      "required": [
        "name",
        "bbox",
        "readout_corner"
      ],
      "title": "Amplifier",
      "type": "object"
    },
    "AmplifierCalibrations": {
      "description": "A struct that holds nominal information about an amplifier that is\noften superseded by separate calibration datasets.",
      "properties": {
        "gain": {
          "title": "Gain",
          "type": "number"
        },
        "linearity_coefficients": {
          "$ref": "#/$defs/InlineArray"
        },
        "linearity_type": {
          "title": "Linearity Type",
          "type": "string"
        },
        "read_noise": {
          "title": "Read Noise",
          "type": "number"
        },
        "saturation": {
          "title": "Saturation",
          "type": "number"
        },
        "suspect_level": {
          "title": "Suspect Level",
          "type": "number"
        }
      },
      "required": [
        "gain",
        "read_noise",
        "saturation",
        "suspect_level",
        "linearity_coefficients",
        "linearity_type"
      ],
      "title": "AmplifierCalibrations",
      "type": "object"
    },
    "AmplifierRawGeometry": {
      "description": "A struct that describes the geometry of an amplifire in a raw image.",
      "properties": {
        "bbox": {
          "description": "Bounding box of the full untrimmed amplifier in the raw image.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "data_bbox": {
          "description": "Bounding box of the data section in the raw image.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "flip_x": {
          "default": false,
          "description": "Whether to flip the X coordinates during assembly.",
          "title": "Flip X",
          "type": "boolean"
        },
        "flip_y": {
          "default": false,
          "description": "Whether to flip the Y coordinates during assembly.",
          "title": "Flip Y",
          "type": "boolean"
        },
        "parallel_overscan_bbox": {
          "description": "Bounding box of the parallel (vertical) overscan region in the raw image.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "prescan_bbox": {
          "description": "Bounding box of the serial (horizontal) pre-scan region in the raw image.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "readout_corner": {
          "$ref": "#/$defs/ReadoutCorner",
          "description": "Readout corner of the amplifier in the raw image (with x increasing to the right and y increasing up)."
        },
        "serial_overscan_bbox": {
          "description": "Bounding box of the serial (horizontal) overscan region in the raw image.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "x_offset": {
          "default": 0,
          "description": "X offset between the raw position of this amplifier and the trimmed, assembled position of the amplifier.",
          "title": "X Offset",
          "type": "integer"
        },
        "y_offset": {
          "default": 0,
          "description": "Y offset between the raw position of this amplifier and the trimmed, assembled position of the amplifier.",
          "title": "Y Offset",
          "type": "integer"
        }
      },
      "required": [
        "bbox",
        "data_bbox",
        "serial_overscan_bbox",
        "parallel_overscan_bbox",
        "prescan_bbox",
        "readout_corner"
      ],
      "title": "AmplifierRawGeometry",
      "type": "object"
    },
    "ButlerInfo": {
      "description": "Information about a butler dataset.",
      "properties": {
        "dataset": {
          "$ref": "#/$defs/SerializedDatasetRef"
        },
        "provenance": {
          "$ref": "#/$defs/DatasetProvenance"
        }
      },
      "required": [
        "dataset"
      ],
      "title": "ButlerInfo",
      "type": "object"
    },
    "CameraFrameSetSerializationModel": {
      "description": "Serialization model for `CameraFrameSet`.",
      "properties": {
        "ast": {
          "description": "A serialized Starlink AST FrameSet, using the AST native encoding.",
          "title": "Ast",
          "type": "string"
        },
        "butler_info": {
          "anyOf": [
            {
              "$ref": "#/$defs/ButlerInfo"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Information about the butler dataset backed by this file."
        },
        "indirect": {
          "description": "Serialized nested objects that may be saved or read more than once.",
          "items": {},
          "title": "Indirect",
          "type": "array"
        },
        "instrument": {
          "description": "Name of the instrument.",
          "title": "Instrument",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {
            "$ref": "#/$defs/MetadataValue"
          },
          "description": "Additional unstructured metadata.",
          "title": "Metadata",
          "type": "object"
        },
        "min_read_version": {
          "default": 1,
          "description": "Smallest reader major that can interpret this tree.",
          "title": "Min Read Version",
          "type": "integer"
        },
        "schema_version": {
          "default": "1.0.0",
          "description": "Data-model schema version of this tree (major.minor.patch).",
          "title": "Schema Version",
          "type": "string"
        }
      },
      "required": [
        "instrument",
        "ast"
      ],
      "title": "camera_frame_set",
      "type": "object",
      "x-lsst-schema-url": "https://images.lsst.io/schemas/camera_frame_set-1.0.0"
    },
    "DatasetProvenance": {
      "description": "Provenance of a single `DatasetRef`.",
      "properties": {
        "extras": {
          "additionalProperties": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "format": "uuid",
                  "type": "string"
                }
              ]
            },
            "type": "object"
          },
          "propertyNames": {
            "format": "uuid"
          },
          "title": "Extras",
          "type": "object"
        },
        "inputs": {
          "items": {
            "$ref": "#/$defs/SerializedDatasetRef"
          },
          "title": "Inputs",
          "type": "array"
        },
        "quantum_id": {
          "anyOf": [
            {
              "format": "uuid",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Quantum Id"
        }
      },
      "title": "DatasetProvenance",
      "type": "object"
    },
    "DetectorAttributes": {
      "description": "Struct holding the plain-old-data attributes of a detector.",
      "properties": {
        "bbox": {
          "description": "Bounding box of the detector's science data region after amplifier assembly.",
          "properties": {
            "x": {
              "$ref": "#/$defs/_SerializedInterval"
            },
            "y": {
              "$ref": "#/$defs/_SerializedInterval"
            }
          },
          "required": [
            "y",
            "x"
          ],
          "title": "_SerializedBox",
          "type": "object"
        },
        "id": {
          "description": "ID of the detector.",
          "title": "Id",
          "type": "integer"
        },
        "name": {
          "description": "Name of the detector.",
          "title": "Name",
          "type": "string"
        },
        "orientation": {
          "$ref": "#/$defs/Orientation",
          "description": "Nominal position and rotation of the detector."
        },
        "physical_type": {
          "description": "Vendor name or technology type for this detector (may have a different interpretation for different cameras).",
          "title": "Physical Type",
          "type": "string"
        },
        "pixel_size": {
          "description": "Nominal size of a pixel (assumed square) in focal plane coordinate units.",
          "title": "Pixel Size",
          "type": "number"
        },
        "serial": {
          "description": "Serial number for the detector.",
          "title": "Serial",
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/DetectorType",
          "description": "Enumerated type of the detector."
        }
      },
      "required": [
        "name",
        "id",
        "type",
        "serial",
        "bbox",
        "orientation",
        "pixel_size",
        "physical_type"
      ],
      "title": "DetectorAttributes",
      "type": "object"
    },
    "DetectorType": {
      "description": "Enumeration of the types of a detector.",
      "enum": [
        "SCIENCE",
        "FOCUS",
        "GUIDER",
        "WAVEFRONT"
      ],
      "title": "DetectorType",
      "type": "string"
    },
    "InlineArray": {
      "$schema": "http://stsci.edu/schemas/yaml-schema/draft-01",
      "description": "Model for a subset of the ASDF 'ndarray' schema, in the case where the\narray data is stored inline.",
      "id": "http://stsci.edu/schemas/asdf/core/ndarray-1.1.0",
      "properties": {
        "data": {
          "items": {},
          "title": "Data",
          "type": "array"
        },
        "datatype": {
          "$ref": "#/$defs/NumberType"
        }
      },
      "required": [
        "data",
        "datatype"
      ],
      "tag": "!core/ndarray-1.1.0",
      "title": "InlineArrayModel",
      "type": "object"
    },
    "MetadataValue": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "NumberType": {
      "description": "Enumeration of array values types supported by the library.",
      "enum": [
        "bool",
        "uint8",
        "uint16",
        "uint32",
        "uint64",
        "int8",
        "int16",
        "int32",
        "int64",
        "float32",
        "float64"
      ],
      "title": "NumberType",
      "type": "string"
    },
    "Orientation": {
      "description": "A struct that represents the nominal position and rotation of a\ndetector within a camera focal plane.",
      "properties": {
        "focal_plane_x": {
          "description": "Focal plane X coordinate of the reference position.",
          "title": "Focal Plane X",
          "type": "number"
        },
        "focal_plane_y": {
          "description": "Focal plane Y coordinate of the reference position.",
          "title": "Focal Plane Y",
          "type": "number"
        },
        "focal_plane_z": {
          "description": "Focal plane Z coordinate of the reference position.",
          "title": "Focal Plane Z",
          "type": "number"
        },
        "pitch": {
          "$ref": "#/$defs/Quantity",
          "description": "Rotation about the Y axis (as defined after applying 'yaw')."
        },
        "pixel_reference_x": {
          "default": 0.5,
          "description": "Pixel X coordinate of the reference point.",
          "title": "Pixel Reference X",
          "type": "number"
        },
        "pixel_reference_y": {
          "default": 0.5,
          "description": "Pixel Y coordinate of the reference point.",
          "title": "Pixel Reference Y",
          "type": "number"
        },
        "roll": {
          "$ref": "#/$defs/Quantity",
          "description": "Rotation about the X axis (as defined after applying 'yaw' and 'pitch')."
        },
        "yaw": {
          "$ref": "#/$defs/Quantity",
          "description": "Rotation about the Z axis."
        }
      },
      "required": [
        "focal_plane_x",
        "focal_plane_y",
        "focal_plane_z"
      ],
      "title": "Orientation",
      "type": "object"
    },
    "Quantity": {
      "$schema": "http://stsci.edu/schemas/yaml-schema/draft-01",
      "description": "Model for a subset of the ASDF 'quantity' schema for scalars.",
      "id": "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0",
      "properties": {
        "unit": {
          "$ref": "#/$defs/Unit"
        },
        "value": {
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "value",
        "unit"
      ],
      "tag": "!unit/quantity-1.2.0",
      "title": "QuantityModel",
      "type": "object"
    },
    "ReadoutCorner": {
      "description": "Enumeration of the possible readout corners of an amplifier.",
      "enum": [
        "LL",
        "LR",
        "UR",
        "UL"
      ],
      "title": "ReadoutCorner",
      "type": "string"
    },
    "SerializedDataCoordinate": {
      "description": "Simplified model for serializing a `DataCoordinate`.",
      "properties": {
        "dataId": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "title": "Dataid",
          "type": "object"
        },
        "records": {
          "anyOf": [
            {
              "additionalProperties": {
                "$ref": "#/$defs/SerializedDimensionRecord"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Records"
        }
      },
      "required": [
        "dataId"
      ],
      "title": "SerializedDataCoordinate",
      "type": "object"
    },
    "SerializedDatasetRef": {
      "description": "Simplified model of a `DatasetRef` suitable for serialization.",
      "properties": {
        "component": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Component"
        },
        "dataId": {
          "anyOf": [
            {
              "$ref": "#/$defs/SerializedDataCoordinate"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "datasetType": {
          "anyOf": [
            {
              "$ref": "#/$defs/SerializedDatasetType"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "run": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Run"
        }
      },
      "required": [
        "id"
      ],
      "title": "SerializedDatasetRef",
      "type": "object"
    },
    "SerializedDatasetType": {
      "description": "Simplified model of a `DatasetType` suitable for serialization.",
      "properties": {
        "dimensions": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dimensions"
        },
        "isCalibration": {
          "default": false,
          "title": "Iscalibration",
          "type": "boolean"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "parentStorageClass": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Parentstorageclass"
        },
        "storageClass": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Storageclass"
        }
      },
      "required": [
        "name"
      ],
      "title": "SerializedDatasetType",
      "type": "object"
    },
    "SerializedDimensionRecord": {
      "description": "Simplified model for serializing a `DimensionRecord`.",
      "examples": [
        {
          "definition": "detector",
          "record": {
            "full_name": "0_01",
            "id": 72,
            "instrument": "HSC",
            "name_in_raft": "01",
            "purpose": "SCIENCE",
            "raft": "0"
          }
        }
      ],
      "properties": {
        "definition": {
          "examples": [
            "exposure"
          ],
          "title": "Name of dimension associated with this record.",
          "type": "string"
        },
        "record": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/Timespan"
              },
              {
                "type": "null"
              }
            ]
          },
          "examples": [
            {
              "definition": "exposure",
              "record": {
                "exposure": 2021050300044,
                "instrument": "LATISS",
                "obs_id": "AT_O_20210503_00044"
              }
            }
          ],
          "title": "Dimension record keys and values.",
          "type": "object"
        }
      },
      "required": [
        "definition",
        "record"
      ],
      "title": "SerializedDimensionRecord",
      "type": "object"
    },
    "Timespan": {
      "description": "A [begin, end) TAI timespan with bounds as integer nanoseconds since 1970-01-01 00:00:00.",
      "properties": {
        "nsec": {
          "maxItems": 2,
          "minItems": 2,
          "prefixItems": [
            {
              "type": "integer"
            },
            {
              "type": "integer"
            }
          ],
          "title": "Nsec",
          "type": "array"
        }
      },
      "required": [
        "nsec"
      ],
      "title": "Timespan",
      "type": "object"
    },
    "Unit": {
      "$schema": "http://stsci.edu/schemas/yaml-schema/draft-01",
      "id": "http://stsci.edu/schemas/asdf/unit/unit-1.0.0",
      "tag": "!unit/unit-1.0.0",
      "type": "string"
    },
    "_SerializedInterval": {
      "properties": {
        "start": {
          "title": "Start",
          "type": "integer"
        },
        "stop": {
          "title": "Stop",
          "type": "integer"
        }
      },
      "required": [
        "start",
        "stop"
      ],
      "title": "_SerializedInterval",
      "type": "object"
    }
  },
  "$id": "https://images.lsst.io/schemas/detector-1.0.0",
  "description": "Serialization model for `Detector`.",
  "properties": {
    "amplifiers": {
      "description": "Descriptions of the amplifiers.",
      "items": {
        "$ref": "#/$defs/Amplifier"
      },
      "title": "Amplifiers",
      "type": "array"
    },
    "attributes": {
      "$ref": "#/$defs/DetectorAttributes",
      "description": "The simple plain-old-data attributes of the detector."
    },
    "butler_info": {
      "anyOf": [
        {
          "$ref": "#/$defs/ButlerInfo"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Information about the butler dataset backed by this file."
    },
    "frames": {
      "anyOf": [
        {
          "$ref": "#/$defs/CameraFrameSetSerializationModel"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Mappings to other camera coordinate systems."
    },
    "indirect": {
      "description": "Serialized nested objects that may be saved or read more than once.",
      "items": {},
      "title": "Indirect",
      "type": "array"
    },
    "metadata": {
      "additionalProperties": {
        "$ref": "#/$defs/MetadataValue"
      },
      "description": "Additional unstructured metadata.",
      "title": "Metadata",
      "type": "object"
    },
    "min_read_version": {
      "default": 1,
      "description": "Smallest reader major that can interpret this tree.",
      "title": "Min Read Version",
      "type": "integer"
    },
    "schema_version": {
      "default": "1.0.0",
      "description": "Data-model schema version of this tree (major.minor.patch).",
      "title": "Schema Version",
      "type": "string"
    },
    "visit": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "description": "ID of the visit this detector is associated with.",
      "title": "Visit"
    }
  },
  "required": [
    "attributes",
    "visit"
  ],
  "title": "detector",
  "type": "object"
}
