Loading cal_config.json +3 −3 Original line number Diff line number Diff line { "Diamond": "/SNS/NOM/IPTS-36186/nexus/NOM_231112.nxs.h5", "Diamond": "/SNS/NOM/IPTS-36186/nexus/NOM_235002.nxs.h5", "Instrument": "NOM", "Date": "2025-10-29", "Date": "2025-11-24", "SampleEnv": "shifter", "OutputDir": "/SNS/NOM/shared/autoreduce/calibration", "GenShadowMask": "shadow_mask_shifter_231112.in", "GenShadowMask": "shadow_mask_shifter_235002.in", "DiaLattParam": 3.5671299351, "GroupMethod": "KMEANS_ED", "SaveInitCalTable": true, Loading utils/nom_cal.py +22 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ import socket import sys import time from Calibration.tofpd import diagnostics sys.path.append("/SNS/users/y8z/miniconda/envs/slack/lib/python3.13/site-packages") from slack_sdk import WebClient calib_file = "/SNS/NOM/shared/CALIBRATION/cal_config.json" start_time = time.time() Loading Loading @@ -1173,6 +1177,19 @@ SaveDiffCal(CalibrationWorkspace="_cal_final", end_time = time.time() print(f"Time taken: {end_time - start_time}") with open(calib_file, "r") as f: calib_config = json.load(f) dia_file = calib_config["Diamond"] out_dir = calib_config["OutputDir"] slack_msg = f"Diamond run `{dia_file}` calibration done.\n" slack_msg += f"Check the calibration H5 file " slack_msg += f"at, `{out_dir}`.\n" sltk = "xoxb-970229573620-6616766768435-KI4xnOfT7roQo9fUpLSSAVjn" client = WebClient(token=sltk) client.chat_postMessage(channel="nomad-monitor", text=slack_msg) # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # Done with calibration # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Loading Loading @@ -1250,6 +1267,9 @@ def plot_bank_rel(bank, d_norm, d_fitted): return html print("\n===================================================") print("Working on diagnostics plot generation and posting.") # Here, we reload the diamond data and extract the engineering calibration # constant first. dia_check = Load(dia_file) Loading Loading @@ -1374,6 +1394,8 @@ for i in range(6): if post_image: request = publish_plot("NOM", run_num, files={"file": html}) print("Done with diagnostics plot generation and posting.") print("===================================================\n") # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # Done with calibration diagnostics plots publishing # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Loading
cal_config.json +3 −3 Original line number Diff line number Diff line { "Diamond": "/SNS/NOM/IPTS-36186/nexus/NOM_231112.nxs.h5", "Diamond": "/SNS/NOM/IPTS-36186/nexus/NOM_235002.nxs.h5", "Instrument": "NOM", "Date": "2025-10-29", "Date": "2025-11-24", "SampleEnv": "shifter", "OutputDir": "/SNS/NOM/shared/autoreduce/calibration", "GenShadowMask": "shadow_mask_shifter_231112.in", "GenShadowMask": "shadow_mask_shifter_235002.in", "DiaLattParam": 3.5671299351, "GroupMethod": "KMEANS_ED", "SaveInitCalTable": true, Loading
utils/nom_cal.py +22 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,10 @@ import socket import sys import time from Calibration.tofpd import diagnostics sys.path.append("/SNS/users/y8z/miniconda/envs/slack/lib/python3.13/site-packages") from slack_sdk import WebClient calib_file = "/SNS/NOM/shared/CALIBRATION/cal_config.json" start_time = time.time() Loading Loading @@ -1173,6 +1177,19 @@ SaveDiffCal(CalibrationWorkspace="_cal_final", end_time = time.time() print(f"Time taken: {end_time - start_time}") with open(calib_file, "r") as f: calib_config = json.load(f) dia_file = calib_config["Diamond"] out_dir = calib_config["OutputDir"] slack_msg = f"Diamond run `{dia_file}` calibration done.\n" slack_msg += f"Check the calibration H5 file " slack_msg += f"at, `{out_dir}`.\n" sltk = "xoxb-970229573620-6616766768435-KI4xnOfT7roQo9fUpLSSAVjn" client = WebClient(token=sltk) client.chat_postMessage(channel="nomad-monitor", text=slack_msg) # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # Done with calibration # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Loading Loading @@ -1250,6 +1267,9 @@ def plot_bank_rel(bank, d_norm, d_fitted): return html print("\n===================================================") print("Working on diagnostics plot generation and posting.") # Here, we reload the diamond data and extract the engineering calibration # constant first. dia_check = Load(dia_file) Loading Loading @@ -1374,6 +1394,8 @@ for i in range(6): if post_image: request = publish_plot("NOM", run_num, files={"file": html}) print("Done with diagnostics plot generation and posting.") print("===================================================\n") # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ # Done with calibration diagnostics plots publishing # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+