From cd7eb8401e24498eca4dd4d8759cdd8ea8f401ea Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Apr 2025 14:35:09 +0200 Subject: [PATCH] 04.2025 --- .../camera_config/SARBD02-DSCR051.json | 1 + .../camera_config/SARCL01-DSCR170.json | 8 +- .../camera_config/SARES11-SPEC125-M1.json | 2 +- .../camera_config/SARES11-SPEC125-M3.json | 2 +- .../camera_config/SARES20-CAMS142-C2.json | 16 +- .../camera_config/SARES20-CAMS142-M1.json | 12 +- .../camera_config/SARES20-CAMS142-M3.json | 14 +- .../camera_config/SARES20-PROF141-M1.json | 2 +- .../camera_config/SARES20-PROF142-M1.json | 14 +- .../camera_config/SARFE10-PSSS059-LB.json | 4 +- .../camera_config/SARFE10-PSSS059.json | 15 +- .../camera_config/SAROP10-PSETUP.json | 2 +- .../camera_config/SATBD02-DSCR050.json | 12 +- .../camera_config/SATES22-ADTEST1-CAM1.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM10.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM11.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM12.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM2.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM3.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM4.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM5.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM6.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM7.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM8.json | 14 ++ .../camera_config/SATES22-ADTEST1-CAM9.json | 14 ++ .../camera_config/SATES30-CAMS182-GIGE1.json | 13 +- .../camera_config/SATES30-CAMS182-GIGE2.json | 8 +- .../camera_config/SATES30-CAMS182-GIGE4.json | 4 +- .../camera_config/SATES30-CAMS182-GIGE5.json | 2 +- .../camera_config/SATOP11-PSAS079.json | 8 +- .../camera_config/SINBD01-DSCR010.json | 2 +- .../camera_config/SLAAR21-LCAM-C561.json | 12 +- configuration/camera_config/servers.json | 1 + .../pipeline_config/SARBD02-DSCR050_pref.json | 12 + .../pipeline_config/SARBD02-DSCR050_sp.json | 9 +- .../pipeline_config/SARBD02-DSCR051_pref.json | 12 + .../SARBD02-DSCR05x_merge.json | 10 + .../SARES11-SPEC125-M1_psen_db.json | 2 +- .../SARES11-SPEC125-M3_spec_db.json | 11 +- .../pipeline_config/SARES21-PBPS141_proc.json | 16 +- .../pipeline_config/SARFE10-PBPS053_proc.json | 38 +-- .../SARFE10-PSSS059-LB_psss.json | 2 +- .../SARFE10-PSSS059-LB_sp_br.json | 26 ++ .../pipeline_config/SARFE10-PSSS059_psss.json | 4 +- .../pipeline_config/SAROP11-PBPS110_proc.json | 38 +-- .../pipeline_config/SAROP11-PBPS122_proc.json | 38 +-- .../pipeline_config/SAROP21-ATT01_proc.json | 8 +- .../pipeline_config/SAROP21-PBPS103_proc.json | 38 +-- .../pipeline_config/SAROP21-PBPS133_proc.json | 38 +-- .../pipeline_config/SAROP31-PBPS113_proc.json | 38 +-- .../pipeline_config/SAROP31-PBPS149_proc.json | 38 +-- .../pipeline_config/SATBD02-DSCR050_sp.json | 12 +- .../SATES21-CAMS-PATT1_spec_db.json | 18 +- .../SATES22-ADTEST1-CAM10_proc.json | 16 ++ .../SATES22-ADTEST1-CAM11_proc.json | 16 ++ .../SATES22-ADTEST1-CAM12_proc.json | 16 ++ .../SATES22-ADTEST1-CAM1_proc.json | 16 ++ .../SATES22-ADTEST1-CAM1_sp.json | 12 + .../SATES22-ADTEST1-CAM2_proc.json | 16 ++ .../SATES22-ADTEST1-CAM3_proc.json | 16 ++ .../SATES22-ADTEST1-CAM4_proc.json | 16 ++ .../SATES22-ADTEST1-CAM5_proc.json | 16 ++ .../SATES22-ADTEST1-CAM6_proc.json | 16 ++ .../SATES22-ADTEST1-CAM7_proc.json | 16 ++ .../SATES22-ADTEST1-CAM8_proc.json | 16 ++ .../SATES22-ADTEST1-CAM9_proc.json | 16 ++ .../SATES30-RIXS-CAM01_proc.json | 4 +- .../SATES31-CAMS187-RIXS1_sp.json | 2 +- .../pipeline_config/SATOP11-PSAS079_psas.json | 8 +- .../SATOP21-PMOS127-2D_sp.json | 3 +- .../pipeline_config/SATOP31-ATT01_proc.json | 16 +- .../SATOP31-PMOS132-2D_pmos.json | 2 +- .../pipeline_config/X08DB-FE-CAM1_sp.json | 11 + .../pipeline_config/jfj-cristall_db.json | 2 +- .../pipeline_config/permanent_instances.json | 25 +- configuration/pipeline_config/servers.json | 42 +++- .../user_scripts/SARES11-SPEC125-M1_2tt.py | 6 +- .../user_scripts/SARES11-SPEC125-M3_spec.py | 7 +- .../user_scripts/SATOP31-ATT01_Debug_proc.py | 51 ++-- .../user_scripts/propagate_camera_name.py | 10 + .../swissfel_spectral_processing.py | 234 ++++++++++++++++++ 81 files changed, 1064 insertions(+), 293 deletions(-) create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM1.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM10.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM11.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM12.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM2.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM3.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM4.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM5.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM6.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM7.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM8.json create mode 100644 configuration/camera_config/SATES22-ADTEST1-CAM9.json create mode 100644 configuration/pipeline_config/SARBD02-DSCR050_pref.json create mode 100644 configuration/pipeline_config/SARBD02-DSCR051_pref.json create mode 100644 configuration/pipeline_config/SARBD02-DSCR05x_merge.json create mode 100644 configuration/pipeline_config/SARFE10-PSSS059-LB_sp_br.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM10_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM11_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM12_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM1_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM1_sp.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM2_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM3_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM4_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM5_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM6_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM7_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM8_proc.json create mode 100644 configuration/pipeline_config/SATES22-ADTEST1-CAM9_proc.json create mode 100644 configuration/pipeline_config/X08DB-FE-CAM1_sp.json create mode 100644 configuration/user_scripts/propagate_camera_name.py create mode 100644 configuration/user_scripts/swissfel_spectral_processing.py diff --git a/configuration/camera_config/SARBD02-DSCR051.json b/configuration/camera_config/SARBD02-DSCR051.json index 49bd5ae..be9677f 100644 --- a/configuration/camera_config/SARBD02-DSCR051.json +++ b/configuration/camera_config/SARBD02-DSCR051.json @@ -13,6 +13,7 @@ "reference_marker_width": 100.0 }, "source": "SARBD02-DSCR051", + "source_type": "bsread", "mirror_y": false, "rotate": 0, "mirror_x": false, diff --git a/configuration/camera_config/SARCL01-DSCR170.json b/configuration/camera_config/SARCL01-DSCR170.json index 36b0443..cf684e5 100644 --- a/configuration/camera_config/SARCL01-DSCR170.json +++ b/configuration/camera_config/SARCL01-DSCR170.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 633, - 731, - 1456, - 1008 + 551, + 568, + 1367, + 847 ], "reference_marker_width": 6000.0, "reference_marker_height": 2000.0, diff --git a/configuration/camera_config/SARES11-SPEC125-M1.json b/configuration/camera_config/SARES11-SPEC125-M1.json index 65ac219..a37fe82 100644 --- a/configuration/camera_config/SARES11-SPEC125-M1.json +++ b/configuration/camera_config/SARES11-SPEC125-M1.json @@ -22,7 +22,7 @@ "source": "SARES11-SPEC125-M1", "connections": 2, "buffer_size": 0, - "forwarder_port": 9000, + "_forwarder_port": 9000, "debug": true, "protocol": "tcp", "group": [ diff --git a/configuration/camera_config/SARES11-SPEC125-M3.json b/configuration/camera_config/SARES11-SPEC125-M3.json index 367ae37..cfd4498 100644 --- a/configuration/camera_config/SARES11-SPEC125-M3.json +++ b/configuration/camera_config/SARES11-SPEC125-M3.json @@ -22,7 +22,7 @@ "source": "SARES11-SPEC125-M3", "connections": 2, "buffer_size": 0, - "forwarder_port": 9006, + "_forwarder_port": 9006, "debug": true, "protocol": "tcp", "group": [ diff --git a/configuration/camera_config/SARES20-CAMS142-C2.json b/configuration/camera_config/SARES20-CAMS142-C2.json index 4350090..bf55881 100644 --- a/configuration/camera_config/SARES20-CAMS142-C2.json +++ b/configuration/camera_config/SARES20-CAMS142-C2.json @@ -1,19 +1,19 @@ { "camera_calibration": { "reference_marker": [ - 259, - 211, - 263, - 215 + 550, + 929, + 552, + 931 ], - "reference_marker_width": 16.71604938271605, - "reference_marker_height": 16.666666666666668, + "reference_marker_width": 4.179012345679013, + "reference_marker_height": 5.555555555555556, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, - "mirror_x": true, + "mirror_x": false, "mirror_y": false, - "rotate": 0, + "rotate": 3, "roi": null, "image_background": null, "source_type": "bsread", diff --git a/configuration/camera_config/SARES20-CAMS142-M1.json b/configuration/camera_config/SARES20-CAMS142-M1.json index b0008bc..16e001d 100644 --- a/configuration/camera_config/SARES20-CAMS142-M1.json +++ b/configuration/camera_config/SARES20-CAMS142-M1.json @@ -1,13 +1,13 @@ { "camera_calibration": { "reference_marker": [ - 2842, - 835, - 3259, - 1248 + 533, + 592, + 535, + 594 ], - "reference_marker_width": 2000.0, - "reference_marker_height": 2000.0, + "reference_marker_width": 10.256410256410257, + "reference_marker_height": 10.256410256410257, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, diff --git a/configuration/camera_config/SARES20-CAMS142-M3.json b/configuration/camera_config/SARES20-CAMS142-M3.json index 71fdc09..d0591af 100644 --- a/configuration/camera_config/SARES20-CAMS142-M3.json +++ b/configuration/camera_config/SARES20-CAMS142-M3.json @@ -1,18 +1,18 @@ { "camera_calibration": { "reference_marker": [ - 1868, - 1009, - 2234, - 1396 + 1068, + 1017, + 1070, + 1019 ], - "reference_marker_width": 2000.0, - "reference_marker_height": 2000.0, + "reference_marker_width": 19.333333333333332, + "reference_marker_height": 22.4, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, "mirror_x": false, - "mirror_y": false, + "mirror_y": true, "rotate": 0, "roi": null, "image_background": null, diff --git a/configuration/camera_config/SARES20-PROF141-M1.json b/configuration/camera_config/SARES20-PROF141-M1.json index cfe24d1..26b0f2b 100644 --- a/configuration/camera_config/SARES20-PROF141-M1.json +++ b/configuration/camera_config/SARES20-PROF141-M1.json @@ -19,7 +19,7 @@ "source_type": "bsread", "name": "SARES20-PROF141-M1", "protocol": "tcp", - "source": "SLAAR21-LCAM-CS841", + "source": "SARES20-PROF141-M1", "_debug": true, "alias": [ "PROF_KB (SARES20-PROF141-M1) (SARES20-PROF141-M1)" diff --git a/configuration/camera_config/SARES20-PROF142-M1.json b/configuration/camera_config/SARES20-PROF142-M1.json index 05bcde3..9a17c0c 100644 --- a/configuration/camera_config/SARES20-PROF142-M1.json +++ b/configuration/camera_config/SARES20-PROF142-M1.json @@ -1,19 +1,19 @@ { "camera_calibration": { "reference_marker": [ - 212, - 313, - 707, - 807 + 417, + 575, + 428, + 577 ], - "reference_marker_width": 100.0, - "reference_marker_height": 100.0, + "reference_marker_width": 11.0, + "reference_marker_height": 2.0, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, "mirror_x": false, "mirror_y": false, - "rotate": 0, + "rotate": 3, "roi": null, "image_background": null, "source_type": "bsread", diff --git a/configuration/camera_config/SARFE10-PSSS059-LB.json b/configuration/camera_config/SARFE10-PSSS059-LB.json index ff96c51..43e334d 100644 --- a/configuration/camera_config/SARFE10-PSSS059-LB.json +++ b/configuration/camera_config/SARFE10-PSSS059-LB.json @@ -13,7 +13,7 @@ }, "mirror_x": false, "mirror_y": false, - "rotate": 0, + "rotate": 1, "roi": null, "image_background": null, "source_type": "bsread", @@ -21,7 +21,7 @@ "EXPOSURE": 9.9, "HSSPEED": 1, "REGIONX_START": 1, - "REGIONY_START": 500, + "REGIONY_START": 1.0, "REGIONX_END": 2560.0, "REGIONY_END": 2160.0, "TRIGGER": 2, diff --git a/configuration/camera_config/SARFE10-PSSS059.json b/configuration/camera_config/SARFE10-PSSS059.json index 84c2a51..ad467cc 100644 --- a/configuration/camera_config/SARFE10-PSSS059.json +++ b/configuration/camera_config/SARFE10-PSSS059.json @@ -54,5 +54,18 @@ "protocol": "tcp", "forwarder_port": 8890, "_forwarder_port": 9090, - "no_client_timeout": 0 + "no_client_timeout": 0, + "trigger_configuration": { + "server": "SGE-CPCW-73-EVR0", + "pulser": 5, + "values": { + "Evt-Trig0-SP": 14, + "Evt-Set0-SP": 0, + "Evt-Reset0-SP": 0, + "Delay-SP": 800.1, + "Width-SP": 5.0, + "SetReset-Sel.SCAN": 0 + }, + "SW_PULSID_SRC": 3 + } } \ No newline at end of file diff --git a/configuration/camera_config/SAROP10-PSETUP.json b/configuration/camera_config/SAROP10-PSETUP.json index 932f55e..2fc2676 100644 --- a/configuration/camera_config/SAROP10-PSETUP.json +++ b/configuration/camera_config/SAROP10-PSETUP.json @@ -8,7 +8,7 @@ "source_type": "epics", "name": "SAROP10-PSETUP", "source": "", - "Aramis camera_calib_datetime": "2025-02-12 16:57:11", + "Aramis camera_calib_datetime": "2025-04-25 12:31:53", "Alvra camera_calib_datetime": "2024-09-26 10:16:24", "Bernina camera_calib_datetime": "2024-09-25 15:48:01", "Cristallina camera_calib_datetime": "2024-09-25 15:48:08" diff --git a/configuration/camera_config/SATBD02-DSCR050.json b/configuration/camera_config/SATBD02-DSCR050.json index 20072b9..3fc9e48 100644 --- a/configuration/camera_config/SATBD02-DSCR050.json +++ b/configuration/camera_config/SATBD02-DSCR050.json @@ -1,13 +1,13 @@ { "camera_calibration": { "reference_marker": [ - 843, - 100, - 1516, - 1911 + 1096, + 725, + 1289, + 1376 ], - "reference_marker_width": 6000.0, - "reference_marker_height": 16000.0, + "reference_marker_width": 1420.0, + "reference_marker_height": 4790.0, "angle_horizontal": 8.0, "angle_vertical": 0.0 }, diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM1.json b/configuration/camera_config/SATES22-ADTEST1-CAM1.json new file mode 100644 index 0000000..5d5e14a --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM1.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM1", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM1", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM10.json b/configuration/camera_config/SATES22-ADTEST1-CAM10.json new file mode 100644 index 0000000..2b14583 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM10.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM10", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM10", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM11.json b/configuration/camera_config/SATES22-ADTEST1-CAM11.json new file mode 100644 index 0000000..73088d5 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM11.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM11", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM11", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM12.json b/configuration/camera_config/SATES22-ADTEST1-CAM12.json new file mode 100644 index 0000000..96ca3b6 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM12.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM12", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM12", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM2.json b/configuration/camera_config/SATES22-ADTEST1-CAM2.json new file mode 100644 index 0000000..22abaa1 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM2.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM2", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM2", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM3.json b/configuration/camera_config/SATES22-ADTEST1-CAM3.json new file mode 100644 index 0000000..990ee3c --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM3.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM3", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM3", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM4.json b/configuration/camera_config/SATES22-ADTEST1-CAM4.json new file mode 100644 index 0000000..d60dfe7 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM4.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM4", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM4", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM5.json b/configuration/camera_config/SATES22-ADTEST1-CAM5.json new file mode 100644 index 0000000..235ee1c --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM5.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM5", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM5", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM6.json b/configuration/camera_config/SATES22-ADTEST1-CAM6.json new file mode 100644 index 0000000..5900fc2 --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM6.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM6", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM6", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM7.json b/configuration/camera_config/SATES22-ADTEST1-CAM7.json new file mode 100644 index 0000000..692520e --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM7.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM7", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM7", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM8.json b/configuration/camera_config/SATES22-ADTEST1-CAM8.json new file mode 100644 index 0000000..81f7b5d --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM8.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM8", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM8", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES22-ADTEST1-CAM9.json b/configuration/camera_config/SATES22-ADTEST1-CAM9.json new file mode 100644 index 0000000..b15382e --- /dev/null +++ b/configuration/camera_config/SATES22-ADTEST1-CAM9.json @@ -0,0 +1,14 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES22-ADTEST1-CAM9", + "protocol": "tcp", + "source": "SATES22-ADTEST1-CAM9", + "_debug": true, + "group": [ + "Photonics" + ] +} \ No newline at end of file diff --git a/configuration/camera_config/SATES30-CAMS182-GIGE1.json b/configuration/camera_config/SATES30-CAMS182-GIGE1.json index b3f0a5c..7b6cef6 100644 --- a/configuration/camera_config/SATES30-CAMS182-GIGE1.json +++ b/configuration/camera_config/SATES30-CAMS182-GIGE1.json @@ -1,5 +1,16 @@ { - "camera_calibration": null, + "camera_calibration": { + "reference_marker": [ + 219, + 281, + 316, + 382 + ], + "reference_marker_width": 5000.0, + "reference_marker_height": 5000.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, "mirror_x": true, "mirror_y": false, "rotate": 0, diff --git a/configuration/camera_config/SATES30-CAMS182-GIGE2.json b/configuration/camera_config/SATES30-CAMS182-GIGE2.json index 5f34857..0055bb2 100644 --- a/configuration/camera_config/SATES30-CAMS182-GIGE2.json +++ b/configuration/camera_config/SATES30-CAMS182-GIGE2.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 195, - 22, - 1433, - 1240 + 736, + 100, + 1828, + 1175 ], "reference_marker_width": 5000.0, "reference_marker_height": 5000.0, diff --git a/configuration/camera_config/SATES30-CAMS182-GIGE4.json b/configuration/camera_config/SATES30-CAMS182-GIGE4.json index 4ced804..4e795a0 100644 --- a/configuration/camera_config/SATES30-CAMS182-GIGE4.json +++ b/configuration/camera_config/SATES30-CAMS182-GIGE4.json @@ -2,9 +2,9 @@ "camera_calibration": { "reference_marker": [ 64, - 193, + 223, 258, - 415 + 429 ], "reference_marker_width": 500.0, "reference_marker_height": 500.0, diff --git a/configuration/camera_config/SATES30-CAMS182-GIGE5.json b/configuration/camera_config/SATES30-CAMS182-GIGE5.json index 014c02f..989c6c4 100644 --- a/configuration/camera_config/SATES30-CAMS182-GIGE5.json +++ b/configuration/camera_config/SATES30-CAMS182-GIGE5.json @@ -11,7 +11,7 @@ "angle_horizontal": 0.0, "angle_vertical": 0.0 }, - "mirror_x": false, + "mirror_x": true, "mirror_y": false, "rotate": 0, "roi": null, diff --git a/configuration/camera_config/SATOP11-PSAS079.json b/configuration/camera_config/SATOP11-PSAS079.json index 14aa07f..130ad0e 100644 --- a/configuration/camera_config/SATOP11-PSAS079.json +++ b/configuration/camera_config/SATOP11-PSAS079.json @@ -27,10 +27,10 @@ "hardware_configuration": { "EXPOSURE": 1.0, "HSSPEED": 0.0, - "REGIONX_START": 1020.0, - "REGIONY_START": 840.0, - "REGIONX_END": 2810.0, - "REGIONY_END": 1180.0, + "REGIONX_START": 8.0, + "REGIONY_START": 810.0, + "REGIONX_END": 4104.0, + "REGIONY_END": 1200.0, "TRIGGER": 1, "TRIGGERSOURCE": 0, "DELAY": 0.0, diff --git a/configuration/camera_config/SINBD01-DSCR010.json b/configuration/camera_config/SINBD01-DSCR010.json index d5b0944..44d9831 100644 --- a/configuration/camera_config/SINBD01-DSCR010.json +++ b/configuration/camera_config/SINBD01-DSCR010.json @@ -2,7 +2,7 @@ "camera_calibration": { "reference_marker": [ 68, - 46, + 64, 1655, 1594 ], diff --git a/configuration/camera_config/SLAAR21-LCAM-C561.json b/configuration/camera_config/SLAAR21-LCAM-C561.json index 583393c..f468ae5 100644 --- a/configuration/camera_config/SLAAR21-LCAM-C561.json +++ b/configuration/camera_config/SLAAR21-LCAM-C561.json @@ -1,13 +1,13 @@ { "camera_calibration": { "reference_marker": [ - 55, - 64, - 65, - 70 + 42, + 37, + 50, + 44 ], - "reference_marker_width": 10.0, - "reference_marker_height": 6.0, + "reference_marker_width": 8.0, + "reference_marker_height": 7.0, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, diff --git a/configuration/camera_config/servers.json b/configuration/camera_config/servers.json index 88b4e87..840e295 100644 --- a/configuration/camera_config/servers.json +++ b/configuration/camera_config/servers.json @@ -165,6 +165,7 @@ "SATOP21-PMOS127B-2D", "SATOP31-PSRD175", "SATOP31-PSRD132", + "#SATES22-ADTEST1-CAM1", "SATFE10-PSRD066" ] }, diff --git a/configuration/pipeline_config/SARBD02-DSCR050_pref.json b/configuration/pipeline_config/SARBD02-DSCR050_pref.json new file mode 100644 index 0000000..e5d13c9 --- /dev/null +++ b/configuration/pipeline_config/SARBD02-DSCR050_pref.json @@ -0,0 +1,12 @@ +{ + "pipeline_type": "stream", + "name": "SARBD02-DSCR050_pref", + "input_pipeline": "SARBD02-DSCR050_sp", + "input_mode": "SUB", + "bsread_channels": [ + "image" + ], + "mode": "PUB", + "camera_name": "SARBD02-DSCR050", + "function": "propagate_camera_name" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARBD02-DSCR050_sp.json b/configuration/pipeline_config/SARBD02-DSCR050_sp.json index d5a55b4..ccf4fd3 100644 --- a/configuration/pipeline_config/SARBD02-DSCR050_sp.json +++ b/configuration/pipeline_config/SARBD02-DSCR050_sp.json @@ -1,11 +1,16 @@ { - "camera_calibration": null, "image_background_enable": false, "image_background": null, "image_threshold": null, - "image_region_of_interest": null, + "image_region_of_interest": [ + 1213, + 329, + 576, + 812 + ], "image_good_region": null, "image_slices": null, + "pipeline_type": "processing", "camera_name": "SARBD02-DSCR050", "name": "SARBD02-DSCR050_sp", "max_frame_rate": 10.1 diff --git a/configuration/pipeline_config/SARBD02-DSCR051_pref.json b/configuration/pipeline_config/SARBD02-DSCR051_pref.json new file mode 100644 index 0000000..53702e8 --- /dev/null +++ b/configuration/pipeline_config/SARBD02-DSCR051_pref.json @@ -0,0 +1,12 @@ +{ + "pipeline_type": "stream", + "name": "SARBD02-DSCR051_pref", + "input_pipeline": "SARBD02-DSCR051_sp", + "input_mode": "SUB", + "bsread_channels": [ + "image" + ], + "mode": "PUB", + "camera_name": "SARBD02-DSCR051", + "function": "propagate_camera_name" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARBD02-DSCR05x_merge.json b/configuration/pipeline_config/SARBD02-DSCR05x_merge.json new file mode 100644 index 0000000..a72060a --- /dev/null +++ b/configuration/pipeline_config/SARBD02-DSCR05x_merge.json @@ -0,0 +1,10 @@ +{ + "pipeline_type": "stream", + "name": "SARBD02-DSCR05x_merge", + "input_pipeline": "SARBD02-DSCR050_pref", + "input_mode": "SUB", + "input_pipeline2": "SARBD02-DSCR051_pref", + "input_mode2": "SUB", + "mode": "PUB", + "function": "propagate_stream" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARES11-SPEC125-M1_psen_db.json b/configuration/pipeline_config/SARES11-SPEC125-M1_psen_db.json index 5fee963..9661a5d 100644 --- a/configuration/pipeline_config/SARES11-SPEC125-M1_psen_db.json +++ b/configuration/pipeline_config/SARES11-SPEC125-M1_psen_db.json @@ -1,6 +1,6 @@ { "image_background_enable": "passive", - "image_background": "SARES11-SPEC125-M1_20250219_102506_385640", + "image_background": "SARES11-SPEC125-M1_20250315_152506_682314", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/SARES11-SPEC125-M3_spec_db.json b/configuration/pipeline_config/SARES11-SPEC125-M3_spec_db.json index 7a2bd8a..87a2e0f 100644 --- a/configuration/pipeline_config/SARES11-SPEC125-M3_spec_db.json +++ b/configuration/pipeline_config/SARES11-SPEC125-M3_spec_db.json @@ -1,6 +1,6 @@ { "image_background_enable": "passive", - "image_background": "SARES11-SPEC125-M3_20240606_112442_775849", + "image_background": "SARES11-SPEC125-M3_20250328_104044_754691", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, @@ -15,20 +15,19 @@ 0, 2048, 0, - 100 + 250 ], "roi_signal": [ 0, 2048, - 0, - 250 + 201, + 450 ], "no_client_timeout": 0, "pixel_bkg": 0, - "port": "9013", "multiprocessing": false, "_buffer_size": 5, - "processing_threads": 3, + "processing_threads": 0, "thread_buffer_size": 20, "send_buffer_size": 50, "block": false, diff --git a/configuration/pipeline_config/SARES21-PBPS141_proc.json b/configuration/pipeline_config/SARES21-PBPS141_proc.json index 1f2d253..b469373 100644 --- a/configuration/pipeline_config/SARES21-PBPS141_proc.json +++ b/configuration/pipeline_config/SARES21-PBPS141_proc.json @@ -26,12 +26,12 @@ "down": "SARES21-PBPS141:Lnk9Ch0-PP_VAL_PD2", "right": "SARES21-PBPS141:Lnk9Ch0-PP_VAL_PD3", "left": "SARES21-PBPS141:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 9.569377990430622e-05, - "down_calib": 9.10641980741015e-05, - "left_calib": 0.0002543379887358792, - "right_calib": 0.0001403215721404428, - "horiz_calib": -3.9446335571333027, - "vert_calib": -7.009396901398793, + "up_calib": 4.0268387189885095e-05, + "down_calib": 3.837274982195044e-05, + "left_calib": 0.00010659908000729991, + "right_calib": 5.903547370772529e-05, + "horiz_calib": -5.93887, + "vert_calib": -9.0057, "uJ_calib": 941.943984588351, "threshold": 0, "queue_length": 300, @@ -63,7 +63,7 @@ "xpos_dif_w_pvname": "SARES21-PBPS141:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SARES21-PBPS141:YPOS-DIF-HIST-M", "ypos_dif_w_pvname": "SARES21-PBPS141:YPOS-DIF-HIST-W", - "port": "9013", + "port": "9018", "calib_x_range": [ -0.3, 0.0, @@ -94,5 +94,5 @@ 0.11052246554408188, 0.11072063526778356 ], - "calib_datetime": "2025-02-04 10:38:38" + "calib_datetime": "2025-04-04 15:05:51" } \ No newline at end of file diff --git a/configuration/pipeline_config/SARFE10-PBPS053_proc.json b/configuration/pipeline_config/SARFE10-PBPS053_proc.json index e1b14ac..402557c 100644 --- a/configuration/pipeline_config/SARFE10-PBPS053_proc.json +++ b/configuration/pipeline_config/SARFE10-PBPS053_proc.json @@ -26,12 +26,12 @@ "down": "SARFE10-PBPS053:Lnk9Ch0-PP_VAL_PD2", "right": "SARFE10-PBPS053:Lnk9Ch0-PP_VAL_PD3", "left": "SARFE10-PBPS053:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 0.00013829131674353818, - "down_calib": 0.0001699166049303002, - "left_calib": 0.0005090965369217173, - "right_calib": 0.0002822696284654242, - "horiz_calib": -12610.610870857197, - "vert_calib": -5.60468323605931, + "up_calib": 8.252737102787511e-05, + "down_calib": 9.932451384623452e-05, + "left_calib": 0.0002898544003376224, + "right_calib": 0.0001714541229915864, + "horiz_calib": -3.6052981040446994, + "vert_calib": -5.712227095363798, "uJ_calib": 834.5191797495979, "threshold": 0, "queue_length": 5000, @@ -69,9 +69,9 @@ 0.3 ], "calib_x_norm": [ - 0.0003110304161815265, - 0.0008727618778698012, - 0.00026345143637281765 + 0.08353620653149268, + 0.0003093021467825846, + -0.08288553799134554 ], "calib_y_range": [ -0.3, @@ -79,20 +79,20 @@ 0.3 ], "calib_y_norm": [ - 0.05342287296039437, - 8.477180321132363e-05, - -0.053630456323182404 + 0.05297838244709519, + 0.00013686051846039786, + -0.052059458308041553 ], "calib_time": "2022-11-28 16:19:37", - "calib_datetime": "2025-01-29 09:27:54", + "calib_datetime": "2025-04-03 16:25:15", "calib_x_norm_std": [ - 0.034715473382649, - 0.03558681803923851, - 0.035086184402555745 + 0.039097499054084266, + 0.04318884492921968, + 0.041594738954934915 ], "calib_y_norm_std": [ - 0.03742865145265283, - 0.03426774362198103, - 0.034107307070267115 + 0.047561029795043466, + 0.04584223560113521, + 0.04414664834114283 ] } \ No newline at end of file diff --git a/configuration/pipeline_config/SARFE10-PSSS059-LB_psss.json b/configuration/pipeline_config/SARFE10-PSSS059-LB_psss.json index dc33f28..310639a 100644 --- a/configuration/pipeline_config/SARFE10-PSSS059-LB_psss.json +++ b/configuration/pipeline_config/SARFE10-PSSS059-LB_psss.json @@ -1,6 +1,6 @@ { "image_background_enable": true, - "image_background": "SARFE10-PSSS059-LB_20241201_084602_840726", + "image_background": "SARFE10-PSSS059-LB_20250324_152234_841366", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/SARFE10-PSSS059-LB_sp_br.json b/configuration/pipeline_config/SARFE10-PSSS059-LB_sp_br.json new file mode 100644 index 0000000..ce219f3 --- /dev/null +++ b/configuration/pipeline_config/SARFE10-PSSS059-LB_sp_br.json @@ -0,0 +1,26 @@ +{ + "name": "SARFE10-PSSS059-LB_sp_br", + "pipeline_type": "stream", + "bsread_address": "", + "bsread_channels": [ + "SARFE10-PSSS059-LB:FIT-FWHM", + "SARFE10-PBPG050:FAST-PULSE-ENERGY" + ], + "intensity": "SARFE10-PBPG050:FAST-PULSE-ENERGY", + "FWHM": "SARFE10-PSSS059-LB:FIT-FWHM", + "out_PV": "SARFE10-PSSS059-LB:FIT-BRT", + "mode": "PUB", + "allow_type_changes": false, + "abort_on_timeout": true, + "abort_on_error": true, + "debug": true, + "block": false, + "enforce_pid": true, + "enforce_timestamp": true, + "check_timestamp": true, + "stream_timeout": 20, + "function": "spectral_brightness.py", + "reload": true, + "no_client_timeout": 0, + "port": "9017" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARFE10-PSSS059_psss.json b/configuration/pipeline_config/SARFE10-PSSS059_psss.json index 249dcff..07a0732 100644 --- a/configuration/pipeline_config/SARFE10-PSSS059_psss.json +++ b/configuration/pipeline_config/SARFE10-PSSS059_psss.json @@ -1,6 +1,6 @@ { "image_background_enable": true, - "image_background": "SARFE10-PSSS059_20240311_140723_555248", + "image_background": "SARFE10-PSSS059_20250317_121206_294441", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, @@ -8,7 +8,7 @@ "pipeline_type": "processing", "camera_name": "SARFE10-PSSS059", "name": "SARFE10-PSSS059_psss", - "function": "psss_2.py", + "function": "swissfel_spectral_processing.py", "mode": "PUSH", "allow_type_changes": false, "no_client_timeout": 0, diff --git a/configuration/pipeline_config/SAROP11-PBPS110_proc.json b/configuration/pipeline_config/SAROP11-PBPS110_proc.json index 1af7caf..6af4889 100644 --- a/configuration/pipeline_config/SAROP11-PBPS110_proc.json +++ b/configuration/pipeline_config/SAROP11-PBPS110_proc.json @@ -26,12 +26,12 @@ "down": "SAROP11-PBPS110:Lnk9Ch0-PP_VAL_PD2", "right": "SAROP11-PBPS110:Lnk9Ch0-PP_VAL_PD3", "left": "SAROP11-PBPS110:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 9.737862278566756e-07, - "down_calib": 9.353619683200535e-07, - "left_calib": 1.0309994225495954e-06, - "right_calib": 1.0803571833705372e-06, - "horiz_calib": -3.815574774066874, - "vert_calib": -4.765031357737654, + "up_calib": 4.098127129673725e-06, + "down_calib": 4.259138962245459e-06, + "left_calib": 2.183005012581182e-06, + "right_calib": 2.4378049645254522e-06, + "horiz_calib": -4.665452678775223, + "vert_calib": -4.471600564729387, "uJ_calib": 605.4608924473305, "threshold": 0, "queue_length": 1000, @@ -69,9 +69,9 @@ 0.3 ], "calib_x_norm": [ - 0.07875594604296668, - 0.0007371884210029649, - -0.0784942811254248 + 0.06458675818610864, + 0.00033689669329196073, + -0.06401812569356503 ], "calib_y_range": [ -0.3, @@ -79,19 +79,19 @@ 0.3 ], "calib_y_norm": [ - 0.06412401332876447, - 8.368823342154213e-05, - -0.0617933112289628 + 0.06705606264028884, + -0.00046031410996389923, + -0.0671240796408925 ], - "calib_datetime": "2025-02-18 12:35:39", + "calib_datetime": "2025-03-13 13:56:21", "calib_x_norm_std": [ - 0.04337406366054226, - 0.04308021833976918, - 0.03941977018047361 + 0.09075244320195952, + 0.0877275386080403, + 0.0905045199152049 ], "calib_y_norm_std": [ - 0.04206756807633558, - 0.0433518072679861, - 0.040856758898731346 + 0.09006310930261463, + 0.09317196133148388, + 0.09861810436291076 ] } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP11-PBPS122_proc.json b/configuration/pipeline_config/SAROP11-PBPS122_proc.json index 62c6712..38fb650 100644 --- a/configuration/pipeline_config/SAROP11-PBPS122_proc.json +++ b/configuration/pipeline_config/SAROP11-PBPS122_proc.json @@ -27,12 +27,12 @@ "down": "SAROP11-PBPS122:Lnk9Ch0-PP_VAL_PD2", "right": "SAROP11-PBPS122:Lnk9Ch0-PP_VAL_PD3", "left": "SAROP11-PBPS122:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 6.101323855488045e-06, - "down_calib": 7.654460272371415e-06, - "left_calib": 3.668981334042787e-06, - "right_calib": 3.355588491029438e-06, - "horiz_calib": -4.619094947499179, - "vert_calib": -4.245916121265708, + "up_calib": 1.893276460318213e-05, + "down_calib": 2.3306024887105614e-05, + "left_calib": 8.257188295270447e-06, + "right_calib": 8.277311386229812e-06, + "horiz_calib": -5.297540191258623, + "vert_calib": -6.29549683664401, "uJ_calib": 605.9512700123181, "threshold": 0, "queue_length": 1000, @@ -70,14 +70,14 @@ 0.3 ], "calib_x_norm": [ - 0.06665873277683025, - 0.0007229623165680056, - -0.06323684348207421 + 0.056699918319259426, + -6.414005929787459e-05, + -0.05656019455162533 ], "calib_x_norm_std": [ - 0.07600711950147099, - 0.07532881833515205, - 0.07635620007810899 + 0.09941735065928761, + 0.09644142804120188, + 0.09652404146483615 ], "calib_y_range": [ -0.3, @@ -85,14 +85,14 @@ 0.3 ], "calib_y_norm": [ - 0.07117396482192535, - -3.0390768441330145e-05, - -0.07013829450295737 + 0.04720895487460161, + 7.316327567623546e-05, + -0.04809726408934068 ], "calib_y_norm_std": [ - 0.0772216925343307, - 0.07719104433527772, - 0.0797284532174974 + 0.09985294158981244, + 0.10707615783473319, + 0.09659571295757036 ], - "calib_datetime": "2025-02-18 20:43:22" + "calib_datetime": "2025-03-13 14:11:39" } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP21-ATT01_proc.json b/configuration/pipeline_config/SAROP21-ATT01_proc.json index 427af05..061320b 100644 --- a/configuration/pipeline_config/SAROP21-ATT01_proc.json +++ b/configuration/pipeline_config/SAROP21-ATT01_proc.json @@ -29,9 +29,9 @@ "reload": true, "dark_buffer_length": 3, "calibration": [ - -7.19417023e-19, - -2.11969293e-16, - 1.27745934e-12 + -7.09793884e-19, + -2.19408437e-16, + 1.2869905e-12 ], "roi": [ 600, @@ -39,7 +39,7 @@ ], "dpx_poly": 50, "sigma_px": 30, - "reflen": 300, + "reflen": 200, "window": false, "is_laser_delayed": 1, "is_laser_dark": 0, diff --git a/configuration/pipeline_config/SAROP21-PBPS103_proc.json b/configuration/pipeline_config/SAROP21-PBPS103_proc.json index 2d780f7..738bc6d 100644 --- a/configuration/pipeline_config/SAROP21-PBPS103_proc.json +++ b/configuration/pipeline_config/SAROP21-PBPS103_proc.json @@ -10,19 +10,19 @@ "check_timestamp": true, "stream_timeout": 20, "queue_length": 5000, - "down_calib": 5.5271338052768646e-05, + "down_calib": 3.4441678486821112e-06, "xpos_odd_w_pvname": "SAROP21-PBPS103:XPOS-ODD-HIST-W", "ypos_all_y_pvname": "SAROP21-PBPS103:YPOS-ALL-HIST-Y", "ypos_all_w_pvname": "SAROP21-PBPS103:YPOS-ALL-HIST-W", "name": "SAROP21-PBPS103_proc", - "vert_calib": -3.9807417215664214, + "vert_calib": -7.857205929014205, "bsread_address": "", "right": "SAROP21-PBPS103:Lnk9Ch0-PP_VAL_PD3", "ypos_dif_w_pvname": "SAROP21-PBPS103:YPOS-DIF-HIST-W", "ypos_odd_x_pvname": "SAROP21-PBPS103:YPOS-ODD-HIST-X", "function": "pbps_full", "port": "9009", - "left_calib": 3.604824697374967e-05, + "left_calib": 7.724151636342986e-06, "down": "SAROP21-PBPS103:Lnk9Ch0-PP_VAL_PD2", "ypos_odd_w_pvname": "SAROP21-PBPS103:YPOS-ODD-HIST-W", "xpos_odd_y_pvname": "SAROP21-PBPS103:XPOS-ODD-HIST-Y", @@ -32,7 +32,7 @@ "ypos_evn_x_pvname": "SAROP21-PBPS103:YPOS-EVN-HIST-X", "uJ_calib": 605.9512700123181, "xpos_evn_m_pvname": "SAROP21-PBPS103:XPOS-EVN-HIST-M", - "horiz_calib": -4.175061763210314, + "horiz_calib": -5.034588377303698, "ypos_all_m_pvname": "SAROP21-PBPS103:YPOS-ALL-HIST-M", "ypos_dif_m_pvname": "SAROP21-PBPS103:YPOS-DIF-HIST-M", "bsread_channels": [ @@ -45,7 +45,7 @@ "ypos_evn_w_pvname": "SAROP21-PBPS103:YPOS-EVN-HIST-W", "pipeline_type": "stream", "ypos_all_x_pvname": "SAROP21-PBPS103:YPOS-ALL-HIST-X", - "right_calib": 4.0304963475642095e-05, + "right_calib": 8.358613122862118e-06, "xpos_all_m_pvname": "SAROP21-PBPS103:XPOS-ALL-HIST-M", "xpos_odd_m_pvname": "SAROP21-PBPS103:XPOS-ODD-HIST-M", "left": "SAROP21-PBPS103:Lnk9Ch0-PP_VAL_PD0", @@ -58,7 +58,7 @@ "ypos_evn_y_pvname": "SAROP21-PBPS103:YPOS-EVN-HIST-Y", "xpos_odd_x_pvname": "SAROP21-PBPS103:XPOS-ODD-HIST-X", "threshold": 0, - "up_calib": 5.3001316128682113e-05, + "up_calib": 3.381429158599253e-06, "ypos_odd_m_pvname": "SAROP21-PBPS103:YPOS-ODD-HIST-M", "xpos_all_x_pvname": "SAROP21-PBPS103:XPOS-ALL-HIST-X", "up": "SAROP21-PBPS103:Lnk9Ch0-PP_VAL_PD1", @@ -69,9 +69,9 @@ 0.3 ], "calib_x_norm": [ - 0.07157285036301936, - 0.0009591804161706151, - -0.07213759849478253 + 0.06233292421608874, + 0.002018002684269913, + -0.05684265778478445 ], "calib_y_range": [ -0.3, @@ -79,19 +79,19 @@ 0.3 ], "calib_y_norm": [ - 0.0759725283653206, - 4.616029717240383e-05, - -0.07475315090931972 + 0.03833798078739985, + 0.0010236985633388389, + -0.03802504258511831 ], "calib_x_norm_std": [ - 0.4145522693878684, - 0.4202877333619035, - 0.41456184063790813 + 0.6418256445167525, + 0.6759359880444116, + 0.6554307724365318 ], "calib_y_norm_std": [ - 0.4247025133722662, - 0.4190715808241909, - 0.43243973416781073 + 0.6584007080383298, + 0.6436547013306737, + 0.6454721642147889 ], - "calib_datetime": "2025-02-04 07:43:18" + "calib_datetime": "2025-04-04 10:40:33" } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP21-PBPS133_proc.json b/configuration/pipeline_config/SAROP21-PBPS133_proc.json index 4222764..af1e04e 100644 --- a/configuration/pipeline_config/SAROP21-PBPS133_proc.json +++ b/configuration/pipeline_config/SAROP21-PBPS133_proc.json @@ -27,12 +27,12 @@ "down": "SAROP21-PBPS133:Lnk9Ch0-PP_VAL_PD2", "right": "SAROP21-PBPS133:Lnk9Ch0-PP_VAL_PD3", "left": "SAROP21-PBPS133:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 5.838256930010976e-05, - "down_calib": 5.656226328692814e-05, - "left_calib": 4.251148320184248e-05, - "right_calib": 4.290746473178029e-05, - "horiz_calib": -3.9629162576225854, - "vert_calib": -4.00319424718054, + "up_calib": 5.349312228228193e-05, + "down_calib": 5.145953654306361e-05, + "left_calib": 3.964746111932078e-05, + "right_calib": 3.9392026612622904e-05, + "horiz_calib": -4.027132099327991, + "vert_calib": -4.3256874948249155, "uJ_calib": 605.4608924473305, "threshold": 0, "queue_length": 3000, @@ -70,14 +70,14 @@ 0.3 ], "calib_x_norm": [ - 0.07453998597401498, - -0.0008795250165549497, - -0.07686366754652377 + 0.07523729980148029, + 0.00020716758487356637, + -0.07375210139052979 ], "calib_x_norm_std": [ - 0.4381208675777489, - 0.4347076184147021, - 0.42503328441644145 + 0.3755149062751643, + 0.3786561572290592, + 0.3748798320928806 ], "calib_y_range": [ -0.3, @@ -85,14 +85,14 @@ 0.3 ], "calib_y_norm": [ - 0.07326631259404506, - -0.002640333146191335, - -0.07661399871550019 + 0.0699176899290634, + -0.00030959523730942853, + -0.06878858525096673 ], "calib_y_norm_std": [ - 0.4356863724043072, - 0.45144610429008286, - 0.45181625007528115 + 0.37846861570249735, + 0.38072721857616276, + 0.3832545225535354 ], - "calib_datetime": "2025-02-04 07:40:27" + "calib_datetime": "2025-04-04 10:39:32" } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PBPS113_proc.json b/configuration/pipeline_config/SAROP31-PBPS113_proc.json index db4a0e0..62e255b 100644 --- a/configuration/pipeline_config/SAROP31-PBPS113_proc.json +++ b/configuration/pipeline_config/SAROP31-PBPS113_proc.json @@ -26,12 +26,12 @@ "down": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD2", "right": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD3", "left": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 2.0663001325738166e-05, - "down_calib": 2.402537694855417e-05, - "left_calib": 5.218152156307452e-05, - "right_calib": 5.834052477535398e-05, - "horiz_calib": -3.771327659699711, - "vert_calib": -6.08541597358778, + "up_calib": 5.059538606264929e-07, + "down_calib": 5.64927448333758e-07, + "left_calib": 1.125846743706708e-06, + "right_calib": 1.3457517438143435e-06, + "horiz_calib": -4.719752799047021, + "vert_calib": -7.115673207163331, "uJ_calib": 941.943984588351, "threshold": 0, "queue_length": 300, @@ -70,14 +70,14 @@ 0.3 ], "calib_x_norm": [ - 0.0802116924027993, - 0.0005143083175209187, - -0.07888347358120712 + 0.06422228966212074, + -0.0003177089811439902, + -0.06290301234970237 ], "calib_x_norm_std": [ - 0.03360835426368963, - 0.038265082191697865, - 0.03675609144464779 + 0.05497993675328227, + 0.05722297512373116, + 0.05244845040249846 ], "calib_y_range": [ -0.3, @@ -85,14 +85,14 @@ 0.3 ], "calib_y_norm": [ - 0.0511850204634102, - 0.00046261783581242737, - -0.04741136187169216 + 0.04291975949563341, + -0.0002750343024646076, + -0.04140114487023621 ], "calib_y_norm_std": [ - 0.03575638783183132, - 0.03605698374111028, - 0.038302105512007384 + 0.05799243003721293, + 0.05228267176725063, + 0.057094675167291845 ], - "calib_datetime": "2025-02-05 10:23:15" + "calib_datetime": "2025-04-03 19:26:20" } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PBPS149_proc.json b/configuration/pipeline_config/SAROP31-PBPS149_proc.json index b4b674b..d974bbc 100644 --- a/configuration/pipeline_config/SAROP31-PBPS149_proc.json +++ b/configuration/pipeline_config/SAROP31-PBPS149_proc.json @@ -27,12 +27,12 @@ "down": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD2", "right": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD3", "left": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD0", - "up_calib": 1.6851641518400307e-05, - "down_calib": 1.731276521425032e-05, - "left_calib": 3.5225258482946746e-05, - "right_calib": 5.32543294704773e-05, - "horiz_calib": -3.7083644088588854, - "vert_calib": -6.385756369199804, + "up_calib": 5.520345954869785e-07, + "down_calib": 5.619057169946393e-07, + "left_calib": 1.0781825161854172e-06, + "right_calib": 1.7591006509263466e-06, + "horiz_calib": -2.951379555975132, + "vert_calib": -5.5751155038433415, "uJ_calib": 605.9512700123181, "threshold": 0.0, "queue_length": 300, @@ -71,14 +71,14 @@ 0.3 ], "calib_x_norm": [ - 0.08330142517421746, - 0.0005900059046785689, - -0.07849497179439337 + 0.11031392780555577, + 0.000928620923623025, + -0.09298083270238598 ], "calib_x_norm_std": [ - 0.04214173720839463, - 0.04071682040666387, - 0.03921332842278094 + 0.06272526898974226, + 0.06648517579759342, + 0.05664085326165932 ], "calib_y_range": [ -0.3, @@ -86,14 +86,14 @@ 0.3 ], "calib_y_norm": [ - 0.04703494881570425, - -0.00033516601182954854, - -0.04692416351340982 + 0.053727058023198666, + -3.663064961326165e-05, + -0.053894030649560734 ], "calib_y_norm_std": [ - 0.04079830358928786, - 0.04217188377789602, - 0.03974387367182228 + 0.061694021446861605, + 0.06711504500830567, + 0.06812822215629918 ], - "calib_datetime": "2025-02-05 10:24:47" + "calib_datetime": "2025-04-03 19:27:23" } \ No newline at end of file diff --git a/configuration/pipeline_config/SATBD02-DSCR050_sp.json b/configuration/pipeline_config/SATBD02-DSCR050_sp.json index cdcdb2b..36a7047 100644 --- a/configuration/pipeline_config/SATBD02-DSCR050_sp.json +++ b/configuration/pipeline_config/SATBD02-DSCR050_sp.json @@ -2,16 +2,8 @@ "image_background_enable": false, "image_background": "SATBD02-DSCR050_20250217_170917_808358", "image_threshold": null, - "image_region_of_interest": [ - 495, - 1573, - 90, - 1964 - ], - "image_good_region": { - "threshold": 0.1, - "gfscale": 9.0 - }, + "image_region_of_interest": null, + "image_good_region": null, "image_slices": null, "pipeline_type": "processing", "camera_name": "SATBD02-DSCR050", diff --git a/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json b/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json index cd658be..72e581e 100644 --- a/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json +++ b/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json @@ -1,6 +1,6 @@ { "image_background_enable": "passive", - "image_background": "SATES21-CAMS-PATT1_20250219_141109_108477", + "image_background": "SATES21-CAMS-PATT1_20250401_153642_380292", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, @@ -20,16 +20,16 @@ "project_axis": 0, "reload": true, "roi_background": [ - 466, - 752, - 91, - 2356 + 106, + 935, + 0, + 2435 ], "roi_signal": [ - 178, - 474, - 91, - 2356 + 106, + 935, + 0, + 2435 ], "enforce_pid": true, "enforce_timestamp": true, diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM10_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM10_proc.json new file mode 100644 index 0000000..d26bd67 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM10_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM10_proc", + "camera_name": "SATES22-ADTEST1-CAM10", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM11_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM11_proc.json new file mode 100644 index 0000000..fdc20dd --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM11_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM11_proc", + "camera_name": "SATES22-ADTEST1-CAM11", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM12_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM12_proc.json new file mode 100644 index 0000000..8821e1e --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM12_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM12_proc", + "camera_name": "SATES22-ADTEST1-CAM12", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM1_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM1_proc.json new file mode 100644 index 0000000..0520a5a --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM1_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM1_proc", + "camera_name": "SATES22-ADTEST1-CAM1", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM1_sp.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM1_sp.json new file mode 100644 index 0000000..87c7047 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM1_sp.json @@ -0,0 +1,12 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "camera_name": "SATES22-ADTEST1-CAM1", + "name": "SATES22-ADTEST1-CAM1_sp", + "max_frame_rate": 5.1 +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM2_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM2_proc.json new file mode 100644 index 0000000..ef8c43d --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM2_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM2_proc", + "camera_name": "SATES22-ADTEST1-CAM2", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM3_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM3_proc.json new file mode 100644 index 0000000..2f6810e --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM3_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM3_proc", + "camera_name": "SATES22-ADTEST1-CAM3", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM4_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM4_proc.json new file mode 100644 index 0000000..e1f6777 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM4_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM4_proc", + "camera_name": "SATES22-ADTEST1-CAM4", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM5_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM5_proc.json new file mode 100644 index 0000000..50d8741 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM5_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM5_proc", + "camera_name": "SATES22-ADTEST1-CAM5", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM6_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM6_proc.json new file mode 100644 index 0000000..5d5cad3 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM6_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM6_proc", + "camera_name": "SATES22-ADTEST1-CAM6", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM7_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM7_proc.json new file mode 100644 index 0000000..d320799 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM7_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM7_proc", + "camera_name": "SATES22-ADTEST1-CAM7", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM8_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM8_proc.json new file mode 100644 index 0000000..3fc49fc --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM8_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM8_proc", + "camera_name": "SATES22-ADTEST1-CAM8", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES22-ADTEST1-CAM9_proc.json b/configuration/pipeline_config/SATES22-ADTEST1-CAM9_proc.json new file mode 100644 index 0000000..482e5f4 --- /dev/null +++ b/configuration/pipeline_config/SATES22-ADTEST1-CAM9_proc.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "name": "SATES22-ADTEST1-CAM9_proc", + "camera_name": "SATES22-ADTEST1-CAM9", + "function": "Laser_Quick_Int.py", + "mode": "PUSH", + "allow_type_changes": false, + "block": false, + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json b/configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json index 422a269..2dccf15 100644 --- a/configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json +++ b/configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json @@ -1,6 +1,6 @@ { "image_background_enable": true, - "image_background": "SATES30-RIXS-CAM01_20241214_181504_911351", + "image_background": "SATES30-RIXS-CAM01_20250325_105110_535588", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, @@ -12,7 +12,7 @@ "mode": "PUB", "allow_type_changes": false, "block": false, - "threshold": 120.0, + "threshold": 100.0, "threshold_file": "", "_max_frame_rate": 5.1, "libs": "", diff --git a/configuration/pipeline_config/SATES31-CAMS187-RIXS1_sp.json b/configuration/pipeline_config/SATES31-CAMS187-RIXS1_sp.json index 78c9e4b..728af2f 100644 --- a/configuration/pipeline_config/SATES31-CAMS187-RIXS1_sp.json +++ b/configuration/pipeline_config/SATES31-CAMS187-RIXS1_sp.json @@ -1,6 +1,6 @@ { "image_background_enable": false, - "image_background": "SATES31-CAMS187-RIXS1_20240529_115656_199325", + "image_background": "SATES31-CAMS187-RIXS1_20250222_100737_996974", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/SATOP11-PSAS079_psas.json b/configuration/pipeline_config/SATOP11-PSAS079_psas.json index 62f9681..50e0960 100644 --- a/configuration/pipeline_config/SATOP11-PSAS079_psas.json +++ b/configuration/pipeline_config/SATOP11-PSAS079_psas.json @@ -1,6 +1,10 @@ { "image_background_enable": false, - "image_background": "SATOP11-PSAS079_20241208_143639_046414", + "image_background": "SATOP11-PSAS079_20250310_115010_052716", + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, "pipeline_type": "processing", "camera_name": "SATOP11-PSAS079", "name": "SATOP11-PSAS079_psas", @@ -13,7 +17,7 @@ "processing_threads": 6, "thread_buffer_size": 30, "abort_on_error": false, - "pixel_bkg": 1, + "pixel_bkg": 0, "abort_on_timeout": true, "debug": true, "block": false, diff --git a/configuration/pipeline_config/SATOP21-PMOS127-2D_sp.json b/configuration/pipeline_config/SATOP21-PMOS127-2D_sp.json index 40c6ff4..ffcc024 100644 --- a/configuration/pipeline_config/SATOP21-PMOS127-2D_sp.json +++ b/configuration/pipeline_config/SATOP21-PMOS127-2D_sp.json @@ -7,5 +7,6 @@ "image_slices": null, "pipeline_type": "processing", "camera_name": "SATOP21-PMOS127-2D", - "name": "SATOP21-PMOS127-2D_sp" + "name": "SATOP21-PMOS127-2D_sp", + "max_frame_rate": 3.1 } \ No newline at end of file diff --git a/configuration/pipeline_config/SATOP31-ATT01_proc.json b/configuration/pipeline_config/SATOP31-ATT01_proc.json index 9bac267..1bc37eb 100644 --- a/configuration/pipeline_config/SATOP31-ATT01_proc.json +++ b/configuration/pipeline_config/SATOP31-ATT01_proc.json @@ -31,6 +31,10 @@ 0.34, 0 ], + "roi": [ + 600, + 2000 + ], "step_length": 150, "edge_type": "rising", "refinement": 1, @@ -38,10 +42,14 @@ "dark_event": 154, "fel_on_event": 76, "use_dark": true, - "global_stage": "SLAAT01-LSCP-DRS1FNS:CH2:BSTART", - "feedback_buffer": 5000, - "feedback_deadband": 250, - "feedback_step": 0.1, + "feedback": { + "global_stage": "SLAAT31-LMOT-M816:MOT", + "feedback_output": "SLAAT01-LSCP-DRS1FNS:CH2:BSTART", + "feedback_buffer": 200, + "feedback_deadband": 50, + "feedback_target": 1450, + "feedback_step": 0.01 + }, "filter_window": 101, "filter": true } \ No newline at end of file diff --git a/configuration/pipeline_config/SATOP31-PMOS132-2D_pmos.json b/configuration/pipeline_config/SATOP31-PMOS132-2D_pmos.json index 8ac0fc0..8da19e3 100644 --- a/configuration/pipeline_config/SATOP31-PMOS132-2D_pmos.json +++ b/configuration/pipeline_config/SATOP31-PMOS132-2D_pmos.json @@ -1,6 +1,6 @@ { "image_background_enable": true, - "image_background": "SATOP31-PMOS132-2D_20250216_112111_000879", + "image_background": "SATOP31-PMOS132-2D_20250311_183617_282213", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/X08DB-FE-CAM1_sp.json b/configuration/pipeline_config/X08DB-FE-CAM1_sp.json new file mode 100644 index 0000000..65a681d --- /dev/null +++ b/configuration/pipeline_config/X08DB-FE-CAM1_sp.json @@ -0,0 +1,11 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "camera_name": "X08DB-FE-CAM1", + "name": "X08DB-FE-CAM1_sp" +} \ No newline at end of file diff --git a/configuration/pipeline_config/jfj-cristall_db.json b/configuration/pipeline_config/jfj-cristall_db.json index 6142782..69cb293 100644 --- a/configuration/pipeline_config/jfj-cristall_db.json +++ b/configuration/pipeline_config/jfj-cristall_db.json @@ -3,7 +3,7 @@ "name": "jfj-cristall_db", "mode": "PUSH", "function": "propagate_with_prefix.py", - "prefix": "JFJ-CRISTALL:", + "prefix": "JF17T16V01j:", "_input_pipeline": "jfj-cristall_db", "input_stream": "tcp://sf-daqsync-18.psi.ch:9050", "input_mode": "SUB", diff --git a/configuration/pipeline_config/permanent_instances.json b/configuration/pipeline_config/permanent_instances.json index eea7607..1968ea7 100644 --- a/configuration/pipeline_config/permanent_instances.json +++ b/configuration/pipeline_config/permanent_instances.json @@ -1,9 +1,9 @@ { "#Bernina_tt_kb_restart_cam": "Bernina_tt_kb_restart_cam", "#S10BC02-DSRM310_profiles": "S10BC02-DSRM310_profiles", + "#SARES11-SPEC125-M1_psen_db": "SARES11-SPEC125-M1_psen_db", "#SARES11-SPEC125-M1_test": "SARES11-SPEC125-M1_test", "#SARES11-SPEC125-M3_sp": "SARES11-SPEC125-M3_sp", - "#SARES11-SPEC125-M3_spec_db": "SARES11-SPEC125-M3_spec_db", "#SARES11-XMI125-C4P1_db": "SARES11-XMI125-C4P1_db", "#SARES11-XMI125-C4P1_xy_db": "SARES11-XMI125-C4P1_xy_db", "#SARES12-CAMS128-M1_psen_db": "SARES12-CAMS128-M1_psen_db", @@ -16,7 +16,6 @@ "#SAROP11-PPRM122_sp": "SAROP11-PPRM122_sp", "#SAROP21-ATT01PD_proc": "SAROP21-ATT01PD_proc", "#SAROP21-PPRM102_proc": "SAROP21-PPRM102_proc", - "#SAROP31-PPRM113_proc": "SAROP31-PPRM113_proc", "#SATBD02-DSCR050_db": "SATBD02-DSCR050_db", "#SATES21-ADTEST1-CAM1_proc": "SATES21-ADTEST1-CAM1_proc", "#SATES21-ADTEST1-CAM1_sp": "SATES21-ADTEST1-CAM1_sp", @@ -34,6 +33,7 @@ "#SATES21-CAMS154-GIGE4_proc": "SATES21-CAMS154-GIGE4_proc", "#SATES21-CAMS154-GIGE5_proc": "SATES21-CAMS154-GIGE5_proc", "#SATES21-CAMS154-GIGE6_proc": "SATES21-CAMS154-GIGE6_proc", + "#SATES22-ADTEST1-CAM1_sp": "SATES22-ADTEST1-CAM1_sp", "#SATES30-CAMS182-GIGE2_profiles": "SATES30-CAMS182-GIGE2_profiles", "#SATES30-RIXS-CAM01_sp": "SATES30-RIXS-CAM01_sp", "#SATMA02_calib": "SATMA02_calib", @@ -59,9 +59,14 @@ "Bernina_tt_kb_populate_pvs": "Bernina_tt_kb_populate_pvs", "S10BD01-DSCR030_profiles": "S10BD01-DSCR030_profiles", "SARBD01-DSCR110_sp1": "SARBD01-DSCR110_sp_rep", + "SARBD02-DSCR050_pref": "SARBD02-DSCR050_pref", + "SARBD02-DSCR050_sp": "SARBD02-DSCR050_sp", + "SARBD02-DSCR051_pref": "SARBD02-DSCR051_pref", + "SARBD02-DSCR051_sp": "SARBD02-DSCR051_sp", + "SARBD02-DSCR05x_merge": "SARBD02-DSCR05x_merge", "SARCL01-DSCR170_profiles": "SARCL01-DSCR170_profiles", - "SARES11-SPEC125-M1_psen_db": "SARES11-SPEC125-M1_psen_db", "SARES11-SPEC125-M2_db": "SARES11-SPEC125-M2_db", + "SARES11-SPEC125-M3_spec_db": "SARES11-SPEC125-M3_spec_db", "SARES20-CAMS142-M3_proc": "SARES20-CAMS142-M3_proc", "SARES20-CAMS142-M4_psen_db": "SARES20-CAMS142-M4_psen_db", "SARES20-CAMS142-M5_psen_db": "SARES20-CAMS142-M5_psen_db", @@ -74,6 +79,7 @@ "SARFE10-PBPS053_proc": "SARFE10-PBPS053_proc", "SARFE10-PPRM064_proc": "SARFE10-PPRM064_proc", "SARFE10-PSSS059-LB_psss": "SARFE10-PSSS059-LB_psss", + "SARFE10-PSSS059-LB_sp_br": "SARFE10-PSSS059-LB_sp_br", "SARFE10-PSSS059_psss": "SARFE10-PSSS059_psss", "SARFE10-PSSS059_sp_br": "SARFE10-PSSS059_sp_br", "SAROP11-PBPS110_proc": "SAROP11-PBPS110_proc", @@ -87,6 +93,7 @@ "SAROP21-PPRM138_proc": "SAROP21-PPRM138_proc", "SAROP31-PBPS113_proc": "SAROP31-PBPS113_proc", "SAROP31-PBPS149_proc": "SAROP31-PBPS149_proc", + "SAROP31-PPRM113_proc": "SAROP31-PPRM113_proc", "SAROP31-PPRM150_proc": "SAROP31-PPRM150_proc", "SATBD02-DSCR050_sp": "SATBD02-DSCR050_sp", "SATBD02-DSCR050_sp1": "SATBD02-DSCR050_sp_rep", @@ -94,6 +101,18 @@ "SATES21-CAMS154-GIGE9_proc": "SATES21-CAMS154-GIGE9_proc", "SATES21-CAMS154-M1_spec_db": "SATES21-CAMS154-M1_spec_db", "SATES21-CAMS154-M2_proc": "SATES21-CAMS154-M2_proc", + "SATES22-ADTEST1-CAM10_proc": "SATES22-ADTEST1-CAM10_proc", + "SATES22-ADTEST1-CAM11_proc": "SATES22-ADTEST1-CAM11_proc", + "SATES22-ADTEST1-CAM12_proc": "SATES22-ADTEST1-CAM12_proc", + "SATES22-ADTEST1-CAM1_proc": "SATES22-ADTEST1-CAM1_proc", + "SATES22-ADTEST1-CAM2_proc": "SATES22-ADTEST1-CAM2_proc", + "SATES22-ADTEST1-CAM3_proc": "SATES22-ADTEST1-CAM3_proc", + "SATES22-ADTEST1-CAM4_proc": "SATES22-ADTEST1-CAM4_proc", + "SATES22-ADTEST1-CAM5_proc": "SATES22-ADTEST1-CAM5_proc", + "SATES22-ADTEST1-CAM6_proc": "SATES22-ADTEST1-CAM6_proc", + "SATES22-ADTEST1-CAM7_proc": "SATES22-ADTEST1-CAM7_proc", + "SATES22-ADTEST1-CAM8_proc": "SATES22-ADTEST1-CAM8_proc", + "SATES22-ADTEST1-CAM9_proc": "SATES22-ADTEST1-CAM9_proc", "SATES24-CAMS161-M1_spec_db": "SATES24-CAMS161-M1_spec_db", "SATES30-CAMS182-GIGE1_profiles": "SATES30-CAMS182-GIGE1_profiles", "SATES30-RIXS-CAM01_fit": "SATES30-RIXS-CAM01_fit", diff --git a/configuration/pipeline_config/servers.json b/configuration/pipeline_config/servers.json index c58ffde..eb780fc 100644 --- a/configuration/pipeline_config/servers.json +++ b/configuration/pipeline_config/servers.json @@ -42,6 +42,7 @@ "SAROP11-PBPS122_proc:9010", "SAROP31-PBPS113_proc:9013", "SARFE10-PSSS059_sp_br:9005", + "SARFE10-PSSS059-LB_sp_br:9017", "SAROP31-PBPS149_proc:9011", "SAROP11-ATT01_proc:9016", "SAROP21-PBPS133_proc:9008", @@ -90,12 +91,12 @@ "SATBD01-DSCR120", "SATBD01-DSCR210", "SATBD02-DSCR050", - "SARBD02-DSCR050", "SLG-LCAM-C103", "SLG-LCAM-C111", "SLG-LCAM-C071", "SARBD01-DSCR050", - "SARBD02-DSCR050" + "SARBD02-DSCR050", + "SARBD02-DSCR051" ], "enabled": true, "expanding": false, @@ -118,7 +119,10 @@ "SLG-LCAM-C103_proc:9006", "SLG-LCAM-C111_proc:9008", "SLG-LCAM-C071_proc:9009", - "test_merge_disp_sp:9007" + "test_merge_disp_sp:9007", + "SARBD02-DSCR051_pref", + "SARBD02-DSCR050_pref", + "SARBD02-DSCR05x_merge" ] }, "http://sf-daqsync-11.psi.ch:8881": { @@ -194,7 +198,7 @@ "expanding": false, "instances": [ "#SAROP11-PBPS122_proc:9010", - "SARES11-SPEC125-M1_psen_db:9001", + "#SARES11-SPEC125-M1_psen_db:9001", "#SARES11-SPEC125-M1_test:9009", "#SARES11-SPEC125-M2_psen_db:9011", "#SARES12-CAMS128-M1_psen_db:9003", @@ -202,7 +206,7 @@ "#SARES11-SPEC125-M2_pp_db", "SARES11-SPEC125-M2_db:9011", "#SARES11-SPEC125-M3_sp", - "#SARES11-SPEC125-M3_spec_db", + "SARES11-SPEC125-M3_spec_db:9014", "SAROP11-PPRM122_sp", "SAROP11-PPRM122_proc:9012", "SAROP11-PPRM110_proc:9013", @@ -318,7 +322,19 @@ "cameras": [ "SATOP31-PMOS132-2D", "SATOP21-PMOS127-2D", - "SATOP11-PSAS079" + "SATOP11-PSAS079", + "SATES22-ADTEST1-CAM1", + "SATES22-ADTEST1-CAM2", + "SATES22-ADTEST1-CAM3", + "SATES22-ADTEST1-CAM4", + "SATES22-ADTEST1-CAM5", + "SATES22-ADTEST1-CAM6", + "SATES22-ADTEST1-CAM7", + "SATES22-ADTEST1-CAM8", + "SATES22-ADTEST1-CAM9", + "SATES22-ADTEST1-CAM10", + "SATES22-ADTEST1-CAM11", + "SATES22-ADTEST1-CAM12" ], "enabled": true, "expanding": false, @@ -333,7 +349,19 @@ "SATES21-ADTEST1-CAM2_proc:9072", "SATES21-ADTEST1-CAM3_proc:9073", "SATES21-ADTEST1-CAM4_proc:9074", - "SATES21-ADTEST1-CAM5_proc:9075" + "SATES21-ADTEST1-CAM5_proc:9075", + "SATES22-ADTEST1-CAM1_proc", + "SATES22-ADTEST1-CAM2_proc", + "SATES22-ADTEST1-CAM3_proc", + "SATES22-ADTEST1-CAM4_proc", + "SATES22-ADTEST1-CAM5_proc", + "SATES22-ADTEST1-CAM6_proc", + "SATES22-ADTEST1-CAM7_proc", + "SATES22-ADTEST1-CAM8_proc", + "SATES22-ADTEST1-CAM9_proc", + "SATES22-ADTEST1-CAM10_proc", + "SATES22-ADTEST1-CAM11_proc", + "SATES22-ADTEST1-CAM12_proc" ] }, "http://sf-daqsync-18.psi.ch:8881": { diff --git a/configuration/user_scripts/SARES11-SPEC125-M1_2tt.py b/configuration/user_scripts/SARES11-SPEC125-M1_2tt.py index d9b19eb..aa5c889 100644 --- a/configuration/user_scripts/SARES11-SPEC125-M1_2tt.py +++ b/configuration/user_scripts/SARES11-SPEC125-M1_2tt.py @@ -11,8 +11,8 @@ import numpy as np _logger = getLogger(__name__) # Alvra spectral encoder constants/waveforms -px2fs = 2.125 # 2.35 calibration from 2023-06-22 -px2fs2 = 2.1 # 2.34 calibration from 2023-06-22 +px2fs = 2.31 #2.125 # 2.35 calibration from 2023-06-22 +px2fs2 = 1.77 #2.1 # 2.34 calibration from 2023-06-22 lambdas = np.linspace(504.17385, 608.07410, num=2048) # calibration from 2023-04-25 #lambdas = 528.34 + 0.0261*np.arange(0,2048) # calibration from 2021-10-06 #lambdas = np.linspace(510.57796, 628.63459, num=2048) # calibration from 2022-05-18 @@ -79,7 +79,7 @@ def edge(filter_name, backgrounds, signals, peakback): sig_deriv -= peakback sig_deriv *= signal.tukey(2048) # just added Nov 20 2024 #peak_pos = 1024 - (np.argmax(sig_deriv[500:1500], axis=-1) + 500) - peak_pos = 1024 - (np.argmax(sig_deriv[400:1600], axis=-1) + 400) + peak_pos = 800 - (np.argmax(sig_deriv[400:1600], axis=-1) + 400) # I am grossed out peak_amp = np.amax(sig_deriv[400:1600], axis=-1) return peak_pos, peak_amp, sig_deriv, sig_uninterp diff --git a/configuration/user_scripts/SARES11-SPEC125-M3_spec.py b/configuration/user_scripts/SARES11-SPEC125-M3_spec.py index 89cd611..f782868 100644 --- a/configuration/user_scripts/SARES11-SPEC125-M3_spec.py +++ b/configuration/user_scripts/SARES11-SPEC125-M3_spec.py @@ -13,16 +13,17 @@ def get_roi_projection(image, roi, axis): return project.astype("int64") def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None): + camera_name = parameters.get("camera_name") + #return {camera_name + ".test": 1.0} image = image.astype(int) roi_signal = parameters.get("roi_signal") - roi_background = parameters.get("roi_background") - camera_name = parameters.get("camera_name") + roi_background = parameters.get("roi_background") project_axis = parameters.get("project_axis", 0) dark = parameters.get("background_data") dark = dark.astype(int) spectrum = get_roi_projection(image, roi_signal, project_axis) - background = get_roi_projection(dark, roi_signal, project_axis) + background = get_roi_projection(dark, roi_background, project_axis) spectrum -= background diff --git a/configuration/user_scripts/SATOP31-ATT01_Debug_proc.py b/configuration/user_scripts/SATOP31-ATT01_Debug_proc.py index e70bc6f..a2ea44a 100644 --- a/configuration/user_scripts/SATOP31-ATT01_Debug_proc.py +++ b/configuration/user_scripts/SATOP31-ATT01_Debug_proc.py @@ -20,22 +20,37 @@ def initialize(params): initialized = True -def find_edge(data, step_length=50, edge_type="falling"): - # prepare a step function and refine it +def find_edge(data, step_length=50, edge_type="falling", roi=None): + """ + Find an edge in the given data using cross-correlation with a step waveform. + If a region-of-interest (roi) is provided as [start, end], the search is limited + to that slice of the data and the resulting edge position is offset appropriately. + """ + # If ROI is provided, slice the data accordingly. + if roi is not None: + data_roi = data[roi[0]:roi[1]] + else: + data_roi = data + + # Prepare the step function. step_waveform = np.ones(shape=(step_length,)) if edge_type == "rising": step_waveform[: int(step_length / 2)] = -1 elif edge_type == "falling": - step_waveform[int(step_length / 2) :] = -1 + step_waveform[int(step_length / 2):] = -1 - # find edges - xcorr = signal.correlate(data, step_waveform, mode="valid") + # Perform cross-correlation on the (possibly sliced) data. + xcorr = signal.correlate(data_roi, step_waveform, mode="valid") edge_position = np.argmax(xcorr) xcorr_amplitude = np.amax(xcorr) - # correct edge_position for step_length + # Correct edge_position for step_length. edge_position += np.floor(step_length / 2) + # If ROI is provided, add the offset to get the position in the full signal. + if roi is not None: + edge_position += roi[0] + return { "edge_pos": edge_position, "xcorr": xcorr, @@ -71,7 +86,8 @@ def process(data, pulse_id, timestamp, params): prof_sig_norm = prof_sig_savgol if events[fel_on_event] and not events[dark_event]: - edge_results = find_edge(prof_sig_norm, step_length, edge_type) + # Limit the edge search to the region-of-interest provided in params. + edge_results = find_edge(prof_sig_norm, step_length, edge_type, roi=params.get("roi")) edge_results["arrival_time"] = np.polyval(calib, edge_results["edge_pos"]) else: edge_results = { @@ -82,7 +98,7 @@ def process(data, pulse_id, timestamp, params): } edge_results["arrival_time"] = None - # Set bs outputs + # Set beam-synchronization outputs. output = {} for key, value in edge_results.items(): output[f"{device}:{key}"] = value @@ -90,24 +106,9 @@ def process(data, pulse_id, timestamp, params): output[f"{device}:raw_wf"] = prof_sig output[f"{device}:raw_wf_savgol"] = prof_sig_savgol - # if events[dark_event]: - # output[f"{device}:dark_wf"] = prof_sig - # output[f"{device}:dark_wf_savgol"] = prof_sig_savgol - # else: - # output[f"{device}:dark_wf"] = None - # output[f"{device}:dark_wf_savgol"] = None - if buffer_dark: output[f"{device}:avg_dark_wf"] = np.mean(buffer_dark, axis=0) else: - #output[f"{device}:avg_dark_wf"] = np.zeros_like(prof_sig) - #Changed By Gobbo to avoid type errors - output[f"{device}:avg_dark_wf"] = None # np.zeros_like(prof_sig) + output[f"{device}:avg_dark_wf"] = None - - # if buffer_savgol: - # output[f"{device}:avg_dark_wf_savgol"] = np.mean(buffer_savgol, axis=0) - # else: - # output[f"{device}:avg_dark_wf_savgol"] = None - - return output \ No newline at end of file + return output diff --git a/configuration/user_scripts/propagate_camera_name.py b/configuration/user_scripts/propagate_camera_name.py new file mode 100644 index 0000000..bbb5f03 --- /dev/null +++ b/configuration/user_scripts/propagate_camera_name.py @@ -0,0 +1,10 @@ + +from logging import getLogger + +def process(data, pulse_id, timestamp, params): + ret = dict() + prefix = params["camera_name"] + for c in data.keys(): + ret[prefix+c] = data[c] + return ret + \ No newline at end of file diff --git a/configuration/user_scripts/swissfel_spectral_processing.py b/configuration/user_scripts/swissfel_spectral_processing.py new file mode 100644 index 0000000..8aa6e5a --- /dev/null +++ b/configuration/user_scripts/swissfel_spectral_processing.py @@ -0,0 +1,234 @@ +from logging import getLogger +from cam_server.pipeline.data_processing import functions +from cam_server.utils import create_thread_pvs, epics_lock +from collections import deque +import json +import numpy as np +import scipy.signal +import numba +import time +import sys +from threading import Thread + +# Configure Numba to use multiple threads +numba.set_num_threads(4) + +_logger = getLogger(__name__) + +# Shared state globals +global_roi = [0, 0] +initialized = False +sent_pid = -1 +buffer = deque(maxlen=5) +channel_pv_names = None +base_pv_names = [] +all_pv_names = [] +global_ravg_length = 100 +ravg_buffers = {} + +@numba.njit(parallel=False) +def get_spectrum(image, background): + """Compute background-subtracted spectrum via row-wise summation.""" + y, x = image.shape + profile = np.zeros(x, dtype=np.float64) + for i in numba.prange(y): + for j in range(x): + profile[j] += image[i, j] - background[i, j] + return profile + + +def update_PVs(buffer, *pv_names): + """Continuously read from buffer and write to EPICS PVs.""" + pvs = create_thread_pvs(list(pv_names)) + while True: + time.sleep(0.1) + try: + rec = buffer.popleft() + except IndexError: + continue + try: + for pv, val in zip(pvs, rec): + if pv and pv.connected and (val is not None): + pv.put(val) + except Exception: + _logger.exception("Error updating channels") + + +def initialize(params): + """Initialize PV names, running-average settings, and launch update thread.""" + global channel_pv_names, base_pv_names, all_pv_names, global_ravg_length + + camera = params["camera_name"] + e_int = params["e_int_name"] + e_axis = params["e_axis_name"] + + # Fit/result PV names + center_pv = f"{camera}:FIT-COM" + fwhm_pv = f"{camera}:FIT-FWHM" + fit_rms_pv = f"{camera}:FIT-RMS" + fit_res_pv = f"{camera}:FIT-RES" + + # ROI PVs for dynamic read + ymin_pv = f"{camera}:SPC_ROI_YMIN" + ymax_pv = f"{camera}:SPC_ROI_YMAX" + axis_pv = e_axis + channel_pv_names = [ymin_pv, ymax_pv, axis_pv] + + # Spectrum statistical PV names + com_pv = f"{camera}:SPECT-COM" + std_pv = f"{camera}:SPECT-RMS" + skew_pv = f"{camera}:SPECT-SKEW" + iqr_pv = f"{camera}:SPECT-IQR" + res_pv = f"{camera}:SPECT-RES" # will use IQR-based calc + + # Base PVs for update thread (order matters) + base_pv_names = [ + e_int, center_pv, fwhm_pv, fit_rms_pv, + fit_res_pv, com_pv, std_pv, skew_pv, iqr_pv, res_pv + ] + + # Running-average configuration + global_ravg_length = params.get('RAVG_length', global_ravg_length) + # Build list of running-average PVs (exclude e_int, e_axis, processing_parameters) + exclude = { + e_int, + e_axis, + f"{camera}:processing_parameters" + } + ravg_base = [pv for pv in base_pv_names if pv not in exclude] + ravg_pv_names = [pv + '-RAVG' for pv in ravg_base] + + # All PVs (original + running average) + all_pv_names = base_pv_names + ravg_pv_names + + # Start background thread for PV updates + thread = Thread(target=update_PVs, args=(buffer, *all_pv_names), daemon=True) + thread.start() + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None, background=None): + """ + Main entrypoint: subtract background, crop ROI, smooth, fit Gaussian, + compute metrics, queue PV updates (with running averages for skew and IQR). + Returns a dict of processed PV values (original channels only). + """ + global initialized, sent_pid, channel_pv_names, global_ravg_length, ravg_buffers + try: + if not initialized: + initialize(parameters) + initialized = True + + # Dynamic ROI and axis PV read + ymin_pv, ymax_pv, axis_pv = create_thread_pvs(channel_pv_names) + if ymin_pv and ymin_pv.connected: + global_roi[0] = ymin_pv.value + if ymax_pv and ymax_pv.connected: + global_roi[1] = ymax_pv.value + + if not (axis_pv and axis_pv.connected): + _logger.warning("Energy axis not connected") + return None + axis = axis_pv.value + if len(axis) < image.shape[1]: + _logger.warning("Energy axis length %d < image width %d", len(axis), image.shape[1]) + return None + axis = axis[:image.shape[1]] + + # Preprocess image + proc_img = image.astype(np.float32) - np.float32(parameters.get("pixel_bkg", 0)) + nrows, _ = proc_img.shape + + # Background image + bg_img = parameters.pop('background_data', None) + if not (isinstance(bg_img, np.ndarray) and bg_img.shape == proc_img.shape): + bg_img = None + else: + bg_img = bg_img.astype(np.float32) + + # Crop ROI + ymin, ymax = int(global_roi[0]), int(global_roi[1]) + if 0 <= ymin < ymax <= nrows: + proc_img = proc_img[ymin:ymax, :] + if bg_img is not None: + bg_img = bg_img[ymin:ymax, :] + + # Extract spectrum + spectrum = get_spectrum(proc_img, bg_img) if bg_img is not None else np.sum(proc_img, axis=0) + + # Smooth + smoothed = scipy.signal.savgol_filter(spectrum, 51, 3) + + # Noise check and fit Gaussian + minimum, maximum = smoothed.min(), smoothed.max() + amplitude = maximum - minimum + skip = amplitude <= nrows * 1.5 + offset, amp_fit, center, sigma = functions.gauss_fit_psss( + smoothed[::2], axis[::2], offset=minimum, + amplitude=amplitude, skip=skip, maxfev=10 + ) + + # Compute normalized spectrum weights + sm_norm = smoothed / np.sum(smoothed) + + # Statistical moments + spect_com = np.sum(axis * sm_norm) + spect_std = np.sqrt(np.sum((axis - spect_com)**2 * sm_norm)) + spect_skew = np.sum((axis - spect_com)**3 * sm_norm) / (spect_std**3) + + # Interquartile width (IQR) + cum = np.cumsum(sm_norm) + e25 = np.interp(0.25, cum, axis) + e75 = np.interp(0.75, cum, axis) + spect_iqr = e75 - e25 + + spect_sum = np.sum(spectrum) + + camera = parameters["camera_name"] + # Original result dict + result = { + parameters["e_int_name"]: spectrum, + parameters["e_axis_name"]: axis, + f"{camera}:SPECTRUM_Y_SUM": spect_sum, + f"{camera}:FIT-COM": np.float64(center), + f"{camera}:FIT-FWHM": np.float64(2.355 * sigma), + f"{camera}:FIT-RMS": np.float64(sigma), + f"{camera}:FIT-RES": np.float64(2.355 * sigma / center * 1000), + f"{camera}:SPECT-COM": spect_com, + f"{camera}:SPECT-RMS": spect_std, + f"{camera}:SPECT-SKEW": spect_skew, + f"{camera}:SPECT-IQR": spect_iqr, + # Use IQR for relative spread instead of std + f"{camera}:SPECT-RES": np.float64(spect_iqr / spect_com * 1000), + f"{camera}:processing_parameters": json.dumps({"roi": global_roi}) + } + + # Prepare full values for PV update (including running averages) + exclude = { + parameters["e_int_name"], + parameters["e_axis_name"], + f"{camera}:processing_parameters" + } + ravg_results = {} + for base_pv in (pv for pv in base_pv_names if pv not in exclude): + buf = ravg_buffers.setdefault(base_pv, deque(maxlen=global_ravg_length)) + buf.append(result.get(base_pv)) + ravg_results[f"{base_pv}-RAVG"] = np.mean(buf) + + # Merge for PV write + full_results = {**result, **ravg_results} + + # Queue PV update if new pulse + if epics_lock.acquire(False): + try: + if pulse_id > sent_pid: + sent_pid = pulse_id + entry = tuple(full_results.get(pv) for pv in all_pv_names) + buffer.append(entry) + finally: + epics_lock.release() + + return full_results + + except Exception as ex: + _logger.warning("Processing error: %s", ex) + return {}