Esempio n. 1
0
 def test_find_sh_hole_center(self):
     """
     Test FindCircleCenter for holes
     """
     # Real image from the DELPHI
     data = tiff.read_data(os.path.join(TEST_IMAGE_PATH, "sh_hole_up.tiff"))
     hole_coordinates = delphi.FindCircleCenter(data[0], delphi.HOLE_RADIUS, 6, darkest=True)
     # FIXME: it fails (but not that important for calibration)
     expected_coordinates = (-0.00014212, 9.405e-05)  # about: 888, 934 = -0.00014212, 9.405e-05
     numpy.testing.assert_almost_equal(hole_coordinates, expected_coordinates)
Esempio n. 2
0
    def test_find_hole_center(self):
        """
        Test FindCircleCenter for holes
        """
        data = hdf5.read_data("sem_hole.h5")
        C, T, Z, Y, X = data[0].shape
        data[0].shape = Y, X

        hole_coordinates = delphi.FindCircleCenter(data[0], 0.02032, 3)
        expected_coordinates = (390.5, 258.5)
        numpy.testing.assert_almost_equal(hole_coordinates,
                                          expected_coordinates)
Esempio n. 3
0
    def test_find_lens_center(self):
        """
        Test FindCircleCenter for lenses
        """
        data = hdf5.read_data("navcam-calib2.h5")
        Z, Y, X = data[0].shape

        lens_coordinates = delphi.FindCircleCenter(data[0][0],
                                                   delphi.LENS_RADIUS, 6)
        expected_coordinates = (450.5, 445.5)
        numpy.testing.assert_almost_equal(lens_coordinates,
                                          expected_coordinates)
Esempio n. 4
0
    def test_find_hole_center(self):
        """
        Test FindCircleCenter for holes
        """
        # Note: this hole image has a better contrast and less noise than typical
        # hole images on the DELPHI
        data = hdf5.read_data(os.path.join(TEST_IMAGE_PATH, "sem_hole.h5"))
        C, T, Z, Y, X = data[0].shape
        data[0].shape = Y, X

        hole_coordinates = delphi.FindCircleCenter(data[0], 0.02032, 6, darkest=True)
        expected_coordinates = (0.0052705, -0.0018415)  # (391.5, 257.5) px
        numpy.testing.assert_almost_equal(hole_coordinates, expected_coordinates)