File indexing completed on 2026-05-27 07:24:18
0001
0002
0003
0004
0005
0006
0007
0008
0009 """Schema of a surface grid file"""
0010
0011 surface_grid_schema = {
0012 "type": "object",
0013 "properties": {
0014 "header": {
0015 "type": "object",
0016 "description": "File header section with important IO metadata",
0017 "properties": {
0018 "common": {
0019 "type": "object",
0020 "description": "General metadata",
0021 "properties": {
0022 "version": {
0023 "type": "string",
0024 "description": "detray version this file was created with",
0025 },
0026 "detector": {
0027 "type": "string",
0028 "description": "Name of the detector",
0029 },
0030 "date": {
0031 "type": "string",
0032 "description": "Time stamp (file creation)",
0033 },
0034 "tag": {
0035 "type": "string",
0036 "description": "Type of data",
0037 "enum": ["surface_grids"],
0038 },
0039 },
0040 "required": ["version", "detector", "tag"],
0041 },
0042 "grid_count": {
0043 "type": "integer",
0044 "description": "Number of grids in the detector",
0045 "minimum": 0,
0046 },
0047 },
0048 "required": ["common"],
0049 },
0050 "data": {
0051 "type": "object",
0052 "description": "Grid data section (volume-by-volume)",
0053 "properties": {
0054 "grids": {
0055 "type": "array",
0056 "minitems": 1,
0057 "items": {
0058 "type": "object",
0059 "description": "Data of all grids in a single volume",
0060 "properties": {
0061 "volume_link": {
0062 "type": "integer",
0063 "description": "Volume link",
0064 "minimum": 0,
0065 },
0066 "grid_data": {
0067 "type": "array",
0068 "minitems": 1,
0069 "items": {
0070 "type": "object",
0071 "description": "Data of a single grid",
0072 "properties": {
0073 "owner_link": {
0074 "type": "integer",
0075 "description": "Link to the owner of the grid",
0076 "minimum": 0,
0077 },
0078 "grid_link": {
0079 "type": "object",
0080 "description": "Typed index for the grid",
0081 "properties": {
0082 "type": {
0083 "type": "integer",
0084 "description": "Type ID of the acceleration structure",
0085 "minimum": 1,
0086 "maximum": 5,
0087 },
0088 "index": {
0089 "type": "integer",
0090 "description": "Global index of the acceleration structure",
0091 "minimum": 0,
0092 },
0093 },
0094 "required": ["type", "index"],
0095 },
0096 "axes": {
0097 "type": "array",
0098 "descriptrion": "The axes of the grid",
0099 "minitems": 1,
0100 "uniqueItems": True,
0101 "items": {
0102 "type": "object",
0103 "properties": {
0104 "label": {
0105 "type": "integer",
0106 "description": "Label ID of the axis",
0107 "minimum": 0,
0108 "maximum": 2,
0109 },
0110 "bounds": {
0111 "type": "integer",
0112 "description": "Type ID of the bounds",
0113 "minimum": 0,
0114 "maximum": 2,
0115 },
0116 "binning": {
0117 "type": "integer",
0118 "description": "Type ID of the binning",
0119 "minimum": 0,
0120 "maximum": 1,
0121 },
0122 "bins": {
0123 "type": "integer",
0124 "description": "Number of bins",
0125 "minimum": 1,
0126 },
0127 "edges": {
0128 "type": "array",
0129 "description": "Bin edges (min, max for regular binning)",
0130 "minitems": 2,
0131 "uniqueItems": True,
0132 "items": {"type": "number"},
0133 },
0134 },
0135 "required": [
0136 "label",
0137 "bounds",
0138 "binning",
0139 "bins",
0140 "edges",
0141 ],
0142 },
0143 },
0144 "bins": {
0145 "type": "array",
0146 "description": "The bin content",
0147 "minitems": 1,
0148 "uniqueItems": True,
0149 "items": {
0150 "type": "object",
0151 "description": "A single bin",
0152 "properties": {
0153 "loc_index": {
0154 "type": "array",
0155 "description": "Local bin indices",
0156 "minitems": 1,
0157 "maxitems": 3,
0158 "items": {
0159 "type": "integer",
0160 "minimum": 0,
0161 },
0162 },
0163 "content": {
0164 "type": "array",
0165 "description": "Global surface indices",
0166 "items": {
0167 "type": "integer",
0168 "minimum": 0,
0169 },
0170 },
0171 },
0172 "required": ["loc_index", "content"],
0173 },
0174 },
0175 },
0176 "required": ["owner_link", "axes", "bins"],
0177 },
0178 },
0179 },
0180 "required": ["volume_link", "grid_data"],
0181 },
0182 }
0183 },
0184 "required": ["grids"],
0185 },
0186 },
0187 "required": ["header", "data"],
0188 }