scippneutron.metadata.Beamline#
- class scippneutron.metadata.Beamline(**data)[source]#
A beamline / instrument.
nameshould be the canonical spelling of the beamline name. The location of the beamline is split intofacilityandsite, 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
siteor use the same value for bothfacilityandsite. 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.
Attributes
model_computed_fieldsConfiguration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
model_extraGet extra fields set during validation.
model_fieldsmodel_fields_setReturns the set of fields that have been explicitly set on this model instance.
Name of the beamline.
Facility where the beamline is located.
Site where the facility is located.
Revision of the beamline in case of upgrades.
- facility: Annotated[str | None, BeforeValidator(_unpack_variable)]#
Facility where the beamline is located.
- 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 anNXinstrumentwith a ‘name’ field to identify the instrument.instrument_name (
Optional[str], default:None) – If the entry contains more than oneNXinstrumentgroup, 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].
- name: Annotated[str, BeforeValidator(_unpack_variable)]#
Name of the beamline.
- revision: Annotated[str | None, BeforeValidator(_unpack_variable)]#
Revision of the beamline in case of upgrades.
- site: Annotated[str | None, BeforeValidator(_unpack_variable)]#
Site where the facility is located.