create_full_measurement

specatalog.helpers.full_entry.create_full_measurement(data, base_dir, raw_data_path, fmt)[source]

Create a complete measurement entry including database and file system operations.

The creation process is performed in an atomic manner with respect to the database. File system operations are first carried out in a temporary directory and are only committed to the final archive location after the database transaction has been completed successfully.

The following steps are executed: 1) Creation of the database entry 2) Creation of the measurement directory 3) Copying raw data into the measurement directory 4) Conversion of raw data to HDF5 format

Parameters:
  • data (measurement_model) – Measurement creation model containing all required metadata.

  • base_dir (Path) – Base directory of the measurement archive.

  • raw_data_path (Path) – Path to the raw data file or directory.

  • fmt (str) – Format identifier of the raw data.

Returns:

Result object indicating success or failure of the creation process. In case of success, the measurement ID is provided. In case of failure, the raised exception is included.

Return type:

CreateMeasurementResult