def test_get_virtual_electron_diffraction(self, vdf_segments: VDFSegment, signal_data): corrsegs = vdf_segments.correlate_vdf_segments(0.1, 1, 1) vs = corrsegs.get_virtual_electron_diffraction( calibration=1, sigma=1, shape=signal_data.axes_manager.signal_shape) assert isinstance(vs, ElectronDiffraction2D)
def test_correlate_segments(self, vdf_segments: VDFSegment, corr_threshold, vector_threshold, segment_threshold): corrsegs = vdf_segments.correlate_vdf_segments( corr_threshold, vector_threshold, segment_threshold) assert isinstance(corrsegs.segments, Signal2D) assert isinstance(corrsegs.vectors_of_segments, DiffractionVectors) assert isinstance(corrsegs.intensities, np.ndarray)
def test_correlate_segments_bad_thresholds(self, vdf_segments: VDFSegment): with pytest.raises( ValueError, match="segment_threshold must be smaller than or equal to vector_threshold", ): corrsegs = vdf_segments.correlate_vdf_segments( vector_threshold=4, segment_threshold=5 )
def test_corelate_segments_bad_thresholds(self, vdf_segments: VDFSegment): corrsegs = vdf_segments.correlate_vdf_segments(vector_threshold=4, segment_threshold=5)
def test_correlate_segments_small_vector_threshold(self, vdf_segments: VDFSegment): corrsegs = vdf_segments.correlate_vdf_segments( corr_threshold=0.7, vector_threshold=0, segment_threshold=-1)
def test_correlate_segments_cropped(self, vdf_segments_cropped: VDFSegment): corrsegs = vdf_segments_cropped.correlate_vdf_segments(0.9, 1, 0) assert isinstance(corrsegs.segments, Signal2D) assert isinstance(corrsegs.vectors_of_segments, DiffractionVectors) assert isinstance(corrsegs.intensities, np.ndarray)