Skip to content

BM32ESRF/laueimproc

Repository files navigation

Laue Pre-Processing

[license MIT] [linting: pylint] [testing] [versions]

Description

This generic Laue diagram analyser ables you to qualify quikly the quality of diferents elements in a big set of Laue diagram brut pictures. Using general image processing tools, it classifies and gives some scores to the spots and the diagrams. The aim is to didgest very quikely the big amount of data in order to help you to select the best subset for the indexation.

Installation

Refer to the installation tab in the documentation.

To access a pre-built documentation, clone the repository then open the index.html file with a local browser:

if ! [ -d ~/laueimproc_git ]; then git clone https://github.com/BM32ESRF/laueimproc.git ~/laueimproc_git; fi
firefox ~/laueimproc_git/doc/build/html/index.html

Example

There are a lot of jupyter-notebook examples in the folder notebooks and a lot of atomic example are directly written in the docstrings.

import matplotlib.pyplot as plt
from laueimproc import Diagram, DiagramsDataset
from laueimproc.io import get_samples

def init(diag: Diagram) -> int:
    """Find the spots and sorted it by intensities."""
    diag.find_spots()  # peaks search
    diag.filter_spots(diag.compute_rois_sum().argsort(descending=True))  # sorted
    return len(diag)  # nbr of peaks

diagrams = DiagramsDataset(get_samples())  # create an ordered diagram dataset
diagrams[:10].apply(init)  # init the 10 first diagrams

diagrams[6].plot(plt.figure(layout="tight")); plt.show()