Skip to content

Instantly share code, notes, and snippets.

@nden
Created September 13, 2022 21:13
Show Gist options
  • Save nden/2eb4b437fee6aac742a614f86fda8a3b to your computer and use it in GitHub Desktop.
Save nden/2eb4b437fee6aac742a614f86fda8a3b to your computer and use it in GitHub Desktop.
GWCS in ASDF example
#ASDF 1.0.0
#ASDF_STANDARD 1.5.0
%YAML 1.1
%TAG ! tag:stsci.edu:asdf/
--- !core/asdf-1.1.0
asdf_library: !core/software-1.0.0 {author: The ASDF Developers, homepage: 'http://github.com/asdf-format/asdf',
name: asdf, version: 2.11.1}
history:
extensions:
- !core/extension_metadata-1.0.0
extension_class: asdf.extension.BuiltinExtension
software: !core/software-1.0.0 {name: asdf, version: 2.11.1}
- !core/extension_metadata-1.0.0
extension_class: asdf.extension._manifest.ManifestExtension
extension_uri: asdf://asdf-format.org/astronomy/gwcs/extensions/gwcs-1.0.0
software: !core/software-1.0.0 {name: gwcs, version: 0.18.1}
- !core/extension_metadata-1.0.0
extension_class: asdf.extension._manifest.ManifestExtension
extension_uri: asdf://asdf-format.org/astronomy/coordinates/extensions/coordinates-1.0.0
software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1}
- !core/extension_metadata-1.0.0
extension_class: asdf.extension._manifest.ManifestExtension
extension_uri: asdf://asdf-format.org/core/extensions/core-1.5.0
software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1}
- !core/extension_metadata-1.0.0
extension_class: asdf.extension._manifest.ManifestExtension
extension_uri: asdf://asdf-format.org/transform/extensions/transform-1.5.0
software: !core/software-1.0.0 {name: asdf-astropy, version: 0.2.1}
wcs: !<tag:stsci.edu:gwcs/wcs-1.0.0>
name: ''
steps:
- !<tag:stsci.edu:gwcs/step-1.0.0>
frame: !<tag:stsci.edu:gwcs/frame2d-1.0.0>
axes_names: [x, y]
axes_order: [0, 1]
axis_physical_types: ['custom:x', 'custom:y']
name: detector
unit: [!unit/unit-1.0.0 pixel, !unit/unit-1.0.0 pixel]
transform: !transform/compose-1.2.0
bounding_box:
- [-0.5, 4087.5]
- [-0.5, 4087.5]
forward:
- !transform/compose-1.2.0
forward:
- !transform/compose-1.2.0
forward:
- !transform/concatenate-1.2.0
forward:
- &id001 !transform/shift-1.2.0
inputs: [x]
offset: 1.0
outputs: [y]
- *id001
inputs: [x0, x1]
outputs: [y0, y1]
- !transform/concatenate-1.2.0
forward:
- !transform/shift-1.2.0
inputs: [x]
offset: -2044.5
outputs: [y]
- !transform/shift-1.2.0
inputs: [x]
offset: -2044.5
outputs: [y]
inputs: [x0, x1]
outputs: [y0, y1]
inputs: [x0, x1]
outputs: [y0, y1]
- !transform/compose-1.2.0
forward:
- !transform/compose-1.2.0
forward:
- !transform/remap_axes-1.3.0
inputs: [x0, x1]
mapping: [0, 1, 0, 1]
outputs: [x0, x1, x2, x3]
- !transform/concatenate-1.2.0
forward:
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, 0.00034167799549840184, -6.872716996741604e-09, -1.1654411100388894e-12,
-6.371224910905836e-16, 5.328639955796689e-19]
- [0.11034133100022436, 1.4173422495909526e-07, -4.1518004069389326e-12,
3.348726204522289e-16, 3.131127377986004e-19, 0.0]
- [-3.3557135091846126e-08, 1.6294623918998322e-12, -2.343942999017153e-16,
-3.810799345570264e-19, 0.0, 0.0]
- [-2.2936229249830195e-12, 3.481721589656778e-17, -5.531951570764015e-19,
0.0, 0.0, 0.0]
- [8.203190187430938e-17, -1.352229485686321e-19, 0.0, 0.0, 0.0,
0.0]
- [-2.90103936699446e-19, 0.0, 0.0, 0.0, 0.0, 0.0]
datatype: float64
shape: [6, 6]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, 0.10828278480023268, 2.0975544522431872e-07, -8.035934380254046e-12,
8.716335482402388e-17, 7.306687873249458e-19]
- [0.0003143580894818263, -1.935402774416973e-08, -4.676020085924336e-13,
-1.3931160186056355e-16, 2.49144268848445e-19, 0.0]
- [7.082635774584028e-08, -4.3206583946954294e-12, -3.2894761887118933e-16,
1.7653489999153516e-19, 0.0, 0.0]
- [6.745237300889371e-13, -5.764818650121977e-16, -2.2361332392891536e-19,
0.0, 0.0, 0.0]
- [1.5414518485165197e-16, -4.0824548670751734e-19, 0.0, 0.0, 0.0,
0.0]
- [-4.016253956412077e-20, 0.0, 0.0, 0.0, 0.0, 0.0]
datatype: float64
shape: [6, 6]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
inputs: [x0, y0, x1, y1]
outputs: [z0, z1]
inputs: [x0, x1]
inverse: !transform/compose-1.2.0
forward:
- !transform/remap_axes-1.3.0
inputs: [x0, x1]
mapping: [0, 1, 0, 1]
outputs: [x0, x1, x2, x3]
- !transform/concatenate-1.2.0
forward:
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, -0.028594955468614895, 6.131065996448358e-06, 7.630974994133858e-09,
4.390341909665261e-11, 0.0]
- [9.062870404552022, -0.00010772930156854933, 3.225782817115383e-08,
-2.4272204607396145e-11, -1.8028656649949247e-13, 0.0]
- [2.545484585120529e-05, -1.2788399234308072e-08, 1.5287166650509654e-11,
2.2021239376522973e-13, 0.0, 0.0]
- [1.6312467588210884e-08, -5.618257073325482e-12, 3.1854112370048453e-13,
0.0, 0.0, 0.0]
- [-4.526714858761106e-12, 7.119707257596547e-14, 0.0, 0.0, 0.0,
0.0]
- [1.598811149911517e-13, 0.0, 0.0, 0.0, 0.0, 0.0]
datatype: float64
shape: [6, 6]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, 9.235165531043597, -0.00016537124490829044, 6.441111563317952e-08,
-6.858896783663363e-12, 0.0]
- [-0.026310245905336344, 1.65538921141671e-05, 1.4358094951729554e-09,
1.005690658530756e-11, -1.4603245066231776e-13, 0.0]
- [-5.38237434819631e-05, 3.362031563864599e-08, 1.6978829265916225e-11,
-1.0687721450632501e-13, 0.0, 0.0]
- [-5.156331897070035e-09, 3.7011408756314384e-11, 1.2467406049971131e-13,
0.0, 0.0, 0.0]
- [-1.0783463162511292e-11, 2.3553884222445596e-13, 0.0, 0.0,
0.0, 0.0]
- [2.1074831206854324e-14, 0.0, 0.0, 0.0, 0.0, 0.0]
datatype: float64
shape: [6, 6]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
inputs: [x0, y0, x1, y1]
outputs: [z0, z1]
inputs: [x0, x1]
outputs: [z0, z1]
outputs: [z0, z1]
- !transform/compose-1.2.0
forward:
- !transform/remap_axes-1.3.0
inputs: [x0, x1]
mapping: [0, 1, 0, 1]
outputs: [x0, x1, x2, x3]
- !transform/concatenate-1.2.0
forward:
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, -0.8660254037844386]
- [-0.5000000000000001, 0.0]
datatype: float64
shape: [2, 2]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, 0.5000000000000001]
- [-0.8660254037844386, 0.0]
datatype: float64
shape: [2, 2]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
inputs: [x0, y0, x1, y1]
outputs: [z0, z1]
inputs: [x0, x1]
inverse: !transform/compose-1.2.0
forward:
- !transform/remap_axes-1.3.0
inputs: [x0, x1]
mapping: [0, 1, 0, 1]
outputs: [x0, x1, x2, x3]
- !transform/concatenate-1.2.0
forward:
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, -0.8660254037844386]
- [-0.5000000000000001, 0.0]
datatype: float64
shape: [2, 2]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
- !transform/polynomial-1.2.0
coefficients: !core/ndarray-1.0.0
data:
- [0.0, 0.5000000000000001]
- [-0.8660254037844386, 0.0]
datatype: float64
shape: [2, 2]
domain:
- [-1, 1]
- [-1, 1]
inputs: [x, y]
outputs: [z]
window:
- [-1, 1]
- [-1, 1]
inputs: [x0, y0, x1, y1]
outputs: [z0, z1]
inputs: [x0, x1]
outputs: [z0, z1]
outputs: [z0, z1]
inputs: [x0, x1]
outputs: [z0, z1]
inputs: [x0, x1]
outputs: [z0, z1]
- !transform/concatenate-1.2.0
forward:
- !transform/shift-1.2.0
inputs: [x]
offset: 1312.9491452484797
outputs: [y]
- !transform/shift-1.2.0
inputs: [x]
offset: -1040.7853726755036
outputs: [y]
inputs: [x0, x1]
outputs: [y0, y1]
inputs: [x0, x1]
outputs: [y0, y1]
- !<tag:stsci.edu:gwcs/step-1.0.0>
frame: !<tag:stsci.edu:gwcs/frame2d-1.0.0>
axes_names: [v2, v3]
axes_order: [0, 1]
axis_physical_types: ['custom:v2', 'custom:v3']
name: v2v3
unit: [!unit/unit-1.0.0 arcsec, !unit/unit-1.0.0 arcsec]
transform: !transform/compose-1.2.0
forward:
- !transform/compose-1.2.0
forward:
- !transform/compose-1.2.0
forward:
- !transform/concatenate-1.2.0
forward:
- !transform/scale-1.2.0
factor: 0.0002777777777777778
inputs: [x]
outputs: [y]
- !transform/scale-1.2.0
factor: 0.0002777777777777778
inputs: [x]
outputs: [y]
inputs: [x0, x1]
outputs: [y0, y1]
- !<tag:stsci.edu:gwcs/spherical_cartesian-1.0.0>
inputs: [lon, lat]
outputs: [x, y, z]
transform_type: spherical_to_cartesian
wrap_lon_at: 180
inputs: [x0, x1]
outputs: [x, y, z]
- !transform/rotate_sequence_3d-1.0.0
angles: [0.3647080959023555, 0.28910704796541764, 0.0, -69.14101326380924,
-84.49289366006334]
axes_order: zyxyz
inputs: [x, y, z]
outputs: [x, y, z]
rotation_type: cartesian
inputs: [x0, x1]
outputs: [x, y, z]
- !<tag:stsci.edu:gwcs/spherical_cartesian-1.0.0>
inputs: [x, y, z]
outputs: [lon, lat]
transform_type: cartesian_to_spherical
wrap_lon_at: 360
inputs: [x0, x1]
name: v23tosky
outputs: [lon, lat]
- !<tag:stsci.edu:gwcs/step-1.0.0>
frame: !<tag:stsci.edu:gwcs/celestial_frame-1.0.0>
axes_names: [lon, lat]
axes_order: [0, 1]
axis_physical_types: [pos.eq.ra, pos.eq.dec]
name: world
reference_frame: !<tag:astropy.org:astropy/coordinates/frames/icrs-1.1.0>
frame_attributes: {}
unit: [!unit/unit-1.0.0 deg, !unit/unit-1.0.0 deg]
transform: null
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment