feat: define simulator data contracts
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://micarrsim.local/schemas/array.schema.json",
|
||||
"title": "micarrsim microphone array",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["schemaVersion", "kind", "id", "name", "units", "coordinateSystem", "aperture", "microphones"],
|
||||
"properties": {
|
||||
"schemaVersion": { "const": "1.0.0" },
|
||||
"kind": { "const": "micarrsim.array" },
|
||||
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]*$" },
|
||||
"name": { "type": "string", "minLength": 1, "maxLength": 120 },
|
||||
"description": { "type": "string", "maxLength": 1000 },
|
||||
"units": { "const": "m" },
|
||||
"coordinateSystem": { "$ref": "#/$defs/coordinateSystem" },
|
||||
"aperture": {
|
||||
"type": "object", "additionalProperties": false, "required": ["width", "height"],
|
||||
"properties": {
|
||||
"width": { "type": "number", "exclusiveMinimum": 0, "maximum": 20 },
|
||||
"height": { "type": "number", "exclusiveMinimum": 0, "maximum": 20 }
|
||||
}
|
||||
},
|
||||
"microphones": { "type": "array", "minItems": 1, "maxItems": 1024, "items": { "$ref": "#/$defs/microphone" } }
|
||||
},
|
||||
"$defs": {
|
||||
"coordinateSystem": {
|
||||
"type": "object", "additionalProperties": false,
|
||||
"required": ["handedness", "xAxis", "yAxis", "zAxis"],
|
||||
"properties": {
|
||||
"handedness": { "const": "right" }, "xAxis": { "const": "right" },
|
||||
"yAxis": { "const": "up" }, "zAxis": { "const": "toward-scene" }
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"type": "array",
|
||||
"prefixItems": [{ "type": "number" }, { "type": "number" }, { "type": "number" }],
|
||||
"items": false, "minItems": 3, "maxItems": 3
|
||||
},
|
||||
"microphone": {
|
||||
"type": "object", "additionalProperties": false, "required": ["id", "position"],
|
||||
"properties": {
|
||||
"id": { "type": "string", "minLength": 1, "maxLength": 64 },
|
||||
"position": { "$ref": "#/$defs/position" },
|
||||
"sensitivityDb": { "type": "number", "minimum": -120, "maximum": 120 },
|
||||
"phaseOffsetDeg": { "type": "number", "minimum": -180, "maximum": 180 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user