NOMAD CAMELS: Configurable Application for Measurements, Experiments and Laboratory Systems

NOMAD CAMELS (short: CAMELS) is a configurable, open-source measurement software that records fully self-describing experimental data. It has its origins in the field of experimental physics where a wide variety of measurement instruments are used in frequently changing experimental setups and measurement protocols. CAMELS provides a graphical user interface (GUI) which allows the user to configure experiments without the need of programming skills or deep understanding of instrument communication. CAMELS translates user-defined measurement protocols into stand-alone executable Python code for full transparency of the actual measurement sequences. Existing large-scale, distributed control systems using e.g. EPICS can be natively implemented. CAMELS is designed with focus on full recording of data and metadata. When shared with others, data produced with CAMELS allow full understanding of the measurement and the resulting data in accordance with the FAIR (Findable, Accessible, Interoperable and Re-usable) principles.


Statement of need
Research data management has piqued greater and greater interest in recent years.Today, research funding agencies demand sustainable research data strategies.The key criterion is to create research data following the FAIR principles and thereby improve world-wide data-driven research (DFG Position Paper, 2018).While one ingredient, electronic lab notebooks, are an important step towards FAIR data, it is equally important to record the measurement data along FAIR principles as early as possible in the research workflow.
In experimental physics many custom-built measurement setups are controlled by very specific software written by individual researchers.This results in a heterogeneous landscape of software fragments for measurements written in many different languages and with often incomplete documentation, making it almost impossible for other researchers to extend existing code.The degree to which the stored raw data is understandable varies greatly but is often unintelligible even for researchers from the same lab.Important metadata such as instrument settings or the actual measurement steps performed to obtain the final raw data are rarely recorded, making it virtually impossible to reproduce experiments.Therefore, the documentation of experiments is incomplete preventing FAIR research data.Although there are some tools available (e.g.SweepMe! (SweepMe, n.d.), iC (Pernstich, 2012), PyMoDAQ (PyMoDAQ, n.d.)) to realise control of arbitrary measurement instruments, they are frequently not open-source or their data output is not compliant to the FAIR principles.

NOMAD CAMELS
CAMELS is an open-source tool that automatically collects all computeraccessible experimental metadata.It features a user-friendly graphical interface that enables the creation and customization of measurements without the need for programming knowledge.By default, the data is stored in a structured HDF5 file format that closely resembles the structure of the NeXus standard (FAIRmat NeXus Proposal, n.d.; Könnecke et al., 2015).The final HDF5 file contains both the actual measurement data and metadata in a single file, compliant to the FAIR principles.
Moreover, CAMELS allows for direct access to the NOMAD repository (Scheidgen, Brückner, et al., 2023), (Scheidgen, Himanen, et al., 2023) or its on-premise installation called NOMAD Oasis enabling direct linking to electronic lab notebook (ELN) entries.The user can for example connect measurements to previous experiment workflows documented in NOMAD ELNs.CAMELS can subsequently upload measurement results directly into the ELN providing a simple and stream-lined data workflow.
CAMELS builds on bluesky (Allan et al., 2019;Bluesky, n.d.) initially developed to control instruments at large-scale research institutions using EPICS (EPICS, n.d.; Knott et al., 1994).In CAMELS, bluesky is employed to orchestrate the instrument communication either directly (e.g. via PyVISA (PyVISA, n.d.)) or via using network protocols.Existing lab infrastructure controlled by EPICS is therefore immediately accessible.A schematic overview of the functionality of CAMELS is displayed in Figure 1.CAMELS provides a comprehensive set of functionalities that can be split into three primary components: instrument management, measurement protocols and manual controls.

Instrument Management
Scientific instruments can be added to CAMELS in two ways: The first involves the instrument manager (c.f. Figure 2a) to add instruments from the official curated driver repository ("CAMELS-Drivers," n.d.).These drivers are installed into the Python environment via pip (Pip, n.d.) with each driver being packaged individually.
The second way is to add self-built drivers by creating the necessary files locally and placing these in the directory specified in the CAMELS settings.To facilitate this process CAMELS provides a driver builder that automatically generates the essential structure and boilerplate code.As CAMELS is an open-source project developed by and for the community, users are encouraged to contribute to the driver library by creating pull requests for new drivers on the GitHub repository ("CAMELS-Drivers," n.d.).
In general, a CAMELS driver comprises two files: One containing the hardware interface communication, the other one defining the available instrument settings.Data communication to instruments is handled via channels that can be set and/or read; they correspond to an instrument's individual functionality or physical property.

Measurement protocols
In CAMELS a measurement protocol is a distinctive sequence of individual steps including setting and reading instrument channels (see Figure 2b), loops, conditional execution, running sub-protocols, PID control, etc.This yields a measurement in a 'recipe-style' format, where the next step is usually executed after the successful completion of the preceding step.Asynchronous data acquisition is supported.
CAMELS translates the protocol created in the GUI into a Python script, which is then executed.The script can be viewed, run independently of CAMELS, and modified if required.CAMELS protocols and settings can be stored and shared with colleagues enabling easy repeatability of experiments.

Manual controls
Certain scientific instruments require manual control before starting predefined measurement routines, e.g.adjusting stages, controlling temperature, valves, pumps, etc.In CAMELS this is achieved through the manual controls functionality which can be applied to any writable instrument channel.

Data output
After executing the measurement protocol, the time-stamped data is by default saved to an HDF5 file with a structure similar to the NeXus standard (Könnecke  et al., 2015).Data can also be exported in CSV format with the metadata exported in JSON.
The stored data can be divided into distinct sections: • Time-stamped raw data obtained during the execution of the measurement protocol.• Instrument settings.
• Human-readable summary of the measurement protocol information (see Figure 3a).• Complete Python script that recorded the data (see Figure 3b) as well as information on the Python environment, i.e. a list of used packages and versions.• User-defined metadata, e.g.sample and user information.

Documentation
In-depth documentation and guides for installing, using and troubleshooting can be found on the CAMELS documentation webpage (Fuchs & Lehmeyer, n.d.).

Figure 1 :
Figure 1: Visualization of CAMELS functionality and workflow.CAMELS connects directly with local instruments and/or large-scale lab infrastructure running network protocols, e.g.EPICS.Customizable measurements protocols are translated into Python code and executed.The output is FAIR-compliant measurement data.

Figure 2 :
Figure 2: (a) The instrument manager allows to install and configure instrument drivers from the curated instrument driver library or the user's hard drive.(b)The measurement protocol editor allows users to configure arbitrary measurement sequences.

Figure 3 :
Figure 3: CAMELS stores measurement data together with rich metadata collected automatically into a structured HDF5 file by default.This includes (a) a human readable measurement protocol summary and (b) the executable Python script that was used to actually record the data.This allows others to understand the data acquisition and to reproduce the experiment.