Metadata-Version: 2.4
Name: NXRefine
Version: 0.1.1
Summary: Data reduction for single crystal x-ray scattering
Author-email: Raymond Osborn <rayosborn@mac.com>
License: Copyright © 2022, UChicago Argonne, LLC
        All Rights Reserved
        Software Name: NXRefine
        By: Argonne National Laboratory
        
        OPEN SOURCE LICENSE
        
        Redistribution and use in source and binary forms, with or without modification, are
        permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this list of
           conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, this list of
           conditions and the following disclaimer in the documentation and/or other materials
           provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors may be used
           to endorse or promote products derived from this software without specific prior written
           permission.
        
        DISCLAIMER
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
        LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
        CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
        IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        SUCH DAMAGE.
        
Project-URL: Homepage, https://nexpy.github.io/nxrefine
Project-URL: Repository, https://github.com/nexpy/nxrefine.git
Project-URL: Issues, https://github.com/nexpy/nxrefine/issues
Project-URL: Documentation, https://nexpy.github.io/nxrefine
Project-URL: Changelog, https://github.com/nexpy/nxrefine/releases
Keywords: x-ray scattering,data analysis,visualization
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.pdf
Requires-Dist: nexpy>=2.0.0
Requires-Dist: gemmi
Requires-Dist: pyfai
Requires-Dist: julia
Requires-Dist: persist-queue
Requires-Dist: sqlalchemy
Requires-Dist: matplotlib
Requires-Dist: psutil
Requires-Dist: scikit-image
Requires-Dist: xtec
Provides-Extra: gpu
Requires-Dist: pyopencl; extra == "gpu"
Dynamic: license-file

Introduction
============
NXRefine implements a complete workflow for both data acquisition and 
reduction of single crystal diffuse x-ray scattering collected as a 
series of area detector frames during continuous sample rotation. The
data are stored in HDF5 files, which conform to the NeXus data format
standard. These files contain a comprehensive set of metadata, including
the incident wavelength, powder calibration scans used to define 
detector distances, beam centers, and yaw, pitch, and roll corrections. 
Automated peak searches of the three-dimensional data arrays define 
a set of Bragg peaks that are used to define an orientation matrix, 
defined according to Busing and Levy, which is then used to transform
the data from angular coordinates to reciprocal space coordinates using
the CCTW program. Multiple rotations at different detector translations
and offset rotation axes are combined to ensure that there are no gaps 
in the reconstructed data, and allow the construction of masks to 
eliminate detector artifacts due to Compton scattering within the 
sensor layers. Finally, the data can be transformed into 3D-ΔPDF maps
using the punch-and-fill method after symmetrization. 

The workflow is implemented as plugins to the 
[NeXpy package](http://nexpy.github.io/nexpy) that are used to set up 
the basic experimental configuration and sample parameters, and 
determine the orientation matrix. The remaining components of the 
workflow can be run as command-line scripts, or submitted to a queue
for distribution to multiple nodes or processes for simultaneous 
reduction of multiple datasets.

Instructions for running NXRefine are under development. 

The NXRefine package is being developed as part of a DOE-funded project
to utilize advanced computational methods for the analysis of 
single-crystal x-ray scattering from synchrotron sources, such as 
multidimensional spectral analysis and machine learning. Further details
of this project are available on the 
[AXMAS web pages](https://cels.anl.gov/axmas).

Installing and Running
======================
The source code can be downloaded from the NeXpy Git repository:

```
    $ git clone https://github.com/nexpy/nxrefine.git
```

To install in the standard Python location:

```
    $ pip install .
```
Prerequisites
=============
Python Packages
---------------
The following packages are listed as dependencies.

* [nexpy](https://github.com/nexpy/nexpy/)
* [gemmi](https://project-gemmi.github.io/)
* [pyfai](https://pyfai.readthedocs.io/)
* [sqlalchemy](https://docs.sqlalchemy.org/)
* [psutil](https://psutil.readthedocs.io/)

CCTW
----
[CCTW](https://sourceforge.net/projects/cctw/) (Crystal Coordination 
Transformation Workflow) is a C++ package written by Guy Jennings. It
is launched as a separate process by NXRefine, which uses the 
experimental metadata to define the settings file used to define the 
input and output grids. It has to be separately installed.

User Support
============
If you are interested in using this package, please contact Ray Osborn 
(ROsborn@anl.gov). Please report any bugs as a 
[Github issue](https://github.com/nexpy/nxrefine/issues), with relevant 
tracebacks.
