@@ -18,19 +18,19 @@ def mk_test_image():
18
18
def test_align_spectrum_along_trace_bad_input ():
19
19
image , trace = mk_test_image ()
20
20
with pytest .raises (ValueError , match = 'Unre' ):
21
- im = align_spectrum_along_trace (image , None )
21
+ im = align_spectrum_along_trace (image , None ) # noqa
22
22
23
23
with pytest .raises (ValueError , match = 'method must be' ):
24
- im = align_spectrum_along_trace (image , trace , method = 'int' )
24
+ im = align_spectrum_along_trace (image , trace , method = 'int' ) # noqa
25
25
26
26
with pytest .raises (ValueError , match = 'Spectral axis length' ):
27
- im = align_spectrum_along_trace (image .T , trace , method = 'interpolate' , disp_axis = 0 )
27
+ im = align_spectrum_along_trace (image .T , trace , method = 'interpolate' , disp_axis = 0 ) # noqa
28
28
29
29
with pytest .raises (ValueError , match = 'Displacement axis must be' ):
30
- im = align_spectrum_along_trace (image , trace , disp_axis = 2 )
30
+ im = align_spectrum_along_trace (image , trace , disp_axis = 2 ) # noqa
31
31
32
32
with pytest .raises (ValueError , match = 'The number of image dimensions must be' ):
33
- im = align_spectrum_along_trace (np .zeros ((3 ,6 , 9 )), trace )
33
+ im = align_spectrum_along_trace (np .zeros ((3 , 6 , 9 )), trace ) # noqa
34
34
35
35
36
36
@pytest .mark .parametrize ("method, truth_data, truth_mask, truth_ucty" ,
@@ -39,18 +39,18 @@ def test_align_spectrum_along_trace_bad_input():
39
39
[0 , 0 , 0 , 0.25 , 0.5 , 0.25 , 0 , 0 , 0 ]]).T ,
40
40
np .array ([[0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 ],
41
41
[1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ]]).astype (bool ).T ,
42
- np .array ([[1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. ],
42
+ np .array ([[1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. ],
43
43
[0.5 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 , 0.5 ]]).T ),
44
44
('shift' ,
45
- np .array ([[0. , 0. , 0. , 0. , 1. , 0. , 0. , 0. , 0. ],
46
- [0. , 0. , 0. , 0.5 , 0.5 , 0. , 0. , 0. , 0. ]]).T ,
45
+ np .array ([[0. , 0. , 0. , 0. , 1. , 0. , 0. , 0. , 0. ],
46
+ [0. , 0. , 0. , 0.5 , 0.5 , 0. , 0. , 0. , 0. ]]).T ,
47
47
np .array ([[0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ],
48
48
[1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ]]).astype (bool ).T ,
49
- np .ones ((9 ,2 )))],
49
+ np .ones ((9 , 2 )))],
50
50
ids = ('method=interpolate' , 'method=shift' ))
51
51
def test_align_spectrum_along_trace (method , truth_data , truth_mask , truth_ucty ):
52
52
image , trace = mk_test_image ()
53
- im = align_spectrum_along_trace (image , trace , method = method )
53
+ im = align_spectrum_along_trace (image , trace , method = method )
54
54
assert im .shape == image .shape
55
55
assert im .unit == u .DN
56
56
assert im .uncertainty .uncertainty_type == 'var'
0 commit comments