pleiades.sammy.data.options module

class pleiades.sammy.data.options.DataTypeOptions(value)[source]

Bases: str, Enum

TRANSMISSION = 'TRANSMISSION'
TOTAL_CROSS_SECTION = 'TOTAL CROSS SECTION'
SCATTERING = 'SCATTERING'
ELASTIC = 'ELASTIC'
DIFFERENTIAL_ELASTIC = 'DIFFERENTIAL ELASTIC'
DIFFERENTIAL_REACTION = 'DIFFERENTIAL REACTION'
REACTION = 'REACTION'
INELASTIC_SCATTERING = 'INELASTIC SCATTERING'
FISSION = 'FISSION'
CAPTURE = 'CAPTURE'
SELF_INDICATION = 'SELF INDICATION'
INTEGRAL = 'INTEGRAL'
COMBINATION = 'COMBINATION'
class pleiades.sammy.data.options.SammyData(*, data_file: Path | None = None, data_type: DataTypeOptions = DataTypeOptions.TRANSMISSION, data_format: str = 'LST', energy_units: EnergyUnitOptions = EnergyUnitOptions.eV, cross_section_units: CrossSectionUnitOptions = CrossSectionUnitOptions.barn, data: DataFrame | None = None)[source]

Bases: BaseModel

Container for LST data, loaded from a SAMMY .LST file using pandas.

data_file

Path to the LST file.

Type:

pathlib.Path | None

data

Pandas DataFrame holding the LST data.

Type:

pandas.DataFrame | None

model_config = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

data_file: Path | None
data_type: DataTypeOptions
data_format: str
energy_units: EnergyUnitOptions
cross_section_units: CrossSectionUnitOptions
data: DataFrame | None
model_post_init(_SammyData__context)[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

load()[source]

Load the LST file into a pandas DataFrame and validate columns.

validate_columns()[source]

Validate columns based on data_type.

plot_transmission(show_diff=False, plot_uncertainty=False, figsize=None, title=None, xscale='linear', yscale='linear', data_color='#433E3F', final_color='#ff6361', show=True)[source]

Plot the transmission data and optionally the residuals.

Parameters:
  • show_diff (bool) – If True, plot the residuals.

  • plot_uncertainty (bool) – (Unused, for compatibility)

  • figsize (tuple) – Figure size (width, height) in inches.

  • title (str) – Plot title.

  • xscale (str) – X-axis scale (‘linear’ or ‘log’).

  • yscale (str) – Y-axis scale (‘linear’ or ‘log’).

  • data_color (str) – Color for experimental data points.

  • final_color (str) – Color for fitted theoretical curve.

  • show (bool) – If True, display the plot. If False, return figure object.

Returns:

The figure object if show=False, None otherwise.

Return type:

matplotlib.figure.Figure

plot_cross_section(show_diff=False, plot_uncertainty=False)[source]

Plot the cross-section data.

property energy
property experimental_cross_section
property theoretical_cross_section
property experimental_transmission
property theoretical_transmission