Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EELSArctan gradients #55

Merged
merged 5 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/user_guide/eds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This chapter describes step-by-step the analysis of an EDS
spectrum (SEM or TEM).

.. NOTE::
See also the `EDS tutorials <https://nbviewer.org/github/hyperspy/hyperspy-demos/tree/main/electron_microscopy/EDS/>`_.
See also the `EDS tutorials <https://nbviewer.org/github/hyperspy/exspy-demos/tree/main/EDS/>`_.

Spectrum loading and parameters
-------------------------------
Expand Down
4 changes: 2 additions & 2 deletions exspy/components/eels_arctan.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class EELSArctan(hs.model.components1D.Expression):

"""

def __init__(self, A=1.0, k=1.0, x0=1.0, module=["numpy", "scipy"], **kwargs):
def __init__(self, A=1.0, k=1.0, x0=1.0, module=["numpy"], **kwargs):
# To be able to still read old file versions that contain this argument
if "minimum_at_zero" in kwargs:
del kwargs["minimum_at_zero"]
super().__init__(
expression="A * (pi /2 + arctan(k * (x - x0)))",
expression="A * (pi /2 + atan(k * (x - x0)))",
name="EELSArctan",
A=A,
k=k,
Expand Down
27 changes: 12 additions & 15 deletions exspy/components/eels_cl_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ class EELSCLEdge(Component):

The preferred option is to use a database of cross sections in GOSH
format. One such database can be freely downloaded from Zenodo at:
https://zenodo.org/record/6599071 while information on the GOSH format
https://doi.org/%s while information on the GOSH format
are available at: https://gitlab.com/gguzzina/gosh .

eXSpy also supports Peter Rez's Hartree Slater cross sections
parametrised as distributed by Gatan in their Digital Micrograph (DM)
software. If Digital Micrograph is installed in the system eXSpy in the
standard location eXSpy should find the path to the HS GOS folder.
Otherwise, the location of the folder can be defined in eXSpy
preferences, which can be done through ~:func:`~.api.preferences.gui` or
the :attr:`~api.preferences.EELS.eels_gos_files_path` variable.
software. If Digital Micrograph is installed in the system in the
standard location, eXSpy should find the path to the HS GOS folder.
Otherwise, the location of the folder can be defined in the eXSpy
preferences, which can be done through :func:`hyperspy.api.preferences.gui` or
the :attr:`hyperspy.api.preferences.EELS.eels_gos_files_path` variable.

Parameters
----------
Expand All @@ -96,8 +96,8 @@ class EELSCLEdge(Component):
The GOS to use. Default is ``'gosh'``. If str, it must the path to gosh
GOS file.
gos_file_path : str, None
Only with GOS='gosh'. Specify the file path of the gosh file
to use. If None, use the file from doi:{}
Only with ``GOS='gosh'``. Specify the file path of the gosh file
to use. If None, use the file from https://doi.org/%s

Attributes
----------
Expand Down Expand Up @@ -140,7 +140,7 @@ class EELSCLEdge(Component):
fine_structure_components : set, default ``set()``
A set containing components to model the fine structure region
of the EELS ionization edge.
""".format(_GOSH_DOI)
"""

_fine_structure_smoothing = 0.3
_fine_structure_coeff_free = True
Expand Down Expand Up @@ -290,12 +290,6 @@ def _set_active_fine_structure_components(self, active, **kwargs):

@property
def fine_structure_smoothing(self):
"""Controls the level of the smoothing of the fine structure.

It must a real number between 0 and 1. The higher close to 0
the higher the smoothing.

"""
return self._fine_structure_smoothing

@fine_structure_smoothing.setter
Expand Down Expand Up @@ -539,3 +533,6 @@ def as_dictionary(self, fullcopy=True):
]
dic["_whitelist"]["fine_structure_components"] = ""
return dic


EELSCLEdge.__doc__ %= (_GOSH_DOI, _GOSH_DOI)
5 changes: 4 additions & 1 deletion exspy/components/pes_core_line_shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def _calculate_shirley_background(values):


class PESCoreLineShape(Component):
""" """
"""
Gaussian component with a Shirley background for photoemission
spectroscopy analysis.
"""

def __init__(self, A=1.0, FWHM=1.0, origin=0.0, ab=0.0, shirley=0.0):
Component.__init__(self, ["A", "FWHM", "origin", "ab", "shirley"])
Expand Down
1 change: 1 addition & 0 deletions upcoming_changes/55.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix gradients of the :class:`~.components.EELSArctan` component.
1 change: 1 addition & 0 deletions upcoming_changes/55.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix broken links in the documentation and missing docstring of the :class:`~.components.PESCoreLineShape` component in the API reference.