hyperspy.tests.signal package

Submodules

hyperspy.tests.signal.test_1D_tools module

class hyperspy.tests.signal.test_1D_tools.TestAlignTools

Bases: object

setUp()
test_align()
test_align_expand()
test_estimate_shift()
test_shift1D()
class hyperspy.tests.signal.test_1D_tools.TestEstimatePeakWidth

Bases: object

setUp()
test_full_range()
test_too_narrow_range()
test_two_peaks()
class hyperspy.tests.signal.test_1D_tools.TestFindPeaks1D

Bases: object

setUp()
test_height()
test_maxpeaksn()
test_n_peaks()
test_single_spectrum()
test_two_spectra()
test_width()
class hyperspy.tests.signal.test_1D_tools.TestInterpolateInBetween

Bases: object

setUp()
test_delta_float()
test_delta_int()
test_single_spectrum()
test_single_spectrum_in_units()
test_two_spectra()
class hyperspy.tests.signal.test_1D_tools.TestShift1D

Bases: object

setUp()
test_crop_left()
test_crop_right()
class hyperspy.tests.signal.test_1D_tools.TestSmoothing

Bases: object

setUp()
test_lowess()
test_savgol()
test_tv()

hyperspy.tests.signal.test_2D_tools module

class hyperspy.tests.signal.test_2D_tools.TestAlignTools

Bases: object

setUp()
test_align()
test_align_expand()
test_estimate_shift()
class hyperspy.tests.signal.test_2D_tools.TestSubPixelAlign

Bases: object

setUp()
test_align_subpix()
hyperspy.tests.signal.test_2D_tools.test_add_ramp()

hyperspy.tests.signal.test_assign_subclass module

class hyperspy.tests.signal.test_assign_subclass.TestConvertBaseSignal

Bases: object

setUp()
test_base_to_1d()
test_base_to_2d()
test_base_to_complex()
class hyperspy.tests.signal.test_assign_subclass.TestConvertComplexSignal

Bases: object

setUp()
test_complex_to_complex1d()
test_complex_to_complex2d()
class hyperspy.tests.signal.test_assign_subclass.TestConvertComplexSignal1D

Bases: object

setUp()
test_complex_to_dielectric_function()
class hyperspy.tests.signal.test_assign_subclass.TestConvertSignal1D

Bases: object

setUp()
test_signal1d_to_eds_sem()
test_signal1d_to_eds_tem()
test_signal1d_to_eels()
class hyperspy.tests.signal.test_assign_subclass.TestSignalAssignSubclass

Bases: object

test_complex()
test_complex_image()
test_complex_spectrum()
test_dielectric_function()
test_dielectric_function_alias()
test_eds_sem_spectrum()
test_eds_tem_spectrum()
test_eels_spectrum()
test_signal()
test_signal1d()
test_signal2d()
test_weird_complex()
test_weird_real()
test_weird_spectrum()

hyperspy.tests.signal.test_binned module

class hyperspy.tests.signal.test_binned.TestModelBinned

Bases: object

setUp()
test_binned()
test_unbinned()
hyperspy.tests.signal.test_binned.test_dielectric_function_binned_default()
hyperspy.tests.signal.test_binned.test_eds_sem_binned_default()
hyperspy.tests.signal.test_binned.test_eds_tem_binned_default()
hyperspy.tests.signal.test_binned.test_eels_spectrum_binned_default()
hyperspy.tests.signal.test_binned.test_image_binned_default()
hyperspy.tests.signal.test_binned.test_signal_binned_default()
hyperspy.tests.signal.test_binned.test_spectrum_binned_default()

hyperspy.tests.signal.test_complex_signal module

class hyperspy.tests.signal.test_complex_signal.TestComplexProperties

Bases: object

