scippneutron.metadata.Measurement#

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

A single measurement.

Terminology:

  • An “experiment” is the collection of all related measurements, typically done during one beamtime.

  • A “measurement” is a single step of data collection. It typically corresponds to a single NeXus file or a single entry in a NeXus file.

The Measurement class represents a single measurement but also includes some information about the experiment that this measurement is part of. In particular, experiment_id and experiment_doi encode information about the experiment. All other fields encode information about a measurement; this includes start_time and end_time.

Attributes

model_computed_fields

model_config

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

model_extra

Get extra fields set during validation.

model_fields

model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

run_number_maybe_int

Return the run number as an int if possible.

title

The title of the measurement.

run_number

Run number of the measurement.

experiment_id

An ID for the experiment that this measurement is part of, e.g., proposal ID.

experiment_doi

A DOI for the experiment that this measurement is part of.

start_time

Date and time when the measurement started.

end_time

Date and time when the measurement ended.

end_time: datetime | None#

Date and time when the measurement ended.

experiment_doi: Annotated[str | None, BeforeValidator(_unpack_variable)]#

A DOI for the experiment that this measurement is part of.

experiment_id: Annotated[str | None, BeforeValidator(_unpack_variable)]#

An ID for the experiment that this measurement is part of, e.g., proposal ID.

classmethod from_nexus_entry(entry)[source]#

Construct a Measurement object from a Nexus entry.

Parameters:

entry (Group) – ScippNexus group for a NeXus entry.

Returns:

Measurement – An Measurement 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].

run_number: Annotated[str | None, BeforeValidator(_unpack_variable)]#

Run number of the measurement.

property run_number_maybe_int: int | str | None#

Return the run number as an int if possible.

start_time: datetime | None#

Date and time when the measurement started.

title: Annotated[str | None, BeforeValidator(_unpack_variable)]#

The title of the measurement.