https://github.com/anananacr/bblib

beambusters library

https://github.com/anananacr/bblib

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords

python serial-crystallography x-ray-diffraction
Last synced: 6 months ago · JSON representation ·

Repository

beambusters library

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 20
Topics
python serial-crystallography x-ray-diffraction
Created over 2 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

beambusters library

PyPI pyversions

The beambusters library (bblib) is a library that contains methods to determine the detector center directly from still diffraction patterns collected in serial crystallography experiments.

You can find more information about beambusters on this page.

Installation

To install bblib, run the following command in a terminal:

bash pip install bblib

Usage

Configuration dictionaries

To utilize the methods CenterOfMass, FriedelPairs, MinimizePeakFWHM and CircleDetection it is required to have two configuration dictionaries, one for PeakFinder8 and another one for this library itself. The following snippet shows the general structure for both (parameters not used in your case can be omitted):

```python config = { "plotsflag": ..., "searchradius": ..., "pf8": { "maxnumpeaks": ..., "adcthreshold": ..., "minimumsnr": ..., "minpixelcount": ..., "maxpixelcount": ..., "localbgradius": ..., "minres": ..., "maxres": ... }, "peakregion":{ "min": ..., "max": ... }, "gridsearchradius": ..., "canny":{ "sigma": ..., "lowthreshold": ..., "highthreshold": ... }, "houghrank": ..., "braggpeaksforcenterofmasscalculation": ..., "pixelsformaskofbraggpeaks": ..., "polarization": { "applypolarization_correction": ..., "axis": ..., "value": ... } }

PF8Info = { "maxnumpeaks": "adcthreshold": "minimumsnr": ..., "minpixelcount": ..., "maxpixelcount": ..., "localbgradius": ..., "minres": ..., "maxres": ..., "pf8detectorinfo": ..., "badpixelmapfilename": ..., "badpixelmaphdf5path": ..., "pixelmaps": ..., "pixelresolution": ..., "shiftedpixelmaps":... } ```

The pf8_detector_info parameter is a dictionary containing the detector layout information: python pf8_detector_info = { "asic_nx": ..., "asic_ny": ..., "nasics_x": ..., "nasics_y": ... }

The pixel_maps parameter is a dictionary containing the pixel maps numpy array: python pixel_maps = { "x": ..., "y": ..., "z": ..., "radius": ..., "phi": ... }

The methods FriedelPairs, MinimizePeakFWHM and CircleDetection need a plots_info parameter if you want to save plots: python plots_info = { "filename": ..., "folder_name": ..., "root_path": ..., "value_auto": ..., "value_max": ..., "value_min": ..., "axis_lim_auto": ..., "xlim_min": ..., "xlim_max": ..., "ylim_min": ..., "ylim_max": ..., "color_map": ..., "marker_size": ... }

Calling the methods

To calculate the refined detector center of raw data frame as a numpy array using the following methods:

```python from bblib.methods import CenterOfMass centerofmassmethod = CenterOfMass(config=config, PF8Config=PF8Config, plotsinfo=plotsinfo) centercoordinatesfromcenterofmass = centerofmass_method( data = ... )

from bblib.methods import CircleDetection circledetectionmethod = CircleDetection(config=config, PF8Config=PF8Config, plotsinfo=plotsinfo) centercoordinatesfromcircledetection = circledetectionmethod( data = ... ) ```

The FriedelPairs and MinimizePeakFWHMmethod need an initial guess for the refined detector center coordinates initial_guess = [x_0, y_0]

```python from bblib.methods import MinimizePeakFWHM minimizepeakfwhmmethod = MinimizePeakFWHM( config=config, PF8Config=PF8Config, plotsinfo=plotsinfo ) centercoordinatesfromminimizepeakfwhm = minimizepeakfwhmmethod( data = ..., initialguess = ... )

from bblib.methods import FriedelPairs friedelpairsmethod = FriedelPairs( config=config, PF8Config=PF8Config, plotsinfo=plotsinfo ) centercoordinatesfromfriedelpairs = friedelpairsmethod( data = ..., initial_guess= ... ) ```

Contact

Ana Carolina Rodrigues led the development of bblib from 2021 to 2025 at the Deutsches Elektronen-Synchrotron (DESY) in Hamburg, Germany.

For questions, please contact:

Email: sc.anarodrigues@gmail.com

Owner

  • Name: Ana Carolina Rodrigues
  • Login: anananacr
  • Kind: user
  • Location: Hamburg, Germany
  • Company: CFEL - DESY

PhD student in Physics.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: bblib
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Ana Carolina
    family-names: Rodrigues
    email: sc.anarodrigues@gmail.com
    orcid: 'https://orcid.org/0000-0001-6180-9522'
repository-code: 'https://github.com/anananacr/bblib'
abstract: >-
  beambusters library. Python library to refine the detector
  center of diffraction patterns. Implementation of methods
  to determine the direct beam center of diffraction
  patterns.
keywords:
  - beambusters
  - diffraction
  - xray
  - electron
  - crystallography
  - serial crystallography
license: GPL-3.0

GitHub Events

Total
  • Release event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 36
  • Pull request event: 2
  • Create event: 3
Last Year
  • Release event: 1
  • Delete event: 3
  • Issue comment event: 1
  • Push event: 36
  • Pull request event: 2
  • Create event: 3

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • anananacr (18)
Top Labels
Issue Labels
Pull Request Labels