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_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.TestSubPixelAlign

Bases: object

setUp()
test_align_subpix()

hyperspy.tests.signal.test_apply_function module

class hyperspy.tests.signal.test_apply_function.TestImage

Bases: object

setup()
test_axes_argument()
test_constant_sigma()
test_constant_sigma_navdim0()
test_variable_sigma()
class hyperspy.tests.signal.test_apply_function.TestSignal1D

Bases: object

setup()
test_constant_sigma()

hyperspy.tests.signal.test_assign_subclass module

class hyperspy.tests.signal.test_assign_subclass.TestSignalAssignSubclass

Bases: object

setUp()
test_type_to_eels()
test_type_to_spectrumsimulation()
hyperspy.tests.signal.test_assign_subclass.test_eels_spectrum()
hyperspy.tests.signal.test_assign_subclass.test_eels_spectrum_simulation()
hyperspy.tests.signal.test_assign_subclass.test_image()
hyperspy.tests.signal.test_assign_subclass.test_image_simulation()
hyperspy.tests.signal.test_assign_subclass.test_signal()
hyperspy.tests.signal.test_assign_subclass.test_spectrum()
hyperspy.tests.signal.test_assign_subclass.test_weird_spectrum()

hyperspy.tests.signal.test_attributes module

hyperspy.tests.signal.test_attributes.test_eels_record_by()
hyperspy.tests.signal.test_attributes.test_eels_signal_origin()
hyperspy.tests.signal.test_attributes.test_eels_signal_type()
hyperspy.tests.signal.test_attributes.test_image_record_by()
hyperspy.tests.signal.test_attributes.test_image_signal_origin()
hyperspy.tests.signal.test_attributes.test_image_signal_type()
hyperspy.tests.signal.test_attributes.test_image_simulation_record_by()
hyperspy.tests.signal.test_attributes.test_image_simulation_signal_origin()
hyperspy.tests.signal.test_attributes.test_image_simulation_signal_type()
hyperspy.tests.signal.test_attributes.test_signal_record_by()
hyperspy.tests.signal.test_attributes.test_signal_signal_origin()
hyperspy.tests.signal.test_attributes.test_signal_signal_type()
hyperspy.tests.signal.test_attributes.test_simulation_record_by()
hyperspy.tests.signal.test_attributes.test_simulation_signal_origin()
hyperspy.tests.signal.test_attributes.test_simulation_signal_type()
hyperspy.tests.signal.test_attributes.test_spectrum_record_by()
hyperspy.tests.signal.test_attributes.test_spectrum_signal_origin()
hyperspy.tests.signal.test_attributes.test_spectrum_signal_type()
hyperspy.tests.signal.test_attributes.test_spectrum_simulation_record_by()
hyperspy.tests.signal.test_attributes.test_spectrum_simulation_signal_origin()
hyperspy.tests.signal.test_attributes.test_spectrum_simulation_signal_type()

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_image_simulation_binned_default()
hyperspy.tests.signal.test_binned.test_signal_binned_default()
hyperspy.tests.signal.test_binned.test_simulation_binned_default()
hyperspy.tests.signal.test_binned.test_spectrum_binned_default()
hyperspy.tests.signal.test_binned.test_spectrum_simulation_binned_default()

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_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_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()
class hyperspy.tests.signal.test_eds_tem.Test_quantification

Bases: object

setUp()
test_quant_lorimer()
test_quant_zeros()
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_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_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_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_remove_background module

class hyperspy.tests.signal.test_remove_background.TestRemoveBackground1DGaussian

Bases: object

setUp()
test_background_remove_gaussian()
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_3()
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_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_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_rebin()
test_rebin_const_variance()
test_rebin_no_variance(*arg, **kw)
test_swap_axes_iteration()
test_swap_axes_simple()
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()
hyperspy.tests.signal.test_tools.test_signal_iterator()

Module contents