amplitude_ref = array([[ 9. , 10.04987562, 11.18033989], [ 12.36931688, 13.60147051, 14.86606875], [ 16.15549442, 17.4642492 , 18.78829423]])
comp_ref = array([[ 0. +9.j, 1.+10.j, 2.+11.j], [ 3.+12.j, 4.+13.j, 5.+14.j], [ 6.+15.j, 7.+16.j, 8.+17.j]])
imag_ref = array([[ 9, 10, 11], [12, 13, 14], [15, 16, 17]])
phase_ref = array([[ 1.57079633, 1.47112767, 1.39094283], [ 1.32581766, 1.2722974 , 1.22777239], [ 1.19028995, 1.15838589, 1.13095374]])
real_ref = array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
setUp()
test_angle()
test_get_amplitude()
test_get_imag()
test_get_phase()
test_get_real()
test_set_amplitude()
test_set_imag()
test_set_phase()
test_set_real()
hyperspy.tests.signal.test_complex_signal.test_get_unwrapped_phase_1D()
hyperspy.tests.signal.test_complex_signal.test_get_unwrapped_phase_2D()
hyperspy.tests.signal.test_complex_signal.test_get_unwrapped_phase_3D()

hyperspy.tests.signal.test_complex_signal2d module

hyperspy.tests.signal.test_complex_signal2d.test_add_phase_ramp()

hyperspy.tests.signal.test_eds_sem module

class hyperspy.tests.signal.test_eds_sem.Test_energy_units

Bases: object

setUp()
test_beam_energy()
test_line_energy()
class hyperspy.tests.signal.test_eds_sem.Test_get_lines_intentisity

Bases: object

setUp()
test()
test_background_substraction()
test_eV()
test_estimate_integration_windows()
test_with_signals_examples()
class hyperspy.tests.signal.test_eds_sem.Test_metadata

Bases: object

setUp()
test_SEM_to_TEM()
test_add_elements()
test_add_lines()
test_add_lines_auto()
test_default_param()
test_get_calibration_from()
test_rebin_live_time()
test_sum_live_time()
test_sum_live_time2()
test_sum_live_time_out_arg()
test_take_off_angle()
class hyperspy.tests.signal.test_eds_sem.Test_tools_bulk

Bases: object

setUp()
test_electron_range()
test_xray_range()

hyperspy.tests.signal.test_eds_tem module

class hyperspy.tests.signal.test_eds_tem.Test_eds_markers

Bases: object

setUp()
test_manual_add_line()
test_manual_remove_element()
test_plot_auto_add()
class hyperspy.tests.signal.test_eds_tem.Test_get_lines_intentisity

Bases: object

test_with_signals_examples()
class hyperspy.tests.signal.test_eds_tem.Test_metadata

Bases: object

setUp()
test_TEM_to_SEM()
test_add_elements()
test_default_param()
test_get_calibration_from()
test_rebin_live_time()
test_sum_live_time1()
test_sum_live_time2()
test_sum_live_time_out_arg()
class hyperspy.tests.signal.test_eds_tem.Test_quantification

Bases: object

setUp()
test_edx_cross_section_to_zeta()
test_quant_cross_section()
test_quant_lorimer()
test_quant_zeros()
test_quant_zeta()
test_zeta_to_edx_cross_section()
class hyperspy.tests.signal.test_eds_tem.Test_simple_model

Bases: object

setUp()
test_intensity()
test_intensity_dtype_uint()
class hyperspy.tests.signal.test_eds_tem.Test_vacum_mask

Bases: object

setUp()
test_vacuum_mask()

hyperspy.tests.signal.test_eels module

class hyperspy.tests.signal.test_eels.TestAlignZLP

Bases: object

setUp()
test_align_zero_loss_peak_calibrate_false()
test_align_zero_loss_peak_calibrate_true()
test_align_zero_loss_peak_with_spike_signal_range()
test_also_aligns()
class hyperspy.tests.signal.test_eels.TestEstimateZLPCentre

Bases: object

setUp()
test_estimate_zero_loss_peak_centre()
class hyperspy.tests.signal.test_eels.TestPowerLawExtrapolation

Bases: object

setUp()
test_binned()
test_unbinned()
class hyperspy.tests.signal.test_eels.Test_Estimate_Elastic_Scattering_Threshold

Bases: object

setUp()
test_estimate_elastic_scattering_intensity()
test_min_in_window_with_smoothing()
test_min_in_window_without_smoothing()
test_min_in_window_without_smoothing_single_spectrum()
test_min_not_in_window()

hyperspy.tests.signal.test_fancy_indexing module

class hyperspy.tests.signal.test_fancy_indexing.Test1D

Bases: object

