nook.sources.ensdf_file

Reader for the ENSDF flat files distributed by NNDC.

Livechart exposes only the adopted dataset; these fixed-column card images carry every evaluation, so this is the backend for anything reaction-specific.

Decodes identification, X, Q, H, L, G, P, N, B, E, A, D and R records, plus their data continuations. Comment records are skipped but counted, so nothing disappears silently.

Files: https://www.nndc.bnl.gov/ensarchivals/, one per mass number (ensdf.024); point ENSDF_PATH at the directory.

nook.sources.ensdf_file.default_ensdf_path()[source]

$ENSDF_PATH, else ~/.local/share/ensdf.

class nook.sources.ensdf_file.ENSDFDataset(nuclide, dsid, reference, levels, gammas, skipped=0, band_definitions=None, xref_key=None, properties=None, parents=(), normalization=None, feedings=())[source]

Bases: object

One ENSDF dataset: an identification record and its level scheme.

nuclide
dsid
reference
levels
gammas
skipped
band_definitions
xref_key
properties
parents
normalization
feedings
property is_adopted: bool
to_scheme()[source]
property is_decay: bool

True when the dataset describes a decay (it names a parent).

to_decay_scheme()[source]
nook.sources.ensdf_file.ensdf_markup_to_text(text)[source]

Render ENSDF’s ASCII markup as readable Unicode.

|p7/2[404] becomes π7/2[404]; {+180}Hf becomes 180Hf. Purely cosmetic, but band configurations are unreadable without it.

nook.sources.ensdf_file.parse_continuation_properties(lines)[source]

Decode KEY=value$KEY=value data-continuation records.

Continuation records carry everything the fixed 80-column primary record has no room for: XREF, moments, decay branchings, flags. Values are left as text because their types vary by key.

nook.sources.ensdf_file.parse_xref(value, key=())[source]

Expand an XREF value into dataset symbols.

Accepts plain letters (ABCD), letters flagged as uncertain in parentheses (AB(C)D – kept, since the level was still reported), and the ALL/ALL EXCEPT xy shorthands.

nook.sources.ensdf_file.parse_transfer_l(value)[source]

Angular momentum transfers from an L field like "5(+6)".

nook.sources.ensdf_file.parse_ensdf_text(text)[source]

Parse an ENSDF card-image file into datasets.

nook.sources.ensdf_file.split_energy_offset(text)[source]

Separate an ENSDF energy field into its number and offset symbol.

Manual V.18 allows NUM, NUM+A, A+NUM, A alone, and the SN/SP forms. The suffix spelling is easy to miss: 4172.3+X is a real level 4172.3 keV above an unknown reference, and treating the whole string as a number silently discards the energy.

nook.sources.ensdf_file.parse_references(text)[source]

Decode R records, mapping NSR keynumbers to their citations.

nook.sources.ensdf_file.place_gammas(scheme, tolerance_kev=1.0)[source]

Assign end_index to gammas by energy matching.

Flat-file G records give the transition energy and the level they depopulate, but not the level they feed. This resolves the final level as the one closest to E_start - E_gamma within tolerance_kev, which is what evaluators intend; ambiguous cases are left unplaced.

nook.sources.ensdf_file.place_gammas_in(scheme)[source]

Run place_gammas() on a decay scheme’s daughter levels.

nook.sources.ensdf_file.clear_chain_cache()[source]

Forget every parsed mass chain.

class nook.sources.ensdf_file.ENSDFFileSource(path=None)[source]

Bases: object

Read level schemes from a local ENSDF archival distribution.

name = 'ensdf-file'
datasets(nuclide)[source]

Every dataset for nuclide in its mass chain file.

references(mass_number)[source]

NSR keynumber -> citation, from the mass chain’s REFERENCES dataset.

decay_schemes(nuclide)[source]

Every dataset for this nuclide that describes a decay into it.

fetch(nuclide, dataset=None, place=True)[source]

Return one dataset; defaults to ADOPTED LEVELS.

dataset is matched case-insensitively as a substring of the DSID, so "(P,T)" or "COULOMB" are enough.