예제 #1
0
파일: api.py 프로젝트: matkraj/LiberTEM
 def create_point_analysis(self, dataset, x: int = None, y: int = None):
     """
     Select the pixel with coords (y, x) from each frame
     """
     if dataset.shape.nav.dims > 2:
         raise ValueError(
             "incompatible dataset: need at most two navigation dimensions")
     parameters = {
         'cx': x,
         'cy': y,
     }
     parameters = {k: v for k, v in parameters.items() if v is not None}
     return PointMaskAnalysis(dataset=dataset, parameters=parameters)
예제 #2
0
    def create_point_analysis(self, dataset, x: int = None, y: int = None):
        """
        Create an Analysis that selects the pixel with coords (y, x) from each frame

        Returns
        -------
        PointMaskAnalysis : libertem.analysis.base.Analysis
            When run by the Context, this Analysis generates a
            :class:`libertem.analysis.masks.SingleMaskResultSet`.
        """
        if dataset.shape.nav.dims > 2:
            raise ValueError(
                "incompatible dataset: need at most two navigation dimensions")
        parameters = {
            'cx': x,
            'cy': y,
        }
        parameters = {k: v for k, v in parameters.items() if v is not None}
        return PointMaskAnalysis(dataset=dataset, parameters=parameters)