pyicat-plus 0.2#

pyicat-plus is a python client for ICAT+.

pyicat-plus has been developed by the Software group of the European Synchrotron.

Getting started#

Register raw datasets with ICAT

icat-store-raw --beamline id00 \
    --proposal id002207 \
    --path /data/visitor/path/to/dataset1 \
    --dataset test1 \
    --sample mysample

icat-store-raw --beamline id00 \
    --proposal id002207 \
    --path /data/visitor/path/to/dataset2 \
    --dataset test2 \
    --sample mysample

Register processed data with ICAT

icat-store-processed --beamline id00 \
    --proposal id002207 \
    --path /data/visitor/path/to/processed \
    --dataset testproc \
    --sample mysample \
    --raw /data/visitor/path/to/dataset1 \
    --raw /data/visitor/path/to/dataset2

Register saved datasets with ICAT

icat-store-from-file /data/visitor/.../__icat__/*.xml

Synchronize raw data with ICAT

icat-sync-raw --beamline id27 --proposal blc14904 --session 20230829 \
              --save-dir /tmp/icat/summary --cache-dir /tmp/icat/cache \
              --format esrfv3 --register --invalidate-cache
  • –save-dir: generate CSV files and bash scripts to resolves issues later

  • –cache-dir: JSON files are created to cache session information

  • –register: will ask for ICAT registration when a session is not properly

    registered with ICAT and removes the session from the cache when answering “yes”

To update the cache periodically, this command is appropriate

icat-sync-raw --save-dir /tmp/icat/summary --cache-dir /tmp/icat/cache \
              --invalidate-cache --no-print
  • –invalidate-cache: remove session from the cache that no longer exist on disk or have changed

  • –no-print: do not print a summary for each session

Save all possible ICAT dataset metadata fields in a NeXus-compliant HDF5 file. By default the definitions from the locally installed icat-esrf-definitions are used but a URL to the ICAT definitions XML file can be provided.

icat-nexus-definitions [--filename=icat.h5] [--url https://...]

Documentation#