orsopy.fileio.data_source

Implementation of the data_source for the ORSO header.

class orsopy.fileio.data_source.Experiment(title, instrument, start_date, probe, facility=None, proposalID=None, doi=None, comment=None, **user_kwds)[source]

Bases: Header

A definition of the experiment performed.

Parameters:
  • title (str) – Proposal or project title.

  • instrument (str) – Reflectometer identifier.

  • start_date (datetime) – Start date for the experiment.

  • probe (Literal['neutron', 'x-ray']) – Radiation probe, either 'neutron' or 'x-ray'.

  • facility (Optional[str]) – Facility where the experiment was performed.

  • proposalID (Optional[str]) – Identifier for experiment at a facility.

  • doi (Optional[str]) – Digital object identifier for the experiment, possibly provided by the facility.

title: str
instrument: str
start_date: datetime
probe: Literal['neutron', 'x-ray']
facility: Optional[str] = None
proposalID: Optional[str] = None
doi: Optional[str] = None
comment: Optional[str] = None
class orsopy.fileio.data_source.Sample(name, category=None, composition=None, description=None, size=None, environment=None, sample_parameters=None, model=None, comment=None, **user_kwds)[source]

Bases: Header

A description of the sample measured.

Parameters:
  • name (str) – An identified for the individual sample or the subject and state being measured.

  • category (Optional[str]) – Simple sample description, front (beam side) / back, each side should be one of 'solid/liquid', 'liquid/solid', 'gas/liquid', 'liquid/liquid', 'solid/gas', 'gas/solid'.

  • composition (Optional[str]) – Notes on the nominal composition of the sample e.g. Si | SiO2 (20 angstrom) | Fe (200 angstrom) | air (beam side).

  • description (Optional[str]) – Further details of the sample, e.g. size.

  • size (Optional[ValueVector]) – Sample size in x, y, z direction, where z is parallel to the surface normal and x is along the beam direction (important for footprint correction).

  • environment (Optional[List[str]]) – Name of the sample environment device(s).

  • sample_parameters (Optional[Dict[str, Union[Value, ValueRange, ValueVector, ComplexValue]]]) – Dictionary of sample parameters.

name: str
category: Optional[str] = None
composition: Optional[str] = None
description: Optional[str] = None
size: Optional[ValueVector] = None
environment: Optional[List[str]] = None
sample_parameters: Optional[Dict[str, Union[Value, ValueRange, ValueVector, ComplexValue]]] = None
model: Optional[SampleModel] = None
comment: Optional[str] = None
class orsopy.fileio.data_source.Polarization(value)[source]

Bases: str, Enum

Polarization of the beam used for the reflectivity.

Neutrons: The first symbol indicates the magnetisation direction of the incident beam, the second symbol indicates the direction of the scattered beam. If either polarization or analysis are not employed the symbol is replaced by “o”.

X-rays: Uses the conventional names pi, sigma, left and right. In experiments with polarization analysis the incident and outgoing polarizations are separated with an underscore “_”.

unpolarized = 'unpolarized'
po = 'po'
mo = 'mo'
op = 'op'
om = 'om'
mm = 'mm'
mp = 'mp'
pm = 'pm'
pp = 'pp'
pi = 'pi'
sigma = 'sigma'
left = 'left'
right = 'right'
pi_pi = 'pi_pi'
sigma_sigma = 'sigma_sigma'
pi_sigma = 'pi_sigma'
sigma_pi = 'sigma_pi'
yaml_representer(dumper)[source]
class orsopy.fileio.data_source.InstrumentSettings(incident_angle, wavelength, polarization=None, configuration=None, comment=None, **user_kwds)[source]

Bases: Header

Settings associated with the instrumentation.

Parameters:
  • incident_angle (Union[Value, ValueRange]) – Angle (range) of incidence.

  • wavelength (Union[Value, ValueRange]) – Neutron/x-ray wavelenght (range).

  • polarization (Union[Polarization, ValueVector, None]) – Radiation polarization as one of 'unpolarized', 'p', 'm', 'pp', 'pm', 'mp', 'mm', or a orsopy.fileio.base.ValueVector.

  • configuration (Optional[str]) – Description of the instreument configuration (full polarized/liquid surface/etc).

incident_angle: Union[Value, ValueRange]
wavelength: Union[Value, ValueRange]
polarization: Union[Polarization, ValueVector, None] = None
configuration: Optional[str] = None
comment: Optional[str] = None
class orsopy.fileio.data_source.Measurement(instrument_settings, data_files, additional_files=None, scheme=None, comment=None, **user_kwds)[source]

Bases: Header

The measurement elements for the header.

Parameters:
  • instrument_settings (InstrumentSettings) – Instrumentation details.

  • data_files (List[Union[File, str]]) – Raw data files produced in the measurement.

  • references – Raw reference files used in the reduction.

  • scheme (Optional[Literal['angle- and energy-dispersive', 'angle-dispersive', 'energy-dispersive']]) – Measurement scheme (one of 'angle-dispersive', 'energy-dispersive'/'angle- and energy-dispersive').

instrument_settings: InstrumentSettings
data_files: List[Union[File, str]]
additional_files: Optional[List[Union[File, str]]] = None
scheme: Optional[Literal['angle- and energy-dispersive', 'angle-dispersive', 'energy-dispersive']] = None
comment: Optional[str] = None
class orsopy.fileio.data_source.DataSource(owner, experiment, sample, measurement, comment=None, **user_kwds)[source]

Bases: Header

The data_source object definition.

Parameters:
  • owner (Person) – This refers to the actual owner of the data set, i.e. the main proposer or the person doing the measurement on a lab reflectometer.

  • experiment (Experiment) – Details of the experimental.

  • sample (Sample) – Sample information.

  • measurement (Measurement) – Measurement specifics.

owner: Person
experiment: Experiment
sample: Sample
measurement: Measurement
comment: Optional[str] = None