def test_vdf_generator_init_with_vectors(self, diffraction_pattern):
        dvm = DiffractionVectors(
            np.array(
                [
                    [np.array([[1, 1], [2, 2]]), np.array([[1, 1], [2, 2], [1, 2]])],
                    [np.array([[1, 1], [2, 2]]), np.array([[1, 1], [2, 2]])],
                ],
                dtype=object,
            )
        )
        dvm.axes_manager.set_signal_dimension(0)

        vdfgen = VirtualDarkFieldGenerator(diffraction_pattern, dvm)
        assert isinstance(vdfgen.signal, ElectronDiffraction2D)
        assert isinstance(vdfgen.vectors, DiffractionVectors)
示例#2
0
def vdf_generator(diffraction_pattern, diffraction_vectors):
    diffraction_pattern.data = np.where(
        diffraction_pattern.data == 0, 0.01,
        diffraction_pattern.data)  # avoid divide by zeroes
    return VirtualDarkFieldGenerator(diffraction_pattern, diffraction_vectors)
示例#3
0
def vdf_segments(signal_data, unique_vectors):
    vdfgen = VirtualDarkFieldGenerator(signal_data, unique_vectors)
    vdfs = vdfgen.get_virtual_dark_field_images(radius=1)
    return vdfs.get_vdf_segments()
示例#4
0
def vdf_generator_seg(signal_data, unique_vectors):
    return VirtualDarkFieldGenerator(signal_data, unique_vectors)