pyspinw.experiment#

Define experiment-level coordination between samples, instruments, and data.

This module is not fully implemented yet.

Classes

Experiment(sample[, instrument])

Represent a neutron scattering experiment.

class pyspinw.experiment.Experiment(sample: Sample, instrument: Instrument | None = None)#

Bases: SPWSerialisable

Represent a neutron scattering experiment.

An experiment combines a physical sample with an optional instrument model. The sample provides the magnetic model to evaluate, while the instrument provides resolution information for the simulated measurement.

calculate(input_q: list[ndarray], n_q: int, field: None = None) → ndarray#

Calculate simulated energies for requested momentum inputs.

Parameters:
  • input_q (list[np.ndarray]) – Momentum-space inputs passed to the sample for q-point generation.

  • n_q (int) – Number of q-points to generate from the requested momentum inputs.

  • field (None, optional) – External field passed through to the sample q-point generator.

Returns:

Energies and intensities calculated from the generated q-points.

Return type:

np.ndarray

fit(data: Data)#

Fit the experimental model to a dataset. This has not been implemented yet.

serialisation_name = 'experiment'#