Skip to content

Commit

Permalink
Add ISPyB sessin ID for XRF Spectrum and Energy Scan.
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonia Beteva authored and marcus-oscarsson committed Jan 30, 2025
1 parent a0a8102 commit ffea8c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mxcubecore/HardwareObjects/ESRFLIMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ def store_beamline_setup(self, session_id, bl_config):
self.ispyb.store_beamline_setup(session_id, bl_config)

def store_energy_scan(self, energyscan_dict):
energyscan_dict["sessionId"] = self.ispyb.get_session_id()
return self.ispyb.store_energy_scan(energyscan_dict)

def store_xfe_spectrum(self, xfespectrum_dict):
xfespectrum_dict["sessionId"] = self.ispyb.get_session_id()
return self.ispyb.store_xfe_spectrum(xfespectrum_dict)

def store_workflow(self, *args, **kwargs):
Expand Down
8 changes: 5 additions & 3 deletions mxcubecore/HardwareObjects/ICATLIMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import logging
import pathlib
import shutil
from time import strftime
from datetime import (
datetime,
timedelta,
)
from time import strftime
from typing import (
List,
Optional,
Expand Down Expand Up @@ -555,7 +555,7 @@ def add_beamline_configuration_metadata(self, metadata, beamline_config):

for config_key, metadata_key in key_mapping.items():
if hasattr(beamline_config, config_key):
metadata[metadata_key] = getattr(beamline_config,config_key)
metadata[metadata_key] = getattr(beamline_config, config_key)

def add_sample_metadata(self, metadata, collection_parameters):
"""
Expand Down Expand Up @@ -651,7 +651,9 @@ def finalize_data_collection(self, collection_parameters):
if not directory.name.startswith("run"):
dataset_name = fileinfo["prefix"]

start_time = collection_parameters.get("collection_start_time", strftime("%Y-%m-%d %H:%M:%S"))
start_time = collection_parameters.get(
"collection_start_time", strftime("%Y-%m-%d %H:%M:%S")
)

if collection_parameters["sample_reference"]["acronym"]:
sample_name = (
Expand Down

0 comments on commit ffea8c1

Please sign in to comment.