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)
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)
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()
def vdf_generator_seg(signal_data, unique_vectors): return VirtualDarkFieldGenerator(signal_data, unique_vectors)