|
2 | 2 | """ |
3 | 3 | Test the API is consistent with units and quantities and follows the rules below. |
4 | 4 |
|
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() |
10 | 9 |
|
11 | 10 | Rules: |
12 | 11 |
|
13 | 12 |
|
14 | 13 | 1. Neither transforms nor inputs support units -> the output is clearly numerical |
15 | 14 | 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 |
21 | 18 | 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 |
25 | 23 |
|
26 | 24 | """ |
27 | 25 |
|
|
0 commit comments