pleiades.nuclear.models module
Core physical quantity models with validation.
- class pleiades.nuclear.models.DataRetrievalMethod(value)[source]
-
Enumeration of methods to retrieve nuclear data.
- DIRECT = 'DIRECT'
- API = 'API'
- class pleiades.nuclear.models.EndfLibrary(value)[source]
-
Enumeration of ENDF library versions.
- ENDF_B_VIII_1 = 'ENDF-B-VIII.1'
- ENDF_B_VIII_0 = 'ENDF-B-VIII.0'
- JEFF_3_3 = 'JEFF-3.3'
- JENDL_5 = 'JENDL-5'
- CENDL_3_2 = 'CENDL-3.2'
- TENDL_2021 = 'TENDL-2021'
- class pleiades.nuclear.models.EndfFilenamePattern(value)[source]
-
Filename patterns for different ENDF libraries.
- MAT_FIRST = 'n_{mat}_{z_nozero}-{element}-{a}.zip'
- ELEMENT_FIRST = 'n_{z}-{element}-{a}_{mat}.zip'
- class pleiades.nuclear.models.ParticlePair(*, name: str = 'n+', name_a: str = 'neutron', name_b: str = 'UNK-000', parity_a: int = 1, parity_b: int = 1, charge_a: int = 0, charge_b: int = 0, mass_a: float = 1.00866491578, mass_b: float = 0.0, spin_a: float = 0.5, spin_b: float = 0.0, calculate_penetrabilities: bool = False, calculate_shifts: bool = False, q_value: float | None = None, threshold: float | None = None)[source]
Bases:
BaseModelContainer for information about a pair of particles used in nuclear calculations. .. attribute:: name
Name of the particle pair (e.g., ‘n+U235’ for neutron + Uranium-235).
- type:
str
- validate_q_or_threshold() ParticlePair[source]
Validate that both q_value and threshold are not set at the same time.
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If both q_value and threshold are set
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.SpinGroupChannelInfo(*, channel_number: int, particle_pair_name: str, exclude_channel: int, orbital_angular_momentum: int | None = None, channel_spin: float | None = None, boundary_condition: str | None = None, effective_radius: float | None = None, true_radius: float | None = None)[source]
Bases:
BaseModel- Container for channel information within a given spin group.
Mainly used in SpinGroups to store information about each channel.
- particle_pair_name
Name of the particle pair (e.g., ‘n+U235’). Should match ParticlePair.name
- Type:
- exclude_channel
Whether to exclude this channel from calculations (1: exclude, 0: include)
- Type:
- orbital_angular_momentum
Orbital angular momentum of the channel (default is None)
- Type:
Optional[int]
- effective_radius
Effective radius for the channel (in fermi, default is None)
- Type:
Optional[float]
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.SpinGroups(*, spin_group_number: int = 0, excluded: bool = False, number_of_entry_channels: int = 0, number_of_exit_channels: int = 0, spin: float = 0.0, abundance: float = 0.0, ground_state_spin: float = 0.0, channel_info: List[SpinGroupChannelInfo] = <factory>)[source]
Bases:
BaseModelContainer for all the needed information on a given spin group.
- spin
Spin of the spin group (integer or half-integer). Positive of even parity, negative of odd parity.
- Type:
- channel_info
List of channel information for the spin group.
- Type:
List[SpinGroupChannelInfo]
- channel_info: List[SpinGroupChannelInfo]
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.SpinGroupChannels(*, group_number: Annotated[int, Gt(gt=0)], channels: List[int])[source]
Bases:
BaseModelContainer for a spin group and its associated channels.
This class represents the mapping between a spin group number and the list of channels that belong to that group.
- classmethod validate_channels(v: List[int]) List[int][source]
Validate channel numbers.
- Parameters:
v – List of channel numbers
- Returns:
Validated channel numbers
- Return type:
List[int]
- Raises:
ValueError – If any channel number is invalid
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.RadiusParameters(*, effective_radius: Annotated[float | None, Ge(ge=0)] = None, true_radius: float | None = None, channel_mode: Annotated[int | None, Ge(ge=0), Le(le=1)] = None, vary_effective: VaryFlag | None = None, vary_true: VaryFlag | None = None, spin_groups: List[SpinGroupChannels] | None = None, channels: List[int] | None = None)[source]
Bases:
BaseModelContainer for nuclear radius parameters of isotopes used in SAMMY calculations.
This class represents a set of radius parameters that define both the potential scattering radius and the radius used for penetrabilities and shift calculations. These parameters can be applied globally or to specific spin groups and channels.
- true_radius
The radius (in Fermi) used for penetrabilities and shift calculations. Special values: - If 0: Uses the CRFN value from input file/card set 4 - If negative: Absolute value represents mass ratio to neutron (AWRI),
radius calculated as 1.23(AWRI)^1/3 + 0.8 (ENDF formula)
- Type:
- channel_mode
Determines how channels are specified: - 0: Parameters apply to all channels - 1: Parameters apply only to specified channels in channels list
- Type:
- vary_effective
Flag indicating how effective radius should be treated: - NO (0): Parameter is held fixed - YES (1): Parameter is varied in fitting - PUP (3): Parameter is treated as a propagated uncertainty parameter
- Type:
- vary_true
Flag indicating how true radius should be treated: - USE_FROM_EFFECTIVE (-1): Treated as identical to effective_radius - NO (0): Parameter is held fixed - YES (1): Parameter is varied independently - PUP (3): Parameter is treated as a propagated uncertainty parameter
- Type:
- spin_groups
List of spin group and channel mappings that use these radius parameters. Each entry contains a group number and its associated channels. Group numbers > 500 indicate omitted resonances.
- Type:
List[SpinGroupChannels]
- channels
List of channel numbers when channel_mode=1. When channel_mode=0, this should be None.
- Type:
Optional[List[int]]
Note
This class supports the three different input formats specified in SAMMY: - Default format (card set 7) for <99 spin groups - Alternate format for >99 spin groups - Keyword-based format However, internally it maintains a consistent representation regardless of input format.
- spin_groups: List[SpinGroupChannels] | None
- classmethod validate_spin_groups(v: List[SpinGroupChannels] | None) List[SpinGroupChannels] | None[source]
Validate spin groups and their channels.
- Parameters:
v – List of SpinGroupChannels objects
- Returns:
Validated spin groups
- Return type:
Optional[List[SpinGroupChannels]]
- Raises:
ValueError – If any spin group or channel data is invalid
- classmethod validate_vary_true(v: VaryFlag) VaryFlag[source]
Validate vary_true flag has valid values.
For true radius, we allow an additional special value -1 (USE_FROM_PARFILE)
- Parameters:
v – Vary flag value
- Returns:
Validated flag value
- Return type:
- Raises:
ValueError – If flag value is invalid
- validate_channels() RadiusParameters[source]
Validate channel specifications.
Ensures that: 1. If channel_mode=1, channels must be provided 2. If channel_mode=0, channels should be None
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If channel specifications are invalid
- validate_true_radius_consistency() RadiusParameters[source]
Validate consistency between true_radius and vary_true.
Ensures that: 1. If vary_true is USE_FROM_PARFILE, true_radius matches effective_radius 2. If true_radius is 0, vary_true cannot be USE_FROM_PARFILE 3. If true_radius is negative, it represents AWRI and vary_true cannot be USE_FROM_PARFILE
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If radius specifications are inconsistent
- __str__() str[source]
Return a text table representation of the RadiusParameters object with aligned columns.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.ResonanceEntry(*, resonance_energy: float, capture_width: float, channel1_width: float | None = None, channel2_width: float | None = None, channel3_width: float | None = None, vary_energy: VaryFlag = VaryFlag.NO, vary_capture_width: VaryFlag = VaryFlag.NO, vary_channel1: VaryFlag = VaryFlag.NO, vary_channel2: VaryFlag = VaryFlag.NO, vary_channel3: VaryFlag = VaryFlag.NO, igroup: int)[source]
Bases:
BaseModelThis class handles the parameters for a single resonance entry.
- NOTE
If any particle width Γ is negative, SAMMY uses abs(Γ) for the width and set the associated amplitude γ to be negative.
- vary_energy
Flag indicating if resonance energy is varied
- vary_capture_width
Flag indicating if capture width is varied
- vary_channel1
Flag indicating if channel 1 width is varied
- vary_channel2
Flag indicating if channel 2 width is varied
- vary_channel3
Flag indicating if channel 3 width is varied
- NOTE
0 = no, 1 = yes, 3 = PUP (PUP = Partially Unknown Parameter)
- NOTE
If IGROUP is negative or greater than 50, this resonance will be omitted from the calculation.
- x_value
Special value used to detect multi-line entries (unsupported)
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.IsotopeParameters(*, particle_pairs: List[ParticlePair] | None = <factory>, isotope_information: IsotopeInfo | None = None, abundance: float | None = None, uncertainty: float | None = None, vary_abundance: VaryFlag | None = None, endf_library: EndfLibrary | None = EndfLibrary.ENDF_B_VIII_0, spin_groups: List[SpinGroups] | None = <factory>, resonances: List[ResonanceEntry] | None = <factory>, radius_parameters: List[RadiusParameters] | None = <factory>)[source]
Bases:
BaseModel- Container for a single isotope’s parameters which include.
mass, abundance, uncertainty, treatment flag, and associated
spin groups.
- IsotopeInformation
Information about the isotope
- Type:
Optional[IsotopeInfo]
- spin_groups
List of spin group numbers (negative values indicate omitted resonances)
- Type:
List[int]
- resonances
List of resonance entries
- Type:
List[ResonanceEntry]
- radius_parameters
List of radius parameters
- Type:
List[RadiusParameters]
- particle_pairs: List[ParticlePair] | None
- isotope_information: IsotopeInfo | None
- endf_library: EndfLibrary | None
- spin_groups: List[SpinGroups] | None
- resonances: List[ResonanceEntry] | None
- radius_parameters: List[RadiusParameters] | None
- validate_groups() IsotopeParameters[source]
Validate spin group constraints.
Validates: - Group numbers are non-zero - Negative groups only used to indicate omitted resonances - Group numbers are within valid range for format
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If spin group validation fails
- validate_resonances() IsotopeParameters[source]
Validate that resonance igroups match spin groups.
Validates: - Each resonance igroup is in the list of spin groups
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If resonance igroup validation fails
- validate_radius_parameters() IsotopeParameters[source]
Validate that radius parameter spin groups match isotope spin groups.
Validates: - Each spin group in radius parameters is in the list of isotope spin groups
- Returns:
Self if validation passes
- Return type:
- Raises:
ValueError – If radius parameter spin group validation fails
- append_particle_pair(particle_pair: ParticlePair)[source]
Append a particle pair to the list of particle pairs, if no particle pairs exist then create a new list. This method is used to add a new particle pair to the isotope parameters.
- Parameters:
particle_pair (ParticlePair) – The particle pair to append
- append_spin_group(spin_group: SpinGroups)[source]
Append a spin group to the list of spin groups, if no spin groups exist then create a new list. This method is used to add a new spin group to the isotope parameters.
- Parameters:
spin_group (SpinGroups) – The spin group to append
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pleiades.nuclear.models.nuclearParameters(*, particle: IsotopeInfo = IsotopeInfo(name='n', mass_number=1, element=None, atomic_number=1, mass_data=IsotopeMassData(atomic_mass=1.00866491578, mass_uncertainty=None, binding_energy=None, beta_decay_energy=None), abundance=None, spin=0.5, material_number=None), isotopes: List[IsotopeParameters] = <factory>)[source]
Bases:
BaseModelContainer for nuclear parameters used in SAMMY calculations.
- particle
Incoming particle information (default is a neutron)
- Type:
- isotopes
List of isotope parameters
- Type:
List[IsotopeParameters]
- particle: IsotopeInfo
- isotopes: List[IsotopeParameters]
- validate_isotopes() nuclearParameters[source]
Validate isotope parameters.
Validates: - Each isotope has a unique mass - Each isotope has a unique abundance
- append_isotope(isotope: IsotopeParameters)[source]
Append an isotope to the list of isotopes.
- Parameters:
isotope (IsotopeParameters) – The isotope to append
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].