Example #1
0
    def create_radial_fourier_analysis(
            self,
            dataset: DataSet,
            cx: float = None,
            cy: float = None,
            ri: float = None,
            ro: float = None,
            n_bins: int = None,
            max_order: int = None,
            use_sparse: bool = None) -> RadialFourierAnalysis:
        """
        Create an Analysis that calculates the Fourier transform of rings around the center.

        See :ref:`radialfourier app` for details on the method!

        Parameters
        ----------
        dataset
            the dataset to work on
        cx
            center x value
        cy
            center y value
        ri
            inner radius
        ro
            outer radius
        n_bins
            number of bins
        max_order
            maximum order of calculated Fourier component

        Returns
        -------
        RadialFourierAnalysis : libertem.analysis.base.Analysis
            When run by the Context, this Analysis generates a
            :class:`libertem.analysis.radialfourier.RadialFourierResultSet`.
        """
        if dataset.shape.sig.dims != 2:
            raise ValueError(
                "incompatible dataset: need two signal dimensions")
        loc = locals()
        parameters = {
            name: loc[name]
            for name in
            ['cx', 'cy', 'ri', 'ro', 'n_bins', 'max_order', 'use_sparse']
            if loc[name] is not None
        }
        analysis = RadialFourierAnalysis(dataset=dataset,
                                         parameters=parameters)
        return analysis
Example #2
0
    def create_radial_fourier_analysis(self,
                                       dataset,
                                       cx: float = None,
                                       cy: float = None,
                                       ri: float = None,
                                       ro: float = None,
                                       n_bins: int = None,
                                       max_order: int = None,
                                       use_sparse: bool = None):
        """
        Calculate the Fourier transform of rings around the center.

        See :class:`~libertem.analysis.radialfourier.RadialFourierAnalysis` for details!

        Parameters
        ----------
        dataset
            the dataset to work on
        cx
            center x value
        cy
            center y value
        ri
            inner radius
        ro
            outer radius
        n_bins
            number of bins
        max_order
            maximum order of calculated Fourier component
        """
        if dataset.shape.sig.dims != 2:
            raise ValueError(
                "incompatible dataset: need two signal dimensions")
        loc = locals()
        parameters = {
            name: loc[name]
            for name in
            ['cx', 'cy', 'ri', 'ro', 'n_bins', 'max_order', 'use_sparse']
            if loc[name] is not None
        }
        analysis = RadialFourierAnalysis(dataset=dataset,
                                         parameters=parameters)
        return analysis