Metadata-Version: 2.4
Name: xreticolo
Version: 0.1.0
Summary: Python bindings for Blazr/RETICOLO x-ray grating diffraction calculations, running on GNU Octave
Author-email: Antoine Wojdyla <awojdyla@lbl.gov>
License: BSD 3-Clause License
        
        Copyright (c) 2026, Repository for the ALS X-Ray Beamline Optics Group
        
        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.
        
        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://github.com/ALS-X-Ray-optics/xReticolo
Project-URL: Repository, https://github.com/ALS-X-Ray-optics/xReticolo
Keywords: x-ray,grating,diffraction,RCWA,reticolo,synchrotron,optics
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Intended Audience :: Science/Research
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE.md
Provides-Extra: examples
Requires-Dist: numpy; extra == "examples"
Requires-Dist: matplotlib; extra == "examples"
Requires-Dist: jupyter; extra == "examples"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# xReticolo

Python bindings for `Blazr.m`, a grating-monochromator diffraction-efficiency
tool built on top of [RETICOLO](https://zenodo.org/records/14631951) (RCWA
solver by J.P. Hugonin and P. Lalanne). Calculations run in
[GNU Octave](https://octave.org/) — no MATLAB license required.

## Requirements

- Python >= 3.9
- [Octave](https://octave.org/) on `PATH` (tested with 10.3.0):
  `brew install octave` (macOS) / `apt install octave` (Debian/Ubuntu)

## Install

```bash
pip install xreticolo
```

## Quickstart

```python
import xreticolo as xr

# blazed grating, +1 order efficiency at 806 eV
alpha_rad, beta_rad, theta_rad = xr.vls_trajectory(
    E_eV=806, E0_eV=806, g_lpm=287.44e3, p_m=24.301, q_m=7.573, cff=1.577
)
eta = xr.efficiency_blazedx(
    g_lpm=287.44e3, blazed_angle_deg=0.40, E_eV=806,
    grazing_angle_rad=1.5707963267948966 - alpha_rad, material="Au", order=1,
)
print(eta)
```

`xr.call(method, *args, nargout=1)` invokes any `Blazr.<method>` static
method directly, so it keeps working as `Blazr.m` gains new methods:

```python
eta = xr.call("efficiency_lamellar", pitch_m, thickness_m, wavelength_m,
              grazing_angle_rad, "Au")
```

See [`examples/`](examples/) for full worked notebooks (blazed and lamellar
gratings, efficiency vs. photon energy).

## What's bundled

- `Blazr.m` — the grating efficiency/trajectory wrapper.
- The RETICOLO V7 RCWA engine (`reticolo_allege`), by J.P. Hugonin and
  P. Lalanne, CC-BY-4.0 — see
  [arXiv:2101.00901](https://arxiv.org/abs/2101.00901) and
  [zenodo.org/records/14631951](https://zenodo.org/records/14631951).
  If you use this package for published work, please cite that paper.
- A handful of tabulated optical constants (Au, Ni, Rh, SiC, C) used by
  `Blazr.m`'s efficiency functions.

## Development

```bash
pip install -e ".[examples,test]"
pytest
```

## License

BSD-3-Clause (see `LICENSE`) for the Python bindings and `Blazr.m`. The
bundled RETICOLO engine is distributed under its original CC-BY-4.0 license
from the authors.