setUp()
test_float_index()
test_index()
test_minus_one_index()
test_navigation_indexer_navdim0(*arg, **kw)
test_reverse_slice()
test_signal_indexer_index()
test_signal_indexer_reverse_slice()
test_signal_indexer_slice()
test_signal_indexer_step2_slice()
test_slice_None()
test_slice_out_of_axis()
test_slice_out_of_range_interval_in_axis()
test_slice_out_of_range_interval_not_in_axis(*arg, **kw)
test_step0_slice(*arg, **kw)
class hyperspy.tests.signal.test_fancy_indexing.Test2D

Bases: object

setUp()
test_index()
test_partial()
class hyperspy.tests.signal.test_fancy_indexing.Test3D_Navigate_0_and_1

Bases: object

setUp()
test_1px_navigation_indexer_slice()
test_1px_signal_indexer_slice()
test_dimension_when_indexing()
test_dimension_when_slicing()
test_navigation_indexer_slice_variance_float()
test_navigation_indexer_slice_variance_signal()
test_signal_indexer_slice_variance_float()
test_signal_indexer_slice_variance_signal()
class hyperspy.tests.signal.test_fancy_indexing.Test3D_Navigate_1

Bases: object

setUp()
test_1px_navigation_indexer_slice()
test_1px_signal_indexer_slice()
test_subclass_assignment()
class hyperspy.tests.signal.test_fancy_indexing.Test3D_SignalDim0

Bases: object

setUp()
test_navigation_indexer_signal_dim0()
test_signal_indexer_signal_dim0_idx_error1(*arg, **kw)
test_signal_indexer_signal_dim0_idx_error2(*arg, **kw)
test_signal_indexer_signal_dim0_idx_error3(*arg, **kw)
class hyperspy.tests.signal.test_fancy_indexing.TestEllipsis

Bases: object

setUp()
test_ellipsis_navigation()
test_ellipsis_navigation2()
test_in_between()
class hyperspy.tests.signal.test_fancy_indexing.TestFloatArguments

Bases: object

setUp()
test_float_both()
test_float_end()
test_float_start()
test_float_step()
test_negative_float_step()

hyperspy.tests.signal.test_find_peaks1D_ohaver module

class hyperspy.tests.signal.test_find_peaks1D_ohaver.TestFindPeaks1DOhaver

Bases: object

setUp()
test_find_peaks1D_ohaver_high_amp_thres()
test_find_peaks1D_ohaver_zero_value_bug()

hyperspy.tests.signal.test_folding module

class hyperspy.tests.signal.test_folding.TestSignalFolding

Bases: object

setUp()
test_unfold_full_by_keyword()
test_unfold_navigation()
test_unfold_navigation_by_keyword()
test_unfold_nothing_by_keyword()
test_unfold_signal()
test_unfold_signal_by_keyword()
test_unfolded_context_manager()
test_unfolded_full_by_keywords()
test_unfolded_navigation_by_keyword()
test_unfolded_nothin_by_keyword()
test_unfolded_repr()
test_unfolded_signal_by_keyword()
class hyperspy.tests.signal.test_folding.TestSignalVarianceFolding

Bases: object

setUp()
test_unfold_navigation()
test_unfold_signal()

hyperspy.tests.signal.test_image module

class hyperspy.tests.signal.test_image.Test2D

Bases: object

setUp()
test_to_signal1D()
class hyperspy.tests.signal.test_image.Test3D

Bases: object

setUp()
test_to_signal1D()
class hyperspy.tests.signal.test_image.Test4D

Bases: object

setUp()
test_to_image()

hyperspy.tests.signal.test_integrate_in_range module

class hyperspy.tests.signal.test_integrate_in_range.Test1D

Bases: object

setUp()
test_integrate_in_range()

hyperspy.tests.signal.test_kramers_kronig_transform module

class hyperspy.tests.signal.test_kramers_kronig_transform.Test2D

Bases: object

setUp()

To test the kramers_kronig_analysis we will generate 3 EELSSpectrum instances. First a model energy loss function(ELF), in our case following the Drude bulk plasmon peak. Second, we simulate the inelastic scattering to generate a model scattering distribution (SPC). Finally, we use a lorentzian peak with integral equal to 1 to simulate a ZLP.

