LumiSpy / lumispy

Luminescence data analysis with HyperSpy.
https://lumispy.org
GNU General Public License v3.0
26 stars 17 forks source link

Create a `remove_background_signal` function #124

Open jordiferrero opened 2 years ago

jordiferrero commented 2 years ago

Describe the functionality you would like to see.

A method called remove_background_signal where a Signal1D object is subtracted from another Signal1D object. If the axes don't match (in size, offset and scale for UniformDataAxis), the background signal should be rebinned/interpolated to the main signal axis.

Describe the context

When trying to fix some warning bugs, discussion made us realise of the need to rewrite the depreciated remove_background_from_file for a more HyperSpy like method, as discussed here #114 .

Additional information

Ideally it should also support non-uniform data axes with interpolation. Maybe add support a for fitting a ScalableFixedPattern as @ericpre proposed.

Things to do

jlaehne commented 2 years ago

For the method to work with non-uniform axes, we will first have to implement rebinning for non-uniform axes, which would be helpful in any case.