NOMAD CAMELS toolbox

To assist with the evaluation of data, we provide the package nomad_camels_toolbox.

Currently, it only helps with reading the data from the hdf5 file. More functionality is planned for the future.

Installation

To install the NOMAD CAMELS toolbox, run

pip install nomad-camels-toolbox --all-extras

in the Python environment you use for your evaluation. This installs all optional dependencies to use the full functionality. The following options are all included when using --all-extras.

Single installation options can be installed by using pip install nomad-camels-toolbox[option-name] (see pip install documentation). The options are:

  • pandas: This installs pandas as a powerful package for data evaluation along with the toolbox, so the data can be read directly as a pandas.DataFrame. Also see reading data.

  • plotly: Installs plotly, lmfit and pandas. It enables to automatically recreate the plots made in CAMELS, using plotly figures. See recreating plots

  • qt: Installs PySide6 and pyqtgraph. This is used to provide a GUI, to quickly investigate data from CAMELS, see data viewer.

Reading Data

The main usage is to read the data from files produced by CAMELS. To read the file at file_path, you can run:

import nomad_camels_toolbox as nct

data = nct.read_camels_file(your_file_path)

If there is only one entry in the hdf5 file, it will automatically read the main dataset with this code.

Note

For more information, see the code reference.

Your data will then be in a pandas DataFrame and can be accessed like:

detector_data = data['demo_instrument_detectorComm']
motorx_data = data['demo_instrument_motorX']
motory_data = data['demo_instrument_motorY']

You can find more examples for data evaluation in the documentation part regarding h5py.

Recreating Plots

The toolbox provides a function that allows to quickly recreate all plots that were defined within CAMELS, using plotly. You can run it with:

import nomad_camels_toolbox as nct

figures = nct.recreate_plots(your_file_path)

This way it will create all the plots, including those of sub-steps and return the corresponding figures as a dictionary.

For more information see the code reference.

Data Viewer

The data viewer can be used for more functionalities than the h5-viewer can provide. To start the viewer, run:

import nomad_camels_toolbox as nct

figures = nct.run_viewer()

To open your file, you can drag and drop it into the viewer window, once it is running.