Database¶
Parquet-backed data store and protocol for nuclear data.
db ¶
Parquet/Polars data access layer for nuclear data.
DatabaseProtocol ¶
Bases: Protocol
Protocol for nuclear data access.
All physics modules depend on this protocol rather than a concrete database implementation. This enables dependency injection and testing with mock databases.
get_cross_sections ¶
Get all residual production cross-sections for a given reaction.
Returns list of CrossSectionData, one per residual nuclide (Z, A, state).
get_stopping_power ¶
get_stopping_power(source: str, target_Z: int) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]
Get stopping power table for an element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str
|
'PSTAR' or 'ASTAR' |
required |
target_Z
|
int
|
target element charge number |
required |
Returns:
| Type | Description |
|---|---|
tuple[NDArray[float64], NDArray[float64]]
|
(energies_MeV, dedx_MeV_cm2_g) arrays sorted by energy |
get_natural_abundances ¶
Get natural isotopic abundances for an element.
Returns:
| Type | Description |
|---|---|
dict[int, tuple[float, float]]
|
dict mapping A -> (fractional_abundance, atomic_mass_u) |
get_decay_data ¶
Get decay data for a nuclide.
Returns None if nuclide not found in database.
DataStore ¶
Parquet/Polars-backed nuclear data store implementing :class:DatabaseProtocol.
Parameters¶
data_dir:
Path to the nucl-parquet root directory containing meta/,
stopping/, and per-library {library}/xs/ subdirectories.
library:
Nuclear data library to use for cross-sections (e.g. "tendl-2025").
Must correspond to a subdirectory with an xs/ folder.
available_libraries ¶
List cross-section libraries available in the data directory.
get_cross_sections ¶
Get all residual production cross-sections for a given reaction.
get_stopping_power ¶
get_stopping_power(source: str, target_Z: int) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]
Get stopping power table for an element (cached).
get_natural_abundances ¶
Get natural isotopic abundances for an element.
get_decay_data ¶
Get decay data for a nuclide. Returns None if not found.
has_cross_sections ¶
Check if cross-section data exists for a projectile+element combination.
CrossSectionData
dataclass
¶
Cross-section data for one residual nuclide from a specific reaction.
DecayData
dataclass
¶
Decay properties of a nuclide.
DecayMode
dataclass
¶
Single decay mode with daughter and branching ratio.