# sas.qtgui.Perspectives.ParticleEditor.datamodel package

## Submodules

## sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation module

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.AngularDistribution

  Bases: `ABC`

  Base class for angular distributions

  abstract property n_points: int

    Number of sample points

  abstractmethod static name() → str

    Name of this distribution

  abstractmethod static parameters() → list[tuple[str, str, type]]

    List of keyword arguments to constructor, names for GUI, and the type of value

  abstractmethod sample_points_and_weights() → tuple[ndarray, ndarray]

    Get sample q vector directions and associated weights

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.MagnetismDefinition(magnetism_function: MagnetismFunction, to_cartesian_conversion: CoordinateSystemTransform)

  Bases: `object`

  Definition of the magnetism vector fields

  magnetism_function: MagnetismFunction
  to_cartesian_conversion: CoordinateSystemTransform

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.ParticleDefinition(sld: SLDDefinition, magnetism: MagnetismDefinition | None)

  Bases: `object`

  Object containing the functions that define a particle

  magnetism: MagnetismDefinition | None
  sld: SLDDefinition

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.QSample(start, end, n_points, is_log)

  Bases: `object`

  Representation of Q Space sampling

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.QSpaceScattering(abscissa: sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.QSample, ordinate: numpy.ndarray, upper_error: numpy.ndarray | None = None, lower_error: numpy.ndarray | None = None)

  Bases: `object`

  abscissa: QSample
  lower_error: ndarray | None = None
  ordinate: ndarray
  upper_error: ndarray | None = None

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.RealSpaceScattering(abscissa: numpy.ndarray, ordinate: numpy.ndarray)

  Bases: `object`

  abscissa: ndarray
  ordinate: ndarray

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.SLDDefinition(sld_function: SLDFunction, to_cartesian_conversion: CoordinateSystemTransform)

  Bases: `object`

  Definition of the SLD scalar field

  sld_function: SLDFunction
  to_cartesian_conversion: CoordinateSystemTransform

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.SamplingDistribution(name: str, bin_edges: numpy.ndarray, counts: numpy.ndarray)

  Bases: `object`

  bin_edges: ndarray
  counts: ndarray
  name: str

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.ScatteringCalculation(q_sampling: QSample, angular_sampling: AngularDistribution, spatial_sampling_method: SpatialDistribution, particle_definition: ParticleDefinition, parameter_settings: CalculationParameters, polarisation_vector: ndarray | None, seed: int | None, bounding_surface_sld_check: bool, sample_chunk_size_hint: int = 100000)

  Bases: `object`

  Specification for a scattering calculation

  angular_sampling: AngularDistribution
  bin_count = 1000
  bounding_surface_sld_check: bool
  parameter_settings: CalculationParameters
  particle_definition: ParticleDefinition
  polarisation_vector: ndarray | None
  q_sampling: QSample
  sample_chunk_size_hint: int = 100000
  seed: int | None
  spatial_sampling_method: SpatialDistribution

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.ScatteringOutput(q_space: sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.QSpaceScattering | None, calculation_time: float, seed_used: int | None)

  Bases: `object`

  calculation_time: float
  q_space: QSpaceScattering | None
  seed_used: int | None

class sas.qtgui.Perspectives.ParticleEditor.datamodel.calculation.SpatialDistribution(radius: float, n_points: int, n_desired_points)

  Bases: `ABC`

  Base class for point generators

  Batches need to be usable for bootstrapping, the run needs to be split into n_bootstrap sections, and the output saved for each section, so that it can be rebuilt in different combinations to establish a variance.

  property allows_bootstrap: bool
  bounding_surface_check_points() → tuple[ndarray, ndarray, ndarray]
  abstractmethod generate(start_index: int, end_index: int) → tuple[ndarray, ndarray, ndarray]

    Generate points from start_index up to end_index

  property info: str

    Information to be displayed in the settings window next to the point number input

## sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters module

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.Background

  Bases: `Parameter`

  Parameter representing the background intensity, always present

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.CalculationParameters(solvent_sld: float, background: float, scale: float, sld_parameters: dict, magnetism_parameters: dict)

  Bases: `NamedTuple`

  Object containing the parameters for a simulation

  background: float

    Alias for field number 1

  magnetism_parameters: dict

    Alias for field number 4

  scale: float

    Alias for field number 2

  sld_parameters: dict

    Alias for field number 3

  solvent_sld: float

    Alias for field number 0

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.FunctionParameter(name: str, value: float, in_use: bool, set_by: ValueSource)

  Bases: `Parameter`

  property in_use
  is_function_parameter = True

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.MagnetismParameterContainer(parameter: FunctionParameter, linked: bool)

  Bases: `NamedTuple`

  Entry describing a magnetism parameter, keeps track of whether it should be linked to an SLD parameter

  linked: bool

    Alias for field number 1

  parameter: FunctionParameter

    Alias for field number 0

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.Parameter(name: str, value: float)

  Bases: `object`

  Base class for parameter descriptions

  property in_use
  is_function_parameter = False

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.Scale

  Bases: `Parameter`

  Parameter representing the scaling, always present

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.SolventSLD

  Bases: `Parameter`

  Parameter representing the solvent SLD, always present

class sas.qtgui.Perspectives.ParticleEditor.datamodel.parameters.ValueSource(*values)

  Bases: `Enum`

  Item that decribes where the current parameter came from

  CODE = 1
  DEFAULT = 0
  FIT = 3
  MANUAL = 2

## sas.qtgui.Perspectives.ParticleEditor.datamodel.types module

class sas.qtgui.Perspectives.ParticleEditor.datamodel.types.CoordinateSystemTransform(*args, **kwargs)

  Bases: `Protocol`

  Type of functions that can represent a coordinate transform

class sas.qtgui.Perspectives.ParticleEditor.datamodel.types.MagnetismFunction(*args, **kwargs)

  Bases: `Protocol`

  Type of functions that can represent magnetism profiles

class sas.qtgui.Perspectives.ParticleEditor.datamodel.types.SLDFunction(*args, **kwargs)

  Bases: `Protocol`

  Type of functions that can represent SLD profiles

## Module contents