Skip to content

Commit eef7645

Browse files
committed
clarify rules
1 parent a0ba136 commit eef7645

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

gwcs/tests/test_api_consistent.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
"""
33
Test the API is consistent with units and quantities and follows the rules below.
44
5-
WCS functions which considered for this work are part of the legacy API:
6-
wcs(x, y)
7-
wcs.invert(ra, dec)
8-
wcs.forward_transform(x,y), wcs.backward_transform() and wcs.get_transform(f1, f2)
9-
wcs.numerical_inverse(ra, dec) - does not support units
5+
WCS functions considered part of the legacy API:
6+
wcs()
7+
wcs.invert()
8+
wcs.transform()
109
1110
Rules:
1211
1312
1413
1. Neither transforms nor inputs support units -> the output is clearly numerical
1514
for all functions above
16-
2. Transforms support units but inputs do not -> return quantities assuming the
17-
units of the coordinate frame
18-
- This should work for the wcs methods (wcs(x,y) and wcs.invert
19-
- The methods using transforms should follow modeling rules and will require units
20-
on the input and raise an exception if not
15+
2. Transforms support units but inputs do not -> return numbers/arrays
16+
Attach the units of the input coordinate frame to the inputs.
17+
Evaluate the transforms and strip the output of units
2118
3. Both transforms and inputs support units -> return quantities
22-
- Wcs methods return quantities
23-
- Transforms work and return quantities
24-
4. Transforms do not support units but inputs are quantities -> raise an error
19+
4. Transforms do not support units but inputs are quantities -> return quantities
20+
Strip the units from the inputs after converting to the units of the input frame.
21+
Evaluate the transform and attach the units of the output frame.
22+
5. Inputs are High Level Objects - raise an error
2523
2624
"""
2725

0 commit comments

Comments
 (0)