From 1cb98f92bbd40e29544ecdbed3abf770352cda8e Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 21 Nov 2022 10:25:26 -0500 Subject: [PATCH] update ndarray schema to 1.1 ndarray schema 1.0 allows for objects with no required items. This means that many objects (including empty objects) will validate against this schema. Schemas that reference ndarray were updated to use the new 1.1 schema. --- docs/source/schemas/core.rst | 8 +- docs/source/schemas/fits.rst | 2 +- docs/source/schemas/unit.rst | 6 +- .../asdf-format.org/core/core-1.6.0.yaml | 34 +- .../stsci.edu/asdf/core/column-1.1.0.yaml | 49 +++ .../stsci.edu/asdf/core/integer-1.1.0.yaml | 53 +++ .../stsci.edu/asdf/core/ndarray-1.1.0.yaml | 380 ++++++++++++++++++ .../stsci.edu/asdf/core/table-1.1.0.yaml | 110 +++++ .../stsci.edu/asdf/fits/fits-1.1.0.yaml | 115 ++++++ .../stsci.edu/asdf/time/time-1.2.0.yaml | 24 +- .../stsci.edu/asdf/unit/defunit-1.1.0.yaml | 33 ++ .../stsci.edu/asdf/unit/quantity-1.2.0.yaml | 62 +++ .../stsci.edu/asdf/unit/unit-1.1.0.yaml | 21 + .../stsci.edu/asdf/version_map-1.6.0.yaml | 16 +- 14 files changed, 867 insertions(+), 46 deletions(-) create mode 100644 resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/unit/defunit-1.1.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml create mode 100644 resources/schemas/stsci.edu/asdf/unit/unit-1.1.0.yaml diff --git a/docs/source/schemas/core.rst b/docs/source/schemas/core.rst index 0f21a187..36c49686 100644 --- a/docs/source/schemas/core.rst +++ b/docs/source/schemas/core.rst @@ -10,13 +10,13 @@ asdf library. core/asdf-1.1.0 core/complex-1.0.0 - core/ndarray-1.0.0 - core/table-1.0.0 - core/column-1.0.0 + core/ndarray-1.1.0 + core/table-1.1.0 + core/column-1.1.0 core/constant-1.0.0 core/software-1.0.0 core/history_entry-1.0.0 core/extension_metadata-1.0.0 - core/integer-1.0.0 + core/integer-1.1.0 core/externalarray-1.0.0 core/subclass_metadata-1.0.0 diff --git a/docs/source/schemas/fits.rst b/docs/source/schemas/fits.rst index d2287a2a..6e3e3225 100644 --- a/docs/source/schemas/fits.rst +++ b/docs/source/schemas/fits.rst @@ -8,4 +8,4 @@ FITS. It can safely be ignored by most ASDF implementations. .. asdf-autoschemas:: - fits/fits-1.0.0 + fits/fits-1.1.0 diff --git a/docs/source/schemas/unit.rst b/docs/source/schemas/unit.rst index 3696febe..99d0aeba 100644 --- a/docs/source/schemas/unit.rst +++ b/docs/source/schemas/unit.rst @@ -7,6 +7,6 @@ The ``unit`` module contains schema to support the units of physical quantities. .. asdf-autoschemas:: - unit/unit-1.0.0 - unit/defunit-1.0.0 - unit/quantity-1.1.0 + unit/unit-1.1.0 + unit/defunit-1.1.0 + unit/quantity-1.2.0 diff --git a/resources/manifests/asdf-format.org/core/core-1.6.0.yaml b/resources/manifests/asdf-format.org/core/core-1.6.0.yaml index 3f3fb231..71da6219 100644 --- a/resources/manifests/asdf-format.org/core/core-1.6.0.yaml +++ b/resources/manifests/asdf-format.org/core/core-1.6.0.yaml @@ -8,8 +8,8 @@ tags: schema_uri: http://stsci.edu/schemas/asdf/core/asdf-1.1.0 title: Top-level schema for every ASDF file. description: This schema contains the top-level attributes for every ASDF file. -- tag_uri: tag:stsci.edu:asdf/core/column-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/core/column-1.0.0 +- tag_uri: tag:stsci.edu:asdf/core/column-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/core/column-1.1.0 title: A column in a table. description: |- Each column contains a name and an array of data, and an optional description @@ -63,12 +63,12 @@ tags: description: |- A record of an operation that has been performed upon a file. -- tag_uri: tag:stsci.edu:asdf/core/integer-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/core/integer-1.0.0 +- tag_uri: tag:stsci.edu:asdf/core/integer-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/core/integer-1.1.0 title: Arbitrary precision integer value. description: Represents an arbitrarily large integer value. -- tag_uri: tag:stsci.edu:asdf/core/ndarray-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/core/ndarray-1.0.0 +- tag_uri: tag:stsci.edu:asdf/core/ndarray-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/core/ndarray-1.1.0 title: An *n*-dimensional array. description: |- There are two ways to store the data in an ndarray. @@ -94,12 +94,12 @@ tags: description: |- Identifies the specific subclass that was serialized, to enable ASDF readers to correctly deserialize the object. -- tag_uri: tag:stsci.edu:asdf/core/table-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/core/table-1.0.0 +- tag_uri: tag:stsci.edu:asdf/core/table-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/core/table-1.1.0 title: A table. description: |- A table is represented as a list of columns, where each entry is a - [column](ref:core/column-1.0.0) + [column](ref:core/column-1.1.0) object, containing the data and some additional information. The data itself may be stored inline as text, or in binary in either @@ -108,8 +108,8 @@ tags: Each column in the table must have the same first (slowest moving) dimension. -- tag_uri: tag:stsci.edu:asdf/fits/fits-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/fits/fits-1.0.0 +- tag_uri: tag:stsci.edu:asdf/fits/fits-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/fits/fits-1.1.0 title: A FITS file inside of an ASDF file. description: |- This schema is useful for distributing ASDF files that can @@ -154,8 +154,8 @@ tags: good as an IEEE-754 double precision (float64) value. If higher-precision is required, the `iso` or `yday` format should be used. -- tag_uri: tag:stsci.edu:asdf/unit/defunit-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/unit/defunit-1.0.0 +- tag_uri: tag:stsci.edu:asdf/unit/defunit-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/unit/defunit-1.1.0 title: Define a new physical unit. description: |- Defines a new unit. It can be used to either: @@ -165,14 +165,14 @@ tags: - Create a new unit name that is a equivalent to a given unit. The new unit must be defined before any unit tags that use it. -- tag_uri: tag:stsci.edu:asdf/unit/quantity-1.1.0 - schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.1.0 +- tag_uri: tag:stsci.edu:asdf/unit/quantity-1.2.0 + schema_uri: http://stsci.edu/schemas/asdf/unit/quantity-1.2.0 title: Represents a Quantity object from astropy description: |- A Quantity object represents a value that has some unit associated with the number. -- tag_uri: tag:stsci.edu:asdf/unit/unit-1.0.0 - schema_uri: http://stsci.edu/schemas/asdf/unit/unit-1.0.0 +- tag_uri: tag:stsci.edu:asdf/unit/unit-1.1.0 + schema_uri: http://stsci.edu/schemas/asdf/unit/unit-1.1.0 title: Physical unit. description: |- This represents a physical unit, in [VOUnit syntax, Version 1.0](http://www.ivoa.net/documents/VOUnits/index.html). diff --git a/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml new file mode 100644 index 00000000..66fa7182 --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml @@ -0,0 +1,49 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/core/column-1.1.0" + +title: > + A column in a table. + +description: | + Each column contains a name and an array of data, and an optional description + and unit. + +type: object +properties: + name: + description: | + The name of the column. Each name in a + [table](http://stsci.edu/schemas/asdf/core/table-1.1.0) must be + unique. + type: string + pattern: "[A-Za-z_][A-Za-z0-9_]*" + + data: + description: | + The array data for the column. + allOf: + - $ref: ndarray-1.1.0 + + description: + description: | + An optional description of the column. + type: string + default: '' + + unit: + description: + An optional unit for the column. + allOf: + - $ref: ../unit/unit-1.1.0 + + meta: + description: + Additional free-form metadata about the column. + type: object + default: {} + +required: [name, data] +additionalProperties: false +... diff --git a/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml new file mode 100644 index 00000000..a3a86541 --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml @@ -0,0 +1,53 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/core/integer-1.1.0" +title: Arbitrary precision integer value. +description: | + Represents an arbitrarily large integer value. + +examples: + - + - An integer value that is stored using an internal array + - | + !core/integer-1.1.0 + sign: + + string: '1193942770599561143856918438330' + words: !core/ndarray-1.1.0 + source: 0 + datatype: uint32 + byteorder: little + shape: [4] + + - + - The same integer value is stored using an inline array + - | + !core/integer-1.1.0 + sign: + + string: '1193942770599561143856918438330' + words: !core/ndarray-1.1.0 + data: [1103110586, 1590521629, 299257845, 15] + datatype: uint32 + shape: [4] + +type: object +properties: + words: + $ref: "ndarray-1.1.0" + description: | + An array of unsigned 32-bit words representing the integer value, stored + as little endian (i.e. the first word of the array represents the least + significant bits of the integer value). + sign: + type: string + pattern: "^[+-]$" + description: | + String indicating whether the integer value is positive or negative. + string: + type: string + description: | + Optional string representation of the integer value. This field is only + intended to improve readability for humans, and therefore no assumptions + about format should be made by ASDF readers. +required: [words, sign] +... diff --git a/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml new file mode 100644 index 00000000..d477be5d --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml @@ -0,0 +1,380 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/core/ndarray-1.1.0" + +title: > + An *n*-dimensional array. + +description: | + There are two ways to store the data in an ndarray. + + - Inline in the tree: This is recommended only for small arrays. In + this case, the entire ``ndarray`` tag may be a nested list, in + which case the type of the array is inferred from the content. + (See the rules for type inference in the ``inline-data`` + definition below.) The inline data may also be given in the + ``data`` property, in which case it is possible to explicitly + specify the ``datatype`` and other properties. + + - External to the tree: The data comes from a [block](ref:block) + within the same ASDF file or an external ASDF file referenced by a + URI. + +examples: + - + - An inline array, with implicit data type + - | + !core/ndarray-1.1.0 + [[1, 0, 0], + [0, 1, 0], + [0, 0, 1]] + + - + - An inline array, with an explicit data type + - | + !core/ndarray-1.1.0 + datatype: float64 + data: + [[1, 0, 0], + [0, 1, 0], + [0, 0, 1]] + + - + - An inline structured array, where the types of each column are + automatically detected + - | + !core/ndarray-1.1.0 + [[M110, 110, 205, And], + [ M31, 31, 224, And], + [ M32, 32, 221, And], + [M103, 103, 581, Cas]] + + - + - An inline structured array, where the types of each column are + explicitly specified + - | + !core/ndarray-1.1.0 + datatype: [['ascii', 4], uint16, uint16, ['ascii', 4]] + data: + [[M110, 110, 205, And], + [ M31, 31, 224, And], + [ M32, 32, 221, And], + [M103, 103, 581, Cas]] + + - + - A double-precision array, in contiguous memory in a block within + the same file + - | + !core/ndarray-1.1.0 + source: 0 + shape: [1024, 1024] + datatype: float64 + byteorder: little + + - + - A view of a tile in that image + - | + !core/ndarray-1.1.0 + source: 0 + shape: [256, 256] + datatype: float64 + byteorder: little + strides: [8192, 8] + offset: 2099200 + + - + - A structured datatype, with nested columns for a coordinate in + (*ra*, *dec*), and a 3x3 convolution kernel + - | + !core/ndarray-1.1.0 + source: 0 + shape: [64] + datatype: + - name: coordinate + datatype: + - name: ra + datatype: float64 + - name: dec + datatype: float64 + - name: kernel + datatype: float32 + shape: [3, 3] + byteorder: little + + - + - An array in Fortran order + - | + !core/ndarray-1.1.0 + source: 0 + shape: [1024, 1024] + datatype: float64 + byteorder: little + strides: [8192, 8] + + - + - An array where values of -999 are treated as missing + - | + !core/ndarray-1.1.0 + source: 0 + shape: [256, 256] + datatype: float64 + byteorder: little + mask: -999 + + - + - An array where another array is used as a mask + - | + !core/ndarray-1.1.0 + source: 0 + shape: [256, 256] + datatype: float64 + byteorder: little + mask: !core/ndarray-1.1.0 + source: 1 + shape: [256, 256] + datatype: bool8 + byteorder: little + + - + - An array where the data is stored in the first block in + another ASDF file. + - | + !core/ndarray-1.1.0 + source: external.asdf + shape: [256, 256] + datatype: float64 + byteorder: little + +definitions: + scalar-datatype: + description: | + Describes the type of a single element. + + There is a set of numeric types, each with a single identifier: + + - `int8`, `int16`, `int32`, `int64`: Signed integer types, with + the given bit size. + + - `uint8`, `uint16`, `uint32`, `uint64`: Unsigned integer types, + with the given bit size. + + - `float32`: Single-precision floating-point type or "binary32", + as defined in IEEE 754. + + - `float64`: Double-precision floating-point type or "binary64", + as defined in IEEE 754. + + - `complex64`: Complex number where the real and imaginary parts + are each single-precision floating-point ("binary32") numbers, + as defined in IEEE 754. + + - `complex128`: Complex number where the real and imaginary + parts are each double-precision floating-point ("binary64") + numbers, as defined in IEEE 754. + + There are two distinct fixed-length string types, which must + be indicated with a 2-element array where the first element is an + identifier for the string type, and the second is a length: + + - `ascii`: A string containing ASCII text (all codepoints < + 128), where each character is 1 byte. + + - `ucs4`: A string containing unicode text in the UCS-4 + encoding, where each character is always 4 bytes long. Here + the number of bytes used is 4 times the given length. + + anyOf: + - type: string + enum: [int8, uint8, int16, uint16, int32, uint32, int64, uint64, + float32, float64, complex64, complex128, bool8] + - type: array + items: + - type: string + enum: [ascii, ucs4] + - type: integer + minimum: 0 + minLength: 2 + maxLength: 2 + + datatype: + description: | + The data format of the array elements. May be a single scalar + datatype, or may be a nested list of datatypes. When a list, each field + may have a name. + anyOf: + - $ref: "#/definitions/scalar-datatype" + - type: array + items: + anyOf: + - $ref: "#/definitions/scalar-datatype" + - type: object + properties: + name: + type: string + pattern: "[A-Za-z_][A-Za-z0-9_]*" + description: The name of the field + datatype: + $ref: "#/definitions/datatype" + byteorder: + type: string + enum: [big, little] + description: | + The byteorder for the field. If not provided, the + byteorder of the datatype as a whole will be used. + shape: + type: array + items: + type: integer + minimum: 0 + required: [datatype] + + inline-data: + description: | + Inline data is stored in YAML format directly in the tree, rather than + referencing a binary block. It is made out of nested lists. + + If the datatype of the array is not specified, it is inferred from + the array contents. Type inference is supported only for + homogeneous arrays, not tables. + + - If any of the elements in the array are YAML strings, the + `datatype` of the entire array is `ucs4`, with the width of + the largest string in the column, otherwise... + + - If any of the elements in the array are complex numbers, the + `datatype` of the entire column is `complex128`, otherwise... + + - If any of the types in the column are numbers with a decimal + point, the `datatype` of the entire column is `float64`, + otherwise.. + + - If any of the types in the column are integers, the `datatype` + of the entire column is `int64`, otherwise... + + - The `datatype` of the entire column is `bool8`. + + Masked values may be included in the array using `null`. If an + explicit mask array is also provided, it takes precedence. + + type: array + items: + anyOf: + - type: number + - type: string + - type: "null" + - $ref: "complex-1.0.0" + - $ref: "#/definitions/inline-data" + - type: boolean + +anyOf: + - $ref: "#/definitions/inline-data" + - type: object + properties: + source: + description: | + The source of the data. + + - If an integer: If positive, the zero-based index of the + block within the same file. If negative, the index from + the last block within the same file. For example, a + source of `-1` corresponds to the last block in the same + file. + + - If a string, a URI to an external ASDF file containing the + block data. Relative URIs and ``file:`` and ``http:`` + protocols must be supported. Other protocols may be supported + by specific library implementations. + + The ability to reference block data in an external ASDF file + is intentionally limited to the first block in the external + ASDF file, and is intended only to support the needs of + [exploded](ref:exploded). For the more general case of + referencing data in an external ASDF file, use tree + [references](ref:references). + + anyOf: + - type: integer + - type: string + format: uri + + data: + description: | + The data for the array inline. + + If `datatype` and/or `shape` are also provided, they must + match the data here and can be used as a consistency check. + `strides`, `offset` and `byteorder` are meaningless when + `data` is provided. + $ref: "#/definitions/inline-data" + + shape: + description: | + The shape of the array. + + The first entry may be the string `*`, indicating that the + length of the first index of the array will be automatically + determined from the size of the block. This is used for + streaming support. + type: array + items: + anyOf: + - type: integer + minimum: 0 + - enum: ['*'] + + datatype: + description: | + The data format of the array elements. + $ref: "#/definitions/datatype" + + byteorder: + description: > + The byte order (big- or little-endian) of the array data. + type: string + enum: [big, little] + + offset: + description: > + The offset, in bytes, within the data for this start of this + view. + type: integer + minimum: 0 + default: 0 + + strides: + description: > + The number of bytes to skip in each dimension. If not provided, + the array is assumed by be contiguous and in C order. If + provided, must be the same length as the shape property. + type: array + items: + anyOf: + - type: integer + minimum: 1 + - type: integer + maximum: -1 + + mask: + description: > + Describes how missing values in the array are stored. If a + scalar number, that number is used to represent missing values. + If an ndarray, the given array provides a mask, where non-zero + values represent missing values in this array. The mask array + must be broadcastable to the dimensions of this array. + anyOf: + - type: number + - $ref: "complex-1.0.0" + - allOf: + - $ref: "ndarray-1.1.0" + - datatype: bool8 + + dependencies: + source: [shape, datatype, byteorder] + + oneOf: + - required: [source] + - required: [data] + + propertyOrder: [source, data, mask, datatype, byteorder, shape, offset, strides] +... diff --git a/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml new file mode 100644 index 00000000..c60a3380 --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml @@ -0,0 +1,110 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/core/table-1.1.0" + +title: > + A table. + +description: | + A table is represented as a list of columns, where each entry is a + [column](ref:core/column-1.1.0) + object, containing the data and some additional information. + + The data itself may be stored inline as text, or in binary in either + row- or column-major order by use of the `strides` property on the + individual column arrays. + + Each column in the table must have the same first (slowest moving) + dimension. + +examples: + - + - A table stored in column-major order, with each column in a separate block + - asdf-standard-1.6.0 + - | + !core/table-1.1.0 + columns: + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 0 + datatype: float64 + byteorder: little + shape: [3] + description: RA + meta: {foo: bar} + name: a + unit: !unit/unit-1.1.0 deg + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 1 + datatype: float64 + byteorder: little + shape: [3] + description: DEC + name: b + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 2 + datatype: [ascii, 1] + byteorder: big + shape: [3] + description: The target name + name: c + + - + - A table stored in row-major order, all stored in the same block + - asdf-standard-1.6.0 + - | + !core/table-1.1.0 + columns: + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 0 + datatype: float64 + byteorder: little + shape: [3] + strides: [13] + description: RA + meta: {foo: bar} + name: a + unit: !unit/unit-1.1.0 deg + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 0 + datatype: float64 + byteorder: little + shape: [3] + offset: 4 + strides: [13] + description: DEC + name: b + - !core/column-1.1.0 + data: !core/ndarray-1.1.0 + source: 0 + datatype: [ascii, 1] + byteorder: big + shape: [3] + offset: 12 + strides: [13] + description: The target name + name: c + +type: object +properties: + columns: + description: | + A list of columns in the table. + type: array + items: + $ref: column-1.1.0 + + meta: + description: | + Additional free-form metadata about the table. + type: object + default: {} + +additionalProperties: false +required: [columns] +... diff --git a/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml new file mode 100644 index 00000000..9c17a89f --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml @@ -0,0 +1,115 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/fits/fits-1.1.0" +title: > + A FITS file inside of an ASDF file. +description: | + This schema is useful for distributing ASDF files that can + automatically be converted to FITS files by specifying the exact + content of the resulting FITS file. + + Not all kinds of data in FITS are directly representable in ASDF. + For example, applying an offset and scale to the data using the + `BZERO` and `BSCALE` keywords. In these cases, it will not be + possible to store the data in the native format from FITS and also + be accessible in its proper form in the ASDF file. + + Only image and binary table extensions are supported. + +examples: + - + - A simple FITS file with a primary header and two extensions + - asdf-standard-1.6.0 + - | + !fits/fits-1.1.0 + - header: + - [SIMPLE, true, conforms to FITS standard] + - [BITPIX, 8, array data type] + - [NAXIS, 0, number of array dimensions] + - [EXTEND, true] + - [] + - ['', Top Level MIRI Metadata] + - [] + - [DATE, '2013-08-30T10:49:55.070373', The date this file was created (UTC)] + - [FILENAME, MiriDarkReferenceModel_test.fits, The name of the file] + - [TELESCOP, JWST, The telescope used to acquire the data] + - [] + - ['', Information about the observation] + - [] + - [DATE-OBS, '2013-08-30T10:49:55.000000', The date the observation was made (UTC)] + - data: !core/ndarray-1.1.0 + datatype: float32 + shape: [2, 3, 3, 4] + source: 0 + byteorder: big + header: + - [XTENSION, IMAGE, Image extension] + - [BITPIX, -32, array data type] + - [NAXIS, 4, number of array dimensions] + - [NAXIS1, 4] + - [NAXIS2, 3] + - [NAXIS3, 3] + - [NAXIS4, 2] + - [PCOUNT, 0, number of parameters] + - [GCOUNT, 1, number of groups] + - [EXTNAME, SCI, extension name] + - [BUNIT, DN, Units of the data array] + - data: !core/ndarray-1.1.0 + datatype: float32 + shape: [2, 3, 3, 4] + source: 1 + byteorder: big + header: + - [XTENSION, IMAGE, Image extension] + - [BITPIX, -32, array data type] + - [NAXIS, 4, number of array dimensions] + - [NAXIS1, 4] + - [NAXIS2, 3] + - [NAXIS3, 3] + - [NAXIS4, 2] + - [PCOUNT, 0, number of parameters] + - [GCOUNT, 1, number of groups] + - [EXTNAME, ERR, extension name] + - [BUNIT, DN, Units of the error array] + +tag: "tag:stsci.edu:asdf/fits/fits-1.1.0" +type: array +items: + description: > + Each item represents a single header/data unit (HDU). + type: object + properties: + header: + description: > + A list of the keyword/value/comment triples from the header, + in the order they appear in the FITS file. + type: array + items: + type: array + minItems: 0 + maxItems: 3 + items: + - description: "The keyword." + type: string + maxLength: 8 + pattern: "[A-Z0-9]*" + - description: "The value." + anyOf: + - type: string + maxLength: 60 + - type: number + - type: boolean + - description: "The comment." + type: string + maxLength: 60 + data: + description: "The data part of the HDU." + anyOf: + - $ref: "../core/ndarray-1.1.0" + - $ref: "../core/table-1.1.0" + - type: "null" + default: null + required: [header] + additionalProperties: false +... diff --git a/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml index c8eae76a..9ad85506 100644 --- a/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml +++ b/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml @@ -71,7 +71,7 @@ examples: - asdf-standard-1.6.0 - | !time/time-1.2.0 - value: !core/ndarray-1.0.0 + value: !core/ndarray-1.1.0 data: [2000, 2001] datatype: float64 format: jyear @@ -85,15 +85,15 @@ examples: format: jyear scale: tdb location: - x: !unit/quantity-1.1.0 + x: !unit/quantity-1.2.0 value: 6378100 - unit: !unit/unit-1.0.0 m - y: !unit/quantity-1.1.0 + unit: !unit/unit-1.1.0 m + y: !unit/quantity-1.2.0 value: 0 - unit: !unit/unit-1.0.0 m - z: !unit/quantity-1.1.0 + unit: !unit/unit-1.1.0 m + z: !unit/quantity-1.2.0 value: 0 - unit: !unit/unit-1.0.0 m + unit: !unit/unit-1.1.0 m definitions: iso_time: @@ -210,8 +210,6 @@ anyOf: - $ref: "#/definitions/array_of_strings" - - $ref: "../core/ndarray-1.0.0#/anyOf/1" - - type: object properties: value: @@ -221,7 +219,7 @@ anyOf: anyOf: - $ref: "#/definitions/string_formats" - $ref: "#/definitions/array_of_strings" - - $ref: "../core/ndarray-1.0.0" + - $ref: "../core/ndarray-1.1.0" - type: number format: @@ -290,11 +288,11 @@ anyOf: type: object properties: x: - $ref: "../unit/quantity-1.1.0" + $ref: "../unit/quantity-1.2.0" y: - $ref: "../unit/quantity-1.1.0" + $ref: "../unit/quantity-1.2.0" z: - $ref: "../unit/quantity-1.1.0" + $ref: "../unit/quantity-1.2.0" required: [x, y, z] required: [value] diff --git a/resources/schemas/stsci.edu/asdf/unit/defunit-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/unit/defunit-1.1.0.yaml new file mode 100644 index 00000000..a8a7c8bf --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/unit/defunit-1.1.0.yaml @@ -0,0 +1,33 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/unit/defunit-1.1.0" +title: Define a new physical unit. +description: | + Defines a new unit. It can be used to either: + + - Define a new base unit. + + - Create a new unit name that is a equivalent to a given unit. + + The new unit must be defined before any unit tags that use it. + +type: object +properties: + name: + description: The name of the new unit. + type: string + pattern: "[A-Za-z_][A-Za-z0-9_]+" + + unit: + description: | + The unit that the new name is equivalent to. It is optional, + and if not provided, or ``null``, this ``defunit`` defines a new + base unit. + + anyOf: + - $ref: "unit-1.1.0" + - type: "null" + +required: [name] +... diff --git a/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml new file mode 100644 index 00000000..0cf72759 --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml @@ -0,0 +1,62 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/unit/quantity-1.2.0" + +title: > + Represents a Quantity object from astropy +description: | + A Quantity object represents a value that has some unit + associated with the number. + +examples: + - + - A quantity consisting of a scalar value and unit + - asdf-standard-1.6.0 + - | + !unit/quantity-1.2.0 + value: 3.14159 + unit: km + + - + - A quantity consisting of a single value in an array + - asdf-standard-1.6.0 + - | + !unit/quantity-1.2.0 + value: !core/ndarray-1.1.0 [2.71828] + unit: A + + - + - A quantity with an array of values + - asdf-standard-1.6.0 + - | + !unit/quantity-1.2.0 + value: !core/ndarray-1.1.0 [1, 2, 3, 4] + unit: s + + - + - A quantity with an n-dimensional array of values + - asdf-standard-1.6.0 + - | + !unit/quantity-1.2.0 + value: !core/ndarray-1.1.0 + datatype: float64 + data: [[1, 2, 3], + [4, 5, 6]] + unit: pc + + +type: object +properties: + value: + description: | + A vector of one or more values + anyOf: + - type: number + - $ref: "../core/ndarray-1.1.0" + unit: + description: | + The unit corresponding to the values + $ref: unit-1.1.0 +required: [value, unit] +... diff --git a/resources/schemas/stsci.edu/asdf/unit/unit-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/unit/unit-1.1.0.yaml new file mode 100644 index 00000000..fa2b3a35 --- /dev/null +++ b/resources/schemas/stsci.edu/asdf/unit/unit-1.1.0.yaml @@ -0,0 +1,21 @@ +%YAML 1.1 +--- +$schema: "http://stsci.edu/schemas/yaml-schema/draft-01" +id: "http://stsci.edu/schemas/asdf/unit/unit-1.1.0" +title: Physical unit. +description: > + This represents a physical unit, in [VOUnit syntax, Version + 1.0](http://www.ivoa.net/documents/VOUnits/index.html). + + Where units are not explicitly tagged, they are assumed to be + in VOUnit syntax. +examples: + - + - Example unit + - asdf-standard-1.6.0 + - | + !unit/unit-1.1.0 "2.1798721 10-18kg m2 s-2" + +type: string +pattern: "[\x00-\x7f]*" +... diff --git a/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml index 51688d81..8f67185d 100644 --- a/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml +++ b/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml @@ -4,20 +4,20 @@ FILE_FORMAT: 1.0.0 YAML_VERSION: "1.1" tags: tag:stsci.edu:asdf/core/asdf: 1.1.0 - tag:stsci.edu:asdf/core/column: 1.0.0 + tag:stsci.edu:asdf/core/column: 1.1.0 tag:stsci.edu:asdf/core/complex: 1.0.0 tag:stsci.edu:asdf/core/constant: 1.0.0 tag:stsci.edu:asdf/core/extension_metadata: 1.0.0 tag:stsci.edu:asdf/core/externalarray: 1.0.0 tag:stsci.edu:asdf/core/history_entry: 1.0.0 - tag:stsci.edu:asdf/core/integer: 1.0.0 - tag:stsci.edu:asdf/core/ndarray: 1.0.0 + tag:stsci.edu:asdf/core/integer: 1.1.0 + tag:stsci.edu:asdf/core/ndarray: 1.1.0 tag:stsci.edu:asdf/core/software: 1.0.0 tag:stsci.edu:asdf/core/subclass_metadata: 1.0.0 - tag:stsci.edu:asdf/core/table: 1.0.0 - tag:stsci.edu:asdf/fits/fits: 1.0.0 + tag:stsci.edu:asdf/core/table: 1.1.0 + tag:stsci.edu:asdf/fits/fits: 1.1.0 tag:stsci.edu:asdf/time/time: 1.2.0 - tag:stsci.edu:asdf/unit/defunit: 1.0.0 - tag:stsci.edu:asdf/unit/quantity: 1.1.0 - tag:stsci.edu:asdf/unit/unit: 1.0.0 + tag:stsci.edu:asdf/unit/defunit: 1.1.0 + tag:stsci.edu:asdf/unit/quantity: 1.2.0 + tag:stsci.edu:asdf/unit/unit: 1.1.0 ...