test_bethe_sum_rule()
test_df_given_n()

The kramers kronig analysis method applied to the signal we have just designed above will return the CDF for the Drude bulk plasmon. Hopefully, we recover the signal by inverting the CDF.

test_df_given_thickness()

The kramers kronig analysis method applied to the signal we have just designed above will return the CDF for the Drude bulk plasmon. Hopefully, we recover the signal by inverting the CDF.

test_thickness_estimation()

Kramers kronig analysis gives a rough estimation of sample thickness. As we have predefined sample thickness for our scattering distribution, we can use it for testing putposes.

test_thicness_input_array(*arg, **kw)

hyperspy.tests.signal.test_map_method module

class hyperspy.tests.signal.test_map_method.TestImage

Bases: object

setup()
test_axes_argument()
test_constant_sigma()
test_constant_sigma_navdim0()
test_variable_sigma()
class hyperspy.tests.signal.test_map_method.TestSignal0D

Bases: object

setup()
test()
test_nav_dim_1()
class hyperspy.tests.signal.test_map_method.TestSignal1D

Bases: object

setup()
test_constant_sigma()

hyperspy.tests.signal.test_remove_background module

class hyperspy.tests.signal.test_remove_background.TestRemoveBackground1DGaussian

Bases: object

setUp()
test_background_remove_gaussian()
test_background_remove_gaussian_full_fit()
class hyperspy.tests.signal.test_remove_background.TestRemoveBackground1DPowerLaw

Bases: object

setUp()
test_background_remove_pl()
test_background_remove_pl_int()

hyperspy.tests.signal.test_rgb module

class hyperspy.tests.signal.test_rgb.TestRGBA16

Bases: object

setUp()
test_torgb()
test_touint()
test_wrong_bs(*arg, **kw)
test_wrong_rgb(*arg, **kw)
class hyperspy.tests.signal.test_rgb.TestRGBA8

Bases: object

setUp()
test_torgb()
test_touint()
test_wrong_bs(*arg, **kw)
test_wrong_rgb(*arg, **kw)

hyperspy.tests.signal.test_signal_operators module

class hyperspy.tests.signal.test_signal_operators.TestBinaryOperators

Bases: object

setUp()
test_broadcast_in_place()
test_broadcast_in_place_missing_sig_wrong(*arg, **kw)
test_broadcast_missing_sig()
test_broadcast_missing_sig_and_nav()
test_equal_naxes_diff_shape()
test_sum_in_place_same_shape_signals()
test_sum_in_place_same_shape_signals_not_aligned()
test_sum_same_shape_signals()
test_sum_same_shape_signals_not_aligned()
test_sum_wrong_shape(*arg, **kw)
class hyperspy.tests.signal.test_signal_operators.TestUnaryOperators

Bases: object

setUp()
test_abs()
test_invert()
test_minus()
test_plus()

hyperspy.tests.signal.test_signal_subclass_conversion module

class hyperspy.tests.signal.test_signal_subclass_conversion.Test1d

Bases: object

setUp()
test_as_signal1D()
test_as_signal2D(*arg, **kw)
test_set_EELS()
class hyperspy.tests.signal.test_signal_subclass_conversion.Test2d

Bases: object

setUp()
test_as_signal1D()
test_as_signal1D_T()
test_as_signal2D()
test_as_signal2D_T()
test_s2EELS2im2s()
class hyperspy.tests.signal.test_signal_subclass_conversion.Test3d

Bases: object

setUp()
test_as_signal1D_0()
test_as_signal1D_1()
test_as_signal1D_2()
test_as_signal1D_contigous()
test_as_signal2D_1()
test_as_signal2D_2()
test_as_signal2D_3()
test_as_signal2D_contigous()
test_remove_axis()

hyperspy.tests.signal.test_spectrum module

class hyperspy.tests.signal.test_spectrum.Test2D

Bases: object

setUp()
test_to_signal2D()
class hyperspy.tests.signal.test_spectrum.Test3D

Bases: object

setUp()
test_to_signal2D()
class hyperspy.tests.signal.test_spectrum.Test4D

Bases: object

setUp()
test_to_signal2D()

hyperspy.tests.signal.test_tools module

class hyperspy.tests.signal.test_tools.Test2D

Bases: object

setUp()
test_axis_by_str()
test_crop_float()
test_crop_int()
test_estimate_poissonian_noise_copy_data()
test_estimate_poissonian_noise_noarg()
test_estimate_poissonian_noise_with_args()
test_histogram()
test_numpy_func()
test_numpy_unfunc_one_arg_titled()
test_numpy_unfunc_one_arg_untitled()
test_numpy_unfunc_two_arg_titled()
test_numpy_unfunc_two_arg_untitled()
test_print_summary()
test_split_axis0()
test_split_axis1()
test_split_axisE()
test_split_default()
test_sum_x()
test_sum_x_E()
test_unfold_image()
test_unfold_image_returns_true()
class hyperspy.tests.signal.test_tools.Test3D

Bases: object

setUp()
test_default_navigation_max()
test_default_navigation_mean()
test_default_navigation_min()
test_default_navigation_std()
test_default_navigation_sum()
test_default_navigation_var()
test_get_navigation_signal_dtype()
test_get_navigation_signal_given_data()
test_get_navigation_signal_given_dtype()
test_get_navigation_signal_nav_dim0()
test_get_navigation_signal_nav_dim1()
test_get_navigation_signal_nav_dim2()
test_get_navigation_signal_nav_dim3()
test_get_navigation_signal_wrong_data_shape(*arg, **kw)
test_get_navigation_signal_wrong_data_shape_dim0(*arg, **kw)
test_get_signal_signal_dtype()
test_get_signal_signal_given_data()
test_get_signal_signal_given_dtype()
test_get_signal_signal_nav_dim0()
test_get_signal_signal_nav_dim1()
test_get_signal_signal_nav_dim2()
test_get_signal_signal_nav_dim3()
test_get_signal_signal_wrong_data_shape(*arg, **kw)
test_get_signal_signal_wrong_data_shape_dim0(*arg, **kw)
test_indexmax()
test_rebin()
test_rebin_const_variance()
test_rebin_no_variance(*arg, **kw)
test_swap_axes_iteration()
test_swap_axes_simple()
test_valuemax()
class hyperspy.tests.signal.test_tools.Test4D

Bases: object

setUp()
test_diff_axis()
test_diff_data()
test_image_signal_unfolded_back_to_false()
test_image_signal_unfolded_deepcopy()
test_image_signal_unfolded_false()
test_image_signal_unfolded_true()
test_rollaxis_int()
test_rollaxis_str()
test_unfold_image()
test_unfold_spectrum()
test_unfold_spectrum_returns_true()
test_unfold_spectrum_signal_returns_false()
class hyperspy.tests.signal.test_tools.TestDerivative

Bases: object

setup()
test_derivative_data()
class hyperspy.tests.signal.test_tools.TestOutArg

Bases: object

setup()
test_as_image()
test_as_spectrum()
test_derivative()
test_diff()
test_get_histogram()
test_histogram_axis_changes()
test_inav()
test_inav_variance()
test_indexmax()
test_integrate1D()
test_integrate_simpson()
test_isig()
test_isig_variance()
test_masked_array_mean()
test_masked_array_sum()
test_masked_arrays_out()
test_max()
test_mean()
test_min()
test_rebin()
test_std()
test_sum()
test_sum_return_1d_signal()
test_valuemax()
test_var()
test_wrong_out_shape(*arg, **kw)
test_wrong_out_shape_masked(*arg, **kw)
class hyperspy.tests.signal.test_tools.TestTranspose

Bases: object

setUp()
test_navigation_int_transpose()
test_navigation_iterable_axes_transpose()
test_navigation_iterable_int_transpose()
test_navigation_iterable_names_transpose()
test_navigation_one_name(*arg, **kw)
test_optimize()
test_signal_int_transpose()
test_signal_iterable_axes_transpose()
test_signal_iterable_int_transpose()
test_signal_iterable_names_transpose()
test_signal_one_name(*arg, **kw)
test_too_many_navigation_axes(*arg, **kw)
test_too_many_signal_axes(*arg, **kw)
test_transpose_shortcut()
hyperspy.tests.signal.test_tools.test_signal_iterator()

Module contents