scippneutron.metadata.Beamline#

class scippneutron.metadata.Beamline(**data)[source]#

A beamline / instrument.

name should be the canonical spelling of the beamline name. The location of the beamline is split into facility and site, where a ‘facility’ is located at a ‘site’. For example:

>>> from scippneutron.metadata import Beamline
>>> beamline = Beamline(
...     name='Amor',
...     facility='SINQ',
...     site='PSI',
... )

If there is no separate facility and site, either omit site or use the same value for both facility and site. For example:

>>> beamline = Beamline(
...     name='ESTIA',
...     facility='ESS',
...     site='ESS',  # can be omitted
... )

If the beamline has been upgraded, provide a revision to indicate which version of the beamline was used.

field facility: Annotated[str | None, BeforeValidator(_unpack_variable)] = None#

Facility where the beamline is located.

Constraints:
  • func = <function _unpack_variable at 0x7f7144f2fd80>

  • json_schema_input_type = PydanticUndefined

classmethod from_nexus_entry(entry, *, instrument_name=None)[source]#

Construct a Beamline object from a Nexus entry.

NeXus does not have a standard method for specifying the facility, site, or revision. This function only sets those fields for known instruments.

Parameters:
  • entry (Group) – ScippNexus group for a NeXus entry. The entry needs to contain an NXinstrument with a ‘name’ field to identify the instrument.

  • instrument_name (str | None, default: None) – If the entry contains more than one NXinstrument group, this parameter must be the name of one of these groups.

Returns:

Beamline – A Beamline object constructed from the given Nexus entry.

model_config: ClassVar[ConfigDict] = {}#

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

field name: Annotated[str, BeforeValidator(_unpack_variable)] [Required]#

Name of the beamline.

Constraints:
  • func = <function _unpack_variable at 0x7f7144f2fd80>

  • json_schema_input_type = PydanticUndefined

field revision: Annotated[str | None, BeforeValidator(_unpack_variable)] = None#

Revision of the beamline in case of upgrades.

Constraints:
  • func = <function _unpack_variable at 0x7f7144f2fd80>

  • json_schema_input_type = PydanticUndefined

field site: Annotated[str | None, BeforeValidator(_unpack_variable)] = None#

Site where the facility is located.

Constraints:
  • func = <function _unpack_variable at 0x7f7144f2fd80>

  • json_schema_input_type = PydanticUndefined