File: units_mapping-1.0.0.yaml

package info (click to toggle)
asdf-astropy 0.3.0%2Bgithub-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 556 kB
  • sloc: python: 3,703; makefile: 109
file content (98 lines) | stat: -rw-r--r-- 2,692 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://astropy.org/schemas/astropy/transform/units_mapping-1.0.0"

title: |
  Mapper that operates on the units of the input.

description: |
  This transform operates on the units of the input, first converting to
  the expected input units, then assigning replacement output units without
  further conversion.

examples:
  -
    - Assign units of seconds to dimensionless input.
    - |
      !<tag:astropy.org:astropy/transform/units_mapping-1.0.0>
        unit_inputs:
          - name: x
            unit: !unit/unit-1.0.0
        unit_outputs:
          - name: x
            unit: !unit/unit-1.0.0 s
  -
    - Convert input to meters, then assign dimensionless units.
    - |
      !<tag:astropy.org:astropy/transform/units_mapping-1.0.0>
        unit_inputs:
          - name: x
            unit: !unit/unit-1.0.0 m
        unit_outputs:
          - name: x
            unit: !unit/unit-1.0.0

  -
    - Convert input to meters, then drop units entirely.
    - |
      !<tag:astropy.org:astropy/transform/units_mapping-1.0.0>
        unit_inputs:
          - name: x
            unit: !unit/unit-1.0.0 m
        unit_outputs:
          - name: x

  -
    - Accept any units, then replace with meters.
    - |
      !<tag:astropy.org:astropy/transform/units_mapping-1.0.0>
        unit_inputs:
          - name: x
        unit_outputs:
          - name: x
            unit: !unit/unit-1.0.0 m

allOf:
  - $ref: "http://stsci.edu/schemas/asdf/transform/transform-1.2.0"
  - type: object
    properties:
      unit_inputs:
        description: |
          Array of input configurations.
        type: array
        items:
          $ref: "#/definitions/value_configuration"
      unit_outputs:
        description: |
          Array of output configurations.
        type: array
        items:
          $ref: "#/definitions/value_configuration"
    required: [unit_inputs, unit_outputs]

definitions:
  value_configuration:
    description: |
      Configuration of a single model value (input or output).
    type: object
    properties:
      name:
        description: |
          Value name.
        type: string
      unit:
        description: |
          Expected unit.
        $ref: "http://stsci.edu/schemas/asdf/unit/unit-1.0.0"
      equivalencies:
        description: |
          Equivalencies to apply when converting value to expected unit.
        $ref: "http://astropy.org/schemas/astropy/units/equivalency-1.0.0"
      allow_dimensionless:
        description: |
          Allow this value to receive dimensionless data.
        type: boolean
        default: false
    required: [name]
...