Skip to content

Commit

Permalink
tested with pymatcal
Browse files Browse the repository at this point in the history
  • Loading branch information
fanghanonline committed Aug 12, 2024
1 parent ca6792e commit 3aa25e5
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 42 deletions.
2 changes: 1 addition & 1 deletion v1/FOV.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "FOV.json",
"$id": "/v1/FOV.json",
"title": "FOV schema",
"description": "FOV section of the YAML configuration file schema.",
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion v1/detector.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "detector.json",
"$id": "/v1/detector.json",
"title": "detector schema",
"description": "Detector section of the YAML configuration file schema.",
"type": "object",
Expand Down
8 changes: 4 additions & 4 deletions v1/main.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "main.json",
"$id": "/v1/main.json",
"title": "Pymatcal main schema",
"description": "SPEBT system response matrix generation package configuration file schema. The configuration file is a YAML file.",
"type": "object",
"properties": {
"detector": {
"$ref": "detector.json"
"$ref": "/v1/detector.json"
},
"FOV": {
"$ref": "FOV.json"
"$ref": "/v1/FOV.json"
},
"relation": {
"$ref": "relation.json"
"$ref": "/v1/relation.json"
}
},
"required": [
Expand Down
18 changes: 10 additions & 8 deletions v1/relation.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "relation.json",
"$id": "/v1/relation.json",
"title": "Detector to FOV relation schema",
"description": "Detector to FOV relation section of the YAML configuration file schema.\n Unit of length is mm. Unit of angle is degrees.",
"type": "object",
"properties": {
"radial distance": {
"$ref": "transformation_data.json"
"radial shift": {
"$ref": "/v1/transformation_data.json"
},
"tangential shift": {
"$ref": "transformation_data.json"
},
"rotations": {
"$ref": "transformation_data.json"
"$ref": "/v1/transformation_data.json"
},
"rotation": {
"$ref": "/v1/transformation_data.json"
}
},
"required": [
"radial distance, rotations"
"radial shift",
"tangential shift",
"rotation"
]
}
66 changes: 38 additions & 28 deletions v1/transformation_data.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "transformation_data.json",
"$id": "/v1/transformation_data.json",
"title": "Pymatcal transformation data schema",
"description": "transformation data schema, used to define the transformation for the detector to FOV relation.",
"type": "object",
"properties": {
"format": {
"type": "string",
"enum": [
"enumerate",
"list",
"range"
]
},
"if": {
"properties": {
"format": {
"const": "range"
}
}
"data": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
},
"then": {
"properties": {
"angles": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3
}
}
"start": {
"type": "number"
},
"step": {
"type": "number"
},
"N": {
"type": "number"
},
"else": {
"properties": {
"angles": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 1
}
"properties": {
"if": {
"properties": {
"format": {
"const": "list"
}
},
"required": [
"format"
]
},
"then": {
"required": [
"data"
]
},
"else": {
"required": [
"start",
"step",
"N"
]
}
}
},
Expand Down

0 comments on commit 3aa25e5

Please sign in to comment.