Skip to content

Commit

Permalink
Trying to optimistically write processing info
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtitus committed Nov 19, 2024
1 parent 313635a commit 0ae9290
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions process_tes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,23 @@ def process_tes(uid, beamline_acronym="ucal", reprocess=False):
processing_info = handle_run(uid, catalog, save_directory, reprocess=reprocess)
# Save calibration information
config_path = "/nsls2/data/sst/legacy/ucal/process_info"
"""
if "data_calibration_info" in processing_info:
cal_path = get_processing_info_file(config_path, "calibration")
os.makedirs(dirname(cal_path), exist_ok=True)
with open(cal_path, "wb") as f:
pickle.dump(processing_info["data_calibration_info"], f)
logger.info(f"Saved calibration info to {cal_path}")
# Save processing info if it exists
if "data_processing_info" in processing_info:
proc_path = get_processing_info_file(config_path, "processing")
os.makedirs(dirname(proc_path), exist_ok=True)
with open(proc_path, "wb") as f:
pickle.dump(processing_info["data_processing_info"], f)
logger.info(f"Saved processing info to {proc_path}")
"""
try:
if "data_calibration_info" in processing_info:
cal_path = get_processing_info_file(config_path, "calibration")
os.makedirs(dirname(cal_path), exist_ok=True)

with open(cal_path, "wb") as f:
pickle.dump(processing_info["data_calibration_info"], f)
logger.info(f"Saved calibration info to {cal_path}")

# Save processing info if it exists
if "data_processing_info" in processing_info:
proc_path = get_processing_info_file(config_path, "processing")
os.makedirs(dirname(proc_path), exist_ok=True)

with open(proc_path, "wb") as f:
pickle.dump(processing_info["data_processing_info"], f)
logger.info(f"Saved processing info to {proc_path}")
except Exception as e:
logger.info(f"Could not write processing info: {e}")
return processing_info

0 comments on commit 0ae9290

Please sign in to comment.