3
3
import astropy .units as u
4
4
5
5
from specreduce .tracing import ArrayTrace
6
- from specreduce .utils import align_spectrum_along_trace
6
+ from specreduce .utils import align_2d_spectrum_along_trace
7
7
8
8
9
9
def mk_test_image ():
@@ -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 ) # noqa
21
+ im = align_2d_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' ) # noqa
24
+ im = align_2d_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 ) # noqa
27
+ im = align_2d_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 ) # noqa
30
+ im = align_2d_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 ) # noqa
33
+ im = align_2d_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" ,
@@ -50,7 +50,7 @@ def test_align_spectrum_along_trace_bad_input():
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_2d_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