Skip to main content

nucl_parquet/
lib.rs

1//! # nucl-parquet
2//!
3//! Fast, thread-safe access to nuclear interaction data stored as Parquet files.
4//!
5//! Designed as the physics data backbone for Monte Carlo particle transport codes.
6//! All data structures are `Send + Sync` — load once, share across threads via `Arc`.
7//!
8//! ## Data sources
9//!
10//! - **EPDL97**: Photon cross-sections (photoelectric, Compton, Rayleigh, pair production)
11//! - **EADL**: Atomic relaxation (fluorescence X-ray and Auger transition probabilities)
12//! - **EEDL**: Electron cross-sections (elastic, bremsstrahlung, ionization)
13//! - **XCOM**: Total mass attenuation coefficients (µ/ρ, µ_en/ρ)
14//! - **Stopping**: NIST PSTAR/ASTAR/ESTAR + dSTAR/tSTAR and CatIMA mass stopping power tables
15//! - **Meta**: Isotopic abundances, radioactive decay chains, and dose rate constants
16//! - **XS**: Nuclear reaction cross-sections (TENDL and other evaluated libraries)
17//!
18//! ## Usage
19//!
20//! ```no_run
21//! use nucl_parquet::PhotonDb;
22//! use std::sync::Arc;
23//!
24//! # fn main() -> nucl_parquet::Result<()> {
25//! let db = Arc::new(PhotonDb::open("path/to/nucl-parquet/meta")?);
26//!
27//! // Thread-safe lookups (no locks, data is immutable)
28//! let xs = db.cross_section(29, 511.0, nucl_parquet::Process::Photoelectric);
29//! let ff = db.form_factor(29, 0.5);  // Rayleigh form factor at q=0.5
30//! # Ok(())
31//! # }
32//! ```
33//!
34//! ## Quick start (with `fetch` feature)
35//!
36//! ```ignore
37//! // requires `fetch` feature
38//! let data = nucl_parquet::DataDir::ensure()?;
39//! let photon = data.photon_db()?;
40//! ```
41
42mod data_dir;
43mod electron;
44mod error;
45mod interp;
46mod meta;
47mod photon;
48mod relaxation;
49mod stopping;
50pub mod store;
51mod subshell_pe;
52mod xcom;
53mod xs;
54
55pub use data_dir::DataDir;
56pub use electron::{ElectronDb, ElectronProcess};
57pub use error::Error;
58pub use interp::XYTable;
59pub use meta::{
60    z_to_symbol, AbundanceEntry, AbundancesDb, CoincidenceEntry, CoincidenceFilter, CoincidencesDb,
61    DecayDb, DecayEntry, DoseConstant, DoseDb, Emission, EmissionEntry, GammaCandidate,
62    RadiationDb,
63};
64pub use photon::{PhotonDb, Process};
65pub use relaxation::{RelaxationDb, Transition, TransitionType};
66pub use stopping::StoppingDb;
67pub use store::{Filter, ParquetStore};
68pub use subshell_pe::SubshellPeDb;
69pub use xcom::XcomDb;
70pub use xs::{CrossSectionDb, XsEntry};
71
72/// Result type for nucl-parquet operations.
73pub type Result<T> = std::result::Result<T, Error>;