diff --git a/doc/api/signals.rst b/doc/api/signals.rst index 990f15f..a7f97ea 100644 --- a/doc/api/signals.rst +++ b/doc/api/signals.rst @@ -1,5 +1,11 @@ -:mod:`holospy.signals.hologram_image` -------------------------------------- +:mod:`holospy.signals` +---------------------- -.. automodule:: holospy.signals.hologram_image +.. currentmodule:: holospy.signals + +.. autosummary:: + HologramImage + LazyHologramImage + +.. automodule:: holospy.signals :members: diff --git a/doc/api/tools.rst b/doc/api/tools.rst index 2cb5058..36f9a7e 100644 --- a/doc/api/tools.rst +++ b/doc/api/tools.rst @@ -1,5 +1,5 @@ :mod:`holospy.tools` --------------------------- +-------------------- .. automodule:: holospy.tools :members: diff --git a/doc/conf.py b/doc/conf.py index cf8e64c..c7f2b7f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -106,9 +106,7 @@ ] # Check links to API when building documentation -nitpicky = False -# Remove when fixed in hyperspy -nitpick_ignore_regex = [(r"py:.*", r"hyperspy.api.*")] +nitpicky = True # -- Options for numpydoc extension ----------------------------------- @@ -116,8 +114,12 @@ numpydoc_xref_param_type = True numpydoc_xref_ignore = {"type", "optional", "default", "of"} -if Version(numpydoc.__version__) >= Version("1.6.0rc0"): - numpydoc_validation_checks = {"all", "ES01", "EX01", "GL02", "GL03", "SA01", "SS06"} +autoclass_content = "both" + +autodoc_default_options = { + "show-inheritance": True, +} +toc_object_entries_show_parents = "hide" # -- Options for towncrier_draft extension ----------------------------------- diff --git a/doc/user_guide/electron_holography.rst b/doc/user_guide/electron_holography.rst index 279ca37..abcb374 100644 --- a/doc/user_guide/electron_holography.rst +++ b/doc/user_guide/electron_holography.rst @@ -6,14 +6,14 @@ Electron Holography HoloSpy provides the user with a signal class which can be used to process (off-axis) electron holography data: -* :py:class:`~.signals.hologram_image.HologramImage` +* :py:class:`~.signals.HologramImage` -It inherits from :external+hyperspy:py:class:`hyperspy._signals.signal2d.Signal2D` class and thus can +It inherits from :external+hyperspy:py:class:`hyperspy.api.signals.Signal2D` class and thus can use all of its functionality. The usage of the class is explained in the following sections. -To transform a :external+hyperspy:py:class:`hyperspy._signals.signal2d.Signal2D` (or subclass) into a -:py:class:`~.signals.hologram_image.HologramImage` use: +To transform a :external+hyperspy:py:class:`hyperspy.api.signals.Signal2D` (or subclass) into a +:py:class:`~.signals.HologramImage` use: .. code-block:: python @@ -30,10 +30,10 @@ and :ref:`[Joy1993] `. Fourier based reconstruction of off-axis holograms (includes finding a side band in FFT, isolating and filtering it, recenter and calculate inverse Fourier transform) can be performed using the -:py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` method -which returns a :external+hyperspy:py:class:`hyperspy._signals.complex_signal2d.ComplexSignal2D` class, +:py:meth:`~.signals.HologramImage.reconstruct_phase` method +which returns a :external+hyperspy:py:class:`hyperspy.api.signals.ComplexSignal2D` class, containing the reconstructed electron wave. -The :py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` method +The :py:meth:`~.signals.HologramImage.reconstruct_phase` method takes sideband position and size as parameters: .. code-block:: python @@ -51,10 +51,10 @@ The parameters can be found automatically by calling following methods: ... sb='lower') >>> sb_size = im.estimate_sideband_size(sb_position) -:py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_position` +:py:meth:`~.signals.HologramImage.estimate_sideband_position` method searches for maximum of intensity in upper or lower part of FFT pattern (parameter ``sb``) excluding the middle area defined by ``ap_cb_radius``. -:py:meth:`~._signals.hologram_image.HologramImage.estimate_sideband_size` method +:py:meth:`~.signals.HologramImage.estimate_sideband_size` method calculates the radius of the sideband filter as half of the distance to the central band which is commonly used for strong phase objects. Alternatively, the sideband filter radius can be recalculate as 1/3 of the distance @@ -105,7 +105,7 @@ than pixels (by default) by setting ``sb_unit`` value either to ``mrad`` or ... sb_position=sb_position, sb_size=30, ... sb_smoothness=0.05*30,sb_unit='mrad') -Also the :py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` +Also the :py:meth:`~.signals.HologramImage.reconstruct_phase` method can output wave images with desired size (shape). By default the shape of the original hologram is preserved. Though this leads to oversampling of the output wave images, since the information is limited by the size of the @@ -121,11 +121,11 @@ diameter of the sideband as follows: ... output_shape=(out_size, out_size)) Note that the -:py:meth:`~.signals.hologram_image.HologramImage.reconstruct_phase` +:py:meth:`~.signals.HologramImage.reconstruct_phase` method can be called without parameters, which will cause their automatic assignment by -:py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_position` -and :py:meth:`~.signals.hologram_image.HologramImage.estimate_sideband_size` +:py:meth:`~.signals.HologramImage.estimate_sideband_position` +and :py:meth:`~.signals.HologramImage.estimate_sideband_size` methods. This, however, is not recommended for not experienced users. .. _holography.stats-label: @@ -151,7 +151,7 @@ calculated and displayed as follows: Getting hologram statistics --------------------------- There are many reasons to have an access to some parameters of holograms which describe the quality of the data. -:meth:`~.signals.hologram_image.HologramImage.statistics` can be used to calculate carrier frequency, +:meth:`~.signals.HologramImage.statistics` can be used to calculate carrier frequency, fringe spacing and estimate fringe contrast. The method outputs dictionary with the values listed above calculated also in different units. In particular fringe spacing is calculated in pixels (fringe sampling) as well as in calibrated units. Carrier frequency is calculated in inverse pixels or calibrated units as well as radians. @@ -186,4 +186,4 @@ By default ``apodization`` parameter is set to ``hanning`` which applies Hanning especially with extreme sampling of fringes and strong contrast variation due to Fresnel effects the calculated fringe contrast provides only an estimate and the values may differ strongly depending on apodization. -For further information see documentation of :meth:`~.signals.hologram_image.HologramImage.statistics`. +For further information see documentation of :meth:`~.signals.HologramImage.statistics`. diff --git a/holospy/signals/__init__.py b/holospy/signals/__init__.py index 2dc8787..2eb374d 100644 --- a/holospy/signals/__init__.py +++ b/holospy/signals/__init__.py @@ -16,7 +16,15 @@ # You should have received a copy of the GNU General Public License # along with holospy. If not, see . -"""Signals to be operated on. The basic unit of data""" +""" +Modules containing the HoloSpy signals and their lazy counterparts. + +HologramImage + For holography data +LazyHologramImage + For holography data processed lazily + +""" from .hologram_image import HologramImage, LazyHologramImage