Metadata-Version: 2.4
Name: braggedgemodeling
Version: 0.2.0
Summary: Bragg Edge modeling
Author-email: ORNL neutron imaging team <neutronimaging@ornl.gov>
Maintainer-email: ORNL neutron imaging team <neutronimaging@ornl.gov>
License: BSD
Project-URL: homepage, https://github.com/ornlneutronimaging/braggedgemodeling
Project-URL: repository, https://github.com/ornlneutronimaging/braggedgemodeling
Project-URL: issues, https://github.com/ornlneutronimaging/braggedgemodeling/issues
Keywords: instrument,neutron,imaging,Bragg Edge
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: matplotlib
Requires-Dist: diffpy.structure
Requires-Dist: periodictable
Requires-Dist: pandas
Provides-Extra: texture
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Dynamic: license-file

[![CI](https://github.com/ornlneutronimaging/braggedgemodeling/actions/workflows/CI.yml/badge.svg)](https://github.com/ornlneutronimaging/braggedgemodeling/actions/workflows/CI.yml)
[![codecov](https://codecov.io/gh/ornlneutronimaging/braggedgemodeling/graph/badge.svg)](https://codecov.io/gh/ornlneutronimaging/braggedgemodeling)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.00973/status.svg)](https://doi.org/10.21105/joss.00973)

# Bragg Edge Modeling

This python package provides tools to model and help analyze neutron Bragg Edge imaging data.

**Main functionality:** given lattice structure of a material and optionally a texture model and
an instrument beam model,
calculate neutron Bragg Edge spectrum as a function of neutron wavelength.

## Features
* Calculation of basic Bragg Edge spectrum from crystal structure specification, assuming an isotropic powder sample, and accounting for various contributions to neutron scattering including, for example, diffraction and inelastic scattering (using incoherent approximation)
* Modeling of texture:
  - March Dollase
* Modeling of peak profile:
  - Jorgensen model
* Flexible design to allow future extension to texture and peak profile models
* Allow easy fitting to measured Bragg Edge data

## Installation

`braggedgemodeling` requires Python 3.12+.

```bash
# from PyPI
pip install braggedgemodeling

# or from conda (anaconda.org neutronimaging channel)
conda install -c conda-forge -c neutronimaging braggedgemodeling
```

The distribution is named `braggedgemodeling` (the short name `bem` is already taken on PyPI) and the **import package is also `braggedgemodeling`**. Code written against the old `bem` module can add a one-line alias as a drop-in stop-gap:

```python
import braggedgemodeling as bem
```

For development, the project uses [pixi](https://pixi.sh/):

```bash
git clone https://github.com/ornlneutronimaging/braggedgemodeling.git
cd braggedgemodeling
pixi run test   # build the environment and run the test suite
```

## Documentation

Please refer to https://ornlneutronimaging.github.io/braggedgemodeling for documentation
on installation, usage, and API.

## Community guidelines

**How to contribute**

Please clone the repository, make changes and make a pull request.

**How to report issues**

Please use [the github issues](https://github.com/ornlneutronimaging/braggedgemodeling/issues) to report issues or bug reports.

**Support**

Please either use [the github issues](https://github.com/ornlneutronimaging/braggedgemodeling/issues) to ask for support, or contact the authors directly using email.


## Known problems
* Debye temperatures are listed in a [table](braggedgemodeling/DebyeTemp.py), which is missing data for some elements.
  However, users can provide their own table in a [configuration file](tests/bem.conf).
