From 360123629b7b174bd6dc69da29e75ab562a004aa Mon Sep 17 00:00:00 2001 From: Drew Leonard Date: Thu, 30 Jan 2025 14:46:32 +0000 Subject: [PATCH] Schema nonsense --- .../asdf/resources/manifests/dkist-1.2.0.yaml | 2 +- .../asdf/resources/schemas/dataset-1.2.0.yaml | 49 +++++++++++++++++++ .../schemas/tiled_dataset-1.1.0.yaml | 29 +++++++++++ dkist/io/level_1_dataset_schema.yaml | 2 + 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 dkist/io/asdf/resources/schemas/dataset-1.2.0.yaml create mode 100644 dkist/io/asdf/resources/schemas/tiled_dataset-1.1.0.yaml diff --git a/dkist/io/asdf/resources/manifests/dkist-1.2.0.yaml b/dkist/io/asdf/resources/manifests/dkist-1.2.0.yaml index 830047a3..851f1f69 100644 --- a/dkist/io/asdf/resources/manifests/dkist-1.2.0.yaml +++ b/dkist/io/asdf/resources/manifests/dkist-1.2.0.yaml @@ -8,7 +8,7 @@ description: ASDF schemas and tags for DKIST classes. tags: - schema_uri: "asdf://dkist.nso.edu/schemas/file_manager-1.0.0" tag_uri: "asdf://dkist.nso.edu/tags/file_manager-1.0.0" - - schema_uri: "asdf://dkist.nso.edu/schemas/dataset-1.1.0" + - schema_uri: "asdf://dkist.nso.edu/schemas/dataset-1.2.0" tag_uri: "asdf://dkist.nso.edu/tags/dataset-1.2.0" - schema_uri: "asdf://dkist.nso.edu/schemas/tiled_dataset-1.0.0" tag_uri: "asdf://dkist.nso.edu/tags/tiled_dataset-1.0.0" diff --git a/dkist/io/asdf/resources/schemas/dataset-1.2.0.yaml b/dkist/io/asdf/resources/schemas/dataset-1.2.0.yaml new file mode 100644 index 00000000..f46c3a16 --- /dev/null +++ b/dkist/io/asdf/resources/schemas/dataset-1.2.0.yaml @@ -0,0 +1,49 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "asdf://dkist.nso.edu/schemas/dataset-1.2.0" + +title: | + A DKIST Level 1 Dataset object. +description: + The container for a distributed dataset object. + +type: object +properties: + data: + tag: "asdf://dkist.nso.edu/tags/file_manager-1.0.0" + + wcs: + description: The coordinate system for the complete dataset. + tag: "tag:stsci.edu:gwcs/wcs-1.*" + + mask: + tag: "tag:stsci.edu:asdf/core/ndarray-1.*" + + unit: + tag: "tag:stsci.edu:asdf/unit/unit-1.*" + + meta: + description: Dataset metadata, describing the whole dataset. + type: object + properties: + headers: + description: A table of all the headers for the constituent files. + anyOf: + - tag: "tag:astropy.org:astropy/table/table-1.*" + - null: true + + quality: + description: A copy of the quality report of these observations. + type: object + + inventory: + description: A copy of the inventory record for this dataset. + type: object + + required: [headers, inventory] + additionalProperties: true + +required: [data, wcs, unit] +additionalProperties: true +... diff --git a/dkist/io/asdf/resources/schemas/tiled_dataset-1.1.0.yaml b/dkist/io/asdf/resources/schemas/tiled_dataset-1.1.0.yaml new file mode 100644 index 00000000..e5b29b1e --- /dev/null +++ b/dkist/io/asdf/resources/schemas/tiled_dataset-1.1.0.yaml @@ -0,0 +1,29 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "asdf://dkist.nso.edu/schemas/tiled_dataset-1.1.0" + +title: | + A DKIST Tiled Dataset object. +description: + The container for a set of Dataset objects. + +type: object +properties: + datasets: + description: A nested structure of Dataset objects + type: array + items: + type: array + items: + - tag: "asdf://dkist.nso.edu/tags/dataset-1.*" + inventory: + description: A copy of the inventory record for this dataset. + type: object + headers: + description: A table of all the headers for the constituent files. + tag: "tag:astropy.org:astropy/table/table-1.*" + +required: [datasets, inventory, headers] +additionalProperties: false +... diff --git a/dkist/io/level_1_dataset_schema.yaml b/dkist/io/level_1_dataset_schema.yaml index bbcc67d6..69f13d32 100644 --- a/dkist/io/level_1_dataset_schema.yaml +++ b/dkist/io/level_1_dataset_schema.yaml @@ -17,8 +17,10 @@ properties: - $ref: "asdf://dkist.nso.edu/schemas/dataset-0.3.0" - $ref: "asdf://dkist.nso.edu/schemas/dataset-1.0.0" - $ref: "asdf://dkist.nso.edu/schemas/dataset-1.1.0" + - $ref: "asdf://dkist.nso.edu/schemas/dataset-1.2.0" - $ref: "asdf://dkist.nso.edu/schemas/tiled_dataset-0.1.0" - $ref: "asdf://dkist.nso.edu/schemas/tiled_dataset-1.0.0" + - $ref: "asdf://dkist.nso.edu/schemas/tiled_dataset-1.1.0" required: [dataset] additionalProperties: true