Exemplo n.º 1
0
 def test_register_framedata_asterism(self, inplace):
     frame_list = self.gen_frame_list((1024, 1024))
     reg_list = register_framedata_list(frame_list,
                                        algorithm='asterism-matching',
                                        inplace=inplace,
                                        max_control_points=30,
                                        detection_threshold=5)
     assert_equal(len(frame_list), len(reg_list))
     for org, reg in zip(frame_list, reg_list):
         if inplace:
             assert_is(org, reg)
         else:
             assert_is_not(org, reg)
         assert_almost_equal(reg.meta['astropop registration_shift'],
                             org.meta['test expect_shift'],
                             decimal=0)
Exemplo n.º 2
0
 def test_register_framedata_crosscorr(self, inplace):
     frame_list = self.gen_frame_list((1024, 1024))
     reg_list = register_framedata_list(frame_list,
                                        algorithm='cross-correlation',
                                        inplace=inplace,
                                        upsample_factor=10,
                                        space='real')
     assert_equal(len(frame_list), len(reg_list))
     for org, reg in zip(frame_list, reg_list):
         if inplace:
             assert_is(org, reg)
         else:
             assert_is_not(org, reg)
         assert_almost_equal(reg.meta['astropop registration_shift'],
                             org.meta['test expect_shift'],
                             decimal=0)
Exemplo n.º 3
0
 def test_error_incompatible_shapes(self):
     frame_list = [FrameData(np.zeros((i + 1, i + 1))) for i in range(10)]
     with pytest.raises(ValueError, match='incompatible shapes'):
         register_framedata_list(frame_list)
Exemplo n.º 4
0
 def test_error_non_iterable_list(self):
     with pytest.raises(TypeError):
         register_framedata_list(10)
Exemplo n.º 5
0
 def test_error_non_framedata(self):
     with pytest.raises(TypeError, match='Only a list of FrameData'):
         register_framedata_list([np.zeros((10, 10)) for i in range(10)])
Exemplo n.º 6
0
 def test_error_unkown_algorithm(self):
     with pytest.raises(ValueError, match='Algorithm noexisting unknown.'):
         register_framedata_list([FrameData(None) for i in range(10)],
                                 algorithm='noexisting')