forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperspy#3498 from ericpre/RELEASE2.3.0
Release 2.3.0
- Loading branch information
Showing
40 changed files
with
1,504 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Processing | ||
========== | ||
|
||
Below is a gallery of examples on signal processing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Baseline Removal | ||
================ | ||
This example shows how to remove a baseline from a 1D signal using the | ||
`pybaselines <https://pybaselines.readthedocs.io>`_ library. | ||
""" | ||
|
||
#%% | ||
# Create a signal | ||
import hyperspy.api as hs | ||
s = hs.data.two_gaussians() | ||
|
||
|
||
#%% | ||
# Remove baseline using :meth:`~.api.signals.Signal1D.remove_baseline`: | ||
s2 = s.remove_baseline(method="aspls", lam=1E7, inplace=False) | ||
|
||
#%% | ||
# Plot the signal and its baseline: | ||
(s + (s-s2) * 1j).plot() | ||
# Choose the second figure as gallery thumbnail: | ||
# sphinx_gallery_thumbnail_number = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
try: | ||
from pybaselines import Baseline | ||
except ImportError: | ||
pass | ||
|
||
|
||
def _remove_baseline(data, method, x, **kwargs): | ||
baseline_fitter = getattr( | ||
Baseline(x, check_finite=False, assume_sorted=True), | ||
method, | ||
) | ||
return data - baseline_fitter(data, **kwargs)[0] |
Oops, something went wrong.