ess.powder.types.Beamline#
- pydantic model ess.powder.types.Beamline[source]#
A beamline / instrument.
name
should be the canonical spelling of the beamline name. The location of the beamline is split intofacility
andsite
, 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 bothfacility
andsite
. 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.
Show JSON schema
{ "title": "Beamline", "description": "A beamline / instrument.\n\n``name`` should be the canonical spelling of the beamline name.\nThe location of the beamline is split into ``facility`` and ``site``, where\na 'facility' is located at a 'site'. For example:\n\n>>> from scippneutron.metadata import Beamline\n>>> beamline = Beamline(\n... name='Amor',\n... facility='SINQ',\n... site='PSI',\n... )\n\nIf there is no separate facility and site, either omit ``site`` or use the same\nvalue for both ``facility`` and ``site``. For example:\n\n>>> beamline = Beamline(\n... name='ESTIA',\n... facility='ESS',\n... site='ESS', # can be omitted\n... )\n\nIf the beamline has been upgraded, provide a revision to indicate\nwhich version of the beamline was used.", "type": "object", "properties": { "name": { "title": "Name", "type": "string" }, "facility": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Facility" }, "site": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Site" }, "revision": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Revision" } }, "required": [ "name" ] }
- Fields:
facility (str | None)
name (str)
revision (str | None)
site (str | None)
- field facility: Annotated[str | None, BeforeValidator(_unpack_variable)] = None#
Facility where the beamline is located.
- Constraints:
func = <function _unpack_variable at 0x7f1da02d0e00>
json_schema_input_type = PydanticUndefined
- field name: Annotated[str, BeforeValidator(_unpack_variable)] [Required]#
Name of the beamline.
- Constraints:
func = <function _unpack_variable at 0x7f1da02d0e00>
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 0x7f1da02d0e00>
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 0x7f1da02d0e00>
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 anNXinstrument
with a ‘name’ field to identify the instrument.instrument_name (
str
|None
, default:None
) – If the entry contains more than oneNXinstrument
group, this parameter must be the name of one of these groups.
- Returns:
Beamline
– A Beamline object constructed from the given Nexus entry.