diff --git a/configuration/camera_config/SARES20-CAMS142-C1.json b/configuration/camera_config/SARES20-CAMS142-C1.json index 10c1561..0182408 100644 --- a/configuration/camera_config/SARES20-CAMS142-C1.json +++ b/configuration/camera_config/SARES20-CAMS142-C1.json @@ -20,9 +20,7 @@ "prefix": "SARES20-CAMS142-C1", "name": "SARES20-CAMS142-C1", "source": "SARES20-CAMS142-C1", - "alias": [ - "SAMPLECAM_MICROSCOPE" - ], + "alias": [], "group": [ "Photonics", "Bernina" diff --git a/configuration/camera_config/SARES20-CAMS142-C2.json b/configuration/camera_config/SARES20-CAMS142-C2.json index a0d4db6..d0e9f08 100644 --- a/configuration/camera_config/SARES20-CAMS142-C2.json +++ b/configuration/camera_config/SARES20-CAMS142-C2.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 1227, - 724, - 1241, - 738 + 1190, + 578, + 1202, + 596 ], "reference_marker_width": 42.0, "reference_marker_height": 42.0, diff --git a/configuration/camera_config/SARES20-CAMS142-C3.json b/configuration/camera_config/SARES20-CAMS142-C3.json index 442214c..d57dd99 100644 --- a/configuration/camera_config/SARES20-CAMS142-C3.json +++ b/configuration/camera_config/SARES20-CAMS142-C3.json @@ -6,8 +6,8 @@ 1011, 648 ], - "reference_marker_width": 2.0, - "reference_marker_height": 2.0, + "reference_marker_width": 73.0, + "reference_marker_height": 72.0, "angle_horizontal": 0.0, "angle_vertical": 0.0 }, @@ -20,9 +20,7 @@ "prefix": "SARES20-CAMS142-C3", "name": "SARES20-CAMS142-C3", "source": "SARES20-CAMS142-C3", - "alias": [ - "SAMPLECAM_XRD (SARES20-CAMS142-C3)" - ], + "alias": [], "group": [ "Photonics", "Bernina" diff --git a/configuration/camera_config/SARES20-CAMS142-M1.json b/configuration/camera_config/SARES20-CAMS142-M1.json index bc88c84..73323b1 100644 --- a/configuration/camera_config/SARES20-CAMS142-M1.json +++ b/configuration/camera_config/SARES20-CAMS142-M1.json @@ -24,7 +24,5 @@ "Photonics", "Bernina" ], - "alias": [ - "CAM_SAMPLE_SIDEVIEW (SARES20-CAMS142-M1)" - ] + "alias": [] } \ No newline at end of file diff --git a/configuration/camera_config/SARES20-CAMS142-M3.json b/configuration/camera_config/SARES20-CAMS142-M3.json index 5bca833..8888571 100644 --- a/configuration/camera_config/SARES20-CAMS142-M3.json +++ b/configuration/camera_config/SARES20-CAMS142-M3.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 1165, - 1063, - 1265, - 1164 + 1296, + 988, + 1349, + 1134 ], "reference_marker_width": 136.0, "reference_marker_height": 137.0, @@ -25,6 +25,6 @@ "Bernina" ], "alias": [ - "CAM_SAMPLE_INLINE (SARES20-CAMS142-M3)" + "SAMPLECAM_INLINE (SARES20-CAMS142-M3)" ] } \ No newline at end of file diff --git a/configuration/camera_config/SARES20-PROF141-M1.json b/configuration/camera_config/SARES20-PROF141-M1.json index 929290c..1cb3ec0 100644 --- a/configuration/camera_config/SARES20-PROF141-M1.json +++ b/configuration/camera_config/SARES20-PROF141-M1.json @@ -27,6 +27,6 @@ "Bernina" ], "alias": [ - "PROF_KB (SARES20-PROF141-M1)" + "TT_KB (SARES20-PROF141-M1)" ] } \ No newline at end of file diff --git a/configuration/camera_config/SARES30-CAMS156-QC1.json b/configuration/camera_config/SARES30-CAMS156-QC1.json new file mode 100644 index 0000000..b34d60c --- /dev/null +++ b/configuration/camera_config/SARES30-CAMS156-QC1.json @@ -0,0 +1,24 @@ +{ + "camera_calibration": { + "reference_marker": [ + 179, + 173, + 475, + 427 + ], + "reference_marker_width": 4000.0, + "reference_marker_height": 3000.0, + "angle_horizontal": 21.0, + "angle_vertical": 0.0 + }, + "mirror_x": true, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "name": "SARES30-CAMS156-QC1", + "source": "SARES30-CAMS156-QC1", + "group": "Cristallina", + "alias": [] +} \ No newline at end of file diff --git a/configuration/camera_config/SARES30-CAMS156-QM1.json b/configuration/camera_config/SARES30-CAMS156-QM1.json new file mode 100644 index 0000000..c3c83dd --- /dev/null +++ b/configuration/camera_config/SARES30-CAMS156-QM1.json @@ -0,0 +1,24 @@ +{ + "camera_calibration": { + "reference_marker": [ + 179, + 173, + 475, + 427 + ], + "reference_marker_width": 4000.0, + "reference_marker_height": 3000.0, + "angle_horizontal": 21.0, + "angle_vertical": 0.0 + }, + "mirror_x": true, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "name": "SARES30-CAMS156-QM1", + "source": "SARES30-CAMS156-QM1", + "group": "Cristallina", + "alias": [] +} \ No newline at end of file diff --git a/configuration/camera_config/SARES30-CAMS156-X8M.json b/configuration/camera_config/SARES30-CAMS156-X8M.json index 3fd9fe7..66b5c3f 100644 --- a/configuration/camera_config/SARES30-CAMS156-X8M.json +++ b/configuration/camera_config/SARES30-CAMS156-X8M.json @@ -18,5 +18,7 @@ "image_background": null, "source_type": "epics", "source": "SARES30-CAMS156-X8M", - "name": "SARES30-CAMS156-X8M" + "name": "SARES30-CAMS156-X8M", + "group": "Cristallina", + "alias": [] } \ No newline at end of file diff --git a/configuration/camera_config/SARES30-CAMS156-XE.json b/configuration/camera_config/SARES30-CAMS156-XE.json index 830c39b..b5edc32 100644 --- a/configuration/camera_config/SARES30-CAMS156-XE.json +++ b/configuration/camera_config/SARES30-CAMS156-XE.json @@ -16,7 +16,7 @@ "rotate": 0, "roi": null, "image_background": null, - "source_type": "epics", + "source_type": "bsread", "name": "SARES30-CAMS156-XE", "prefix": "SARES30-CAMS156-XE", "source": "SARES30-CAMS156-XE", diff --git a/configuration/camera_config/SAROP31-PPRM085.json b/configuration/camera_config/SAROP31-PPRM085.json index ba63433..c3da163 100644 --- a/configuration/camera_config/SAROP31-PPRM085.json +++ b/configuration/camera_config/SAROP31-PPRM085.json @@ -20,7 +20,9 @@ "name": "SAROP31-PPRM085", "source": "SAROP31-PPRM085", "group": [ - "Photonics" + "Photonics", + "Beamline Aramis", + "Cristallina" ], "alias": [] } \ No newline at end of file diff --git a/configuration/camera_config/SAROP31-PPRM113.json b/configuration/camera_config/SAROP31-PPRM113.json index b59c4bc..8efd98b 100644 --- a/configuration/camera_config/SAROP31-PPRM113.json +++ b/configuration/camera_config/SAROP31-PPRM113.json @@ -21,6 +21,7 @@ "source": "SAROP31-PPRM113", "group": [ "Photonics", + "Beamline Aramis", "Cristallina" ], "alias": [] diff --git a/configuration/camera_config/SAROP31-PPRM150.json b/configuration/camera_config/SAROP31-PPRM150.json index 8a6d0db..4e0efe5 100644 --- a/configuration/camera_config/SAROP31-PPRM150.json +++ b/configuration/camera_config/SAROP31-PPRM150.json @@ -21,6 +21,7 @@ "source": "SAROP31-PPRM150", "group": [ "Photonics", + "Beamline Aramis", "Cristallina" ], "alias": [] diff --git a/configuration/camera_config/SAROP31-PSCR068.json b/configuration/camera_config/SAROP31-PSCR068.json index fe4e9c7..e04994b 100644 --- a/configuration/camera_config/SAROP31-PSCR068.json +++ b/configuration/camera_config/SAROP31-PSCR068.json @@ -20,7 +20,9 @@ "name": "SAROP31-PSCR068", "source": "SAROP31-PSCR068", "group": [ - "Photonics" + "Photonics", + "Beamline Aramis", + "Cristallina" ], "alias": [] } \ No newline at end of file diff --git a/configuration/camera_config/SLAAR21-LCAM-C511.json b/configuration/camera_config/SLAAR21-LCAM-C511.json index ab92846..2ed0aa2 100644 --- a/configuration/camera_config/SLAAR21-LCAM-C511.json +++ b/configuration/camera_config/SLAAR21-LCAM-C511.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 406, - 460, - 440, - 480 + 401, + 448, + 453, + 490 ], "reference_marker_width": 2.0, "reference_marker_height": 2.0, diff --git a/configuration/camera_config/SLAAR21-LCAM-C531.json b/configuration/camera_config/SLAAR21-LCAM-C531.json index eaa98bd..646ba8c 100644 --- a/configuration/camera_config/SLAAR21-LCAM-C531.json +++ b/configuration/camera_config/SLAAR21-LCAM-C531.json @@ -1,10 +1,10 @@ { "camera_calibration": { "reference_marker": [ - 662, - 382, - 887, - 621 + 718, + 250, + 1053, + 594 ], "reference_marker_width": 2.0, "reference_marker_height": 2.0, diff --git a/configuration/camera_config/servers.json b/configuration/camera_config/servers.json index bb660ce..3e45609 100644 --- a/configuration/camera_config/servers.json +++ b/configuration/camera_config/servers.json @@ -32,6 +32,7 @@ "instances": [] }, "http://sf-daqsync-06.psi.ch:8880": { + "cameras": [], "enabled": true, "expanding": false, "instances": [] @@ -72,7 +73,7 @@ "instances": [ "SARES11-SPEC125-M1", "SARES11-SPEC125-M2", - "#SARES11-XMI125-C4P1", + "SARES11-XMI125-C4P1", "#SARES11-XPR125-C4P2", "SARES12-XPR128-C4F1", "#SLAAR11-LCAM-C452", @@ -104,4 +105,4 @@ "expanding": false, "instances": [] } -} +} \ 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 3c48f40..6628f3b 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_20220617_165603_663126", + "image_background": "SARES11-SPEC125-M1_20220702_175312_661472", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/SARES11-XMI125-C4P1_db.json b/configuration/pipeline_config/SARES11-XMI125-C4P1_db.json new file mode 100644 index 0000000..05b9fce --- /dev/null +++ b/configuration/pipeline_config/SARES11-XMI125-C4P1_db.json @@ -0,0 +1,22 @@ +{ + "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", + "function": "SARES11-XMI125-C4P1_jetprojections.py", + "camera_name": "SARES11-XMI125-C4P1", + "name": "SARES11-XMI125-C4P1_db", + "mode": "PUSH", + "roi_signal": [ + 0, + 1024, + 0, + 1280 + ], + "no_client_timeout": 0, + "pixel_bkg": 0, + "port": "9011" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARES11-XMI125-C4P1SARES11-XMI125-C4P1_sp.json b/configuration/pipeline_config/SARES20-CAMS141-M1_sp.json similarity index 65% rename from configuration/pipeline_config/SARES11-XMI125-C4P1SARES11-XMI125-C4P1_sp.json rename to configuration/pipeline_config/SARES20-CAMS141-M1_sp.json index 70bcfd9..3dda357 100644 --- a/configuration/pipeline_config/SARES11-XMI125-C4P1SARES11-XMI125-C4P1_sp.json +++ b/configuration/pipeline_config/SARES20-CAMS141-M1_sp.json @@ -6,6 +6,6 @@ "image_good_region": null, "image_slices": null, "pipeline_type": "processing", - "camera_name": "SARES11-XMI125-C4P1SARES11-XMI125-C4P1", - "name": "SARES11-XMI125-C4P1SARES11-XMI125-C4P1_sp" + "camera_name": "SARES20-CAMS141-M1", + "name": "SARES20-CAMS141-M1_sp" } \ No newline at end of file diff --git a/configuration/pipeline_config/SARES30-CAMS156-QC1_sp.json b/configuration/pipeline_config/SARES30-CAMS156-QC1_sp.json new file mode 100644 index 0000000..239024d --- /dev/null +++ b/configuration/pipeline_config/SARES30-CAMS156-QC1_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": "SARES30-CAMS156-QC1", + "name": "SARES30-CAMS156-QC1_sp" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARES30-CAMS156-QM1_sp.json b/configuration/pipeline_config/SARES30-CAMS156-QM1_sp.json new file mode 100644 index 0000000..c7eb2c4 --- /dev/null +++ b/configuration/pipeline_config/SARES30-CAMS156-QM1_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": "SARES30-CAMS156-QM1", + "name": "SARES30-CAMS156-QM1_sp" +} \ 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 fad6d86..9d76808 100644 --- a/configuration/pipeline_config/SARFE10-PBPS053_proc.json +++ b/configuration/pipeline_config/SARFE10-PBPS053_proc.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SARFE10-PBPS053_proc", "bsread_address": "", "bsread_channels": [ @@ -54,4 +56,4 @@ "xpos_dif_w_pvname": "SARFE10-PBPS053:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SARFE10-PBPS053:YPOS-DIF-HIST-M", "ypos_dif_w_pvname": "SARFE10-PBPS053:YPOS-DIF-HIST-W" -} \ No newline at end of file +} diff --git a/configuration/pipeline_config/SARFE10-PSSS059_psss_avg.json b/configuration/pipeline_config/SARFE10-PSSS059_psss_avg.json index 0644e60..8f745cc 100644 --- a/configuration/pipeline_config/SARFE10-PSSS059_psss_avg.json +++ b/configuration/pipeline_config/SARFE10-PSSS059_psss_avg.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "camera_name": "SARFE10-PSSS059", "name": "SARFE10-PSSS059_psss_avg", "bsread_address": "", diff --git a/configuration/pipeline_config/SAROP11-ATT01_proc.json b/configuration/pipeline_config/SAROP11-ATT01_proc.json index 48577fb..d5ce8d8 100644 --- a/configuration/pipeline_config/SAROP11-ATT01_proc.json +++ b/configuration/pipeline_config/SAROP11-ATT01_proc.json @@ -13,6 +13,8 @@ "name": "SAROP11-ATT01_proc", "no_client_timeout": 0, "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "calib": 1, "step_length": 50, "edge_type": "falling", diff --git a/configuration/pipeline_config/SAROP11-PBPS110_proc.json b/configuration/pipeline_config/SAROP11-PBPS110_proc.json index 4447a1d..5f5d5fc 100644 --- a/configuration/pipeline_config/SAROP11-PBPS110_proc.json +++ b/configuration/pipeline_config/SAROP11-PBPS110_proc.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SAROP11-PBPS110_proc", "bsread_address": "", "bsread_channels": [ @@ -54,4 +56,4 @@ "xpos_dif_w_pvname": "SAROP11-PBPS110:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SAROP11-PBPS110:YPOS-DIF-HIST-M", "ypos_dif_w_pvname": "SAROP11-PBPS110:YPOS-DIF-HIST-W" -} \ 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 968c429..40ea377 100644 --- a/configuration/pipeline_config/SAROP11-PBPS122_proc.json +++ b/configuration/pipeline_config/SAROP11-PBPS122_proc.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SAROP11-PBPS122_proc", "bsread_address": "", "bsread_channels": [ @@ -53,4 +55,4 @@ "xpos_dif_w_pvname": "SAROP11-PBPS122:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SAROP11-PBPS122:YPOS-DIF-HIST-M", "ypos_dif_w_pvname": "SAROP11-PBPS122:YPOS-DIF-HIST-W" -} \ 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 c1721a9..f75179a 100644 --- a/configuration/pipeline_config/SAROP21-ATT01_proc.json +++ b/configuration/pipeline_config/SAROP21-ATT01_proc.json @@ -13,6 +13,9 @@ "name": "SAROP21-ATT01_proc", "no_client_timeout": 0, "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, + "reload": true, "calib": [ 1, 0 @@ -26,4 +29,4 @@ "use_dark": true, "filter_window": 201, "filter": true -} \ No newline at end of file +} diff --git a/configuration/pipeline_config/SAROP21-PBPS103_proc.json b/configuration/pipeline_config/SAROP21-PBPS103_proc.json index 5736839..bffaf28 100644 --- a/configuration/pipeline_config/SAROP21-PBPS103_proc.json +++ b/configuration/pipeline_config/SAROP21-PBPS103_proc.json @@ -1,28 +1,30 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SAROP21-PBPS103_proc", "bsread_address": "", "bsread_channels": [ - "SAROP21-CVME-PBPS2:Lnk9Ch1-DATA-SUM", - "SAROP21-CVME-PBPS2:Lnk9Ch2-DATA-SUM", - "SAROP21-CVME-PBPS2:Lnk9Ch3-DATA-SUM", - "SAROP21-CVME-PBPS2:Lnk9Ch4-DATA-SUM" + "SAROP21-CVME-PBPS1:Lnk9Ch1-DATA-SUM", + "SAROP21-CVME-PBPS1:Lnk9Ch2-DATA-SUM", + "SAROP21-CVME-PBPS1:Lnk9Ch3-DATA-SUM", + "SAROP21-CVME-PBPS1:Lnk9Ch4-DATA-SUM" ], "mode": "PUB", "function": "pbps.py", "reload": true, "no_client_timeout": 0, "port": "9009", - "up": "SAROP21-CVME-PBPS2:Lnk9Ch4-DATA-SUM", - "down": "SAROP21-CVME-PBPS2:Lnk9Ch3-DATA-SUM", - "right": "SAROP21-CVME-PBPS2:Lnk9Ch1-DATA-SUM", - "left": "SAROP21-CVME-PBPS2:Lnk9Ch2-DATA-SUM", - "up_calib": 0.08713157252045031, - "down_calib": 0.07438197630437833, - "left_calib": 0.14413433421172023, - "right_calib": 0.19525084217966876, - "horiz_calib": 2.8959614484256484, - "vert_calib": -4.341028771625084, + "up": "SAROP21-CVME-PBPS1:Lnk9Ch4-DATA-SUM", + "down": "SAROP21-CVME-PBPS1:Lnk9Ch3-DATA-SUM", + "right": "SAROP21-CVME-PBPS1:Lnk9Ch2-DATA-SUM", + "left": "SAROP21-CVME-PBPS1:Lnk9Ch1-DATA-SUM", + "up_calib": 1.8471685414172236, + "down_calib": 1.8830751421958745, + "left_calib": 0.6453970020671952, + "right_calib": 0.5978336713397456, + "horiz_calib": 6.726717827343734, + "vert_calib": -5.348255274125303, "uJ_calib": 605.9512700123181, "threshold": 0, "queue_length": 1000, @@ -54,4 +56,4 @@ "xpos_dif_w_pvname": "SAROP21-PBPS103:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SAROP21-PBPS103:YPOS-DIF-HIST-M", "ypos_dif_w_pvname": "SAROP21-PBPS103:YPOS-DIF-HIST-W" -} \ 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 8f56f16..c2cd684 100644 --- a/configuration/pipeline_config/SAROP21-PBPS133_proc.json +++ b/configuration/pipeline_config/SAROP21-PBPS133_proc.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SAROP21-PBPS133_proc", "bsread_address": "", "bsread_channels": [ diff --git a/configuration/pipeline_config/SAROP21-PBPS138_proc.json b/configuration/pipeline_config/SAROP21-PBPS138_proc.json index 4af9c4e..b6d662b 100644 --- a/configuration/pipeline_config/SAROP21-PBPS138_proc.json +++ b/configuration/pipeline_config/SAROP21-PBPS138_proc.json @@ -1,5 +1,7 @@ { "pipeline_type": "stream", + "abort_on_timeout": true, + "stream_timeout": 20, "name": "SAROP21-PBPS138_proc", "bsread_address": "", "bsread_channels": [ diff --git a/configuration/pipeline_config/SAROP21-PPRM113_proc.json b/configuration/pipeline_config/SAROP21-PPRM113_proc.json index 42cdda4..004dc26 100644 --- a/configuration/pipeline_config/SAROP21-PPRM113_proc.json +++ b/configuration/pipeline_config/SAROP21-PPRM113_proc.json @@ -3,12 +3,15 @@ "image_background": null, "image_threshold": null, "image_region_of_interest": null, - "image_good_region": null, + "image_good_region": { + "threshold": 0.5, + "gfscale": 3.0 + }, "image_slices": null, "pipeline_type": "processing", "camera_name": "SAROP21-PPRM113", "name": "SAROP21-PPRM113_proc", - "function": "pprm", + "function": "pprm_gf", "mode": "PUSH", "no_client_timeout": 0, "port": "9016" diff --git a/configuration/pipeline_config/SAROP21-PPRM138_proc.json b/configuration/pipeline_config/SAROP21-PPRM138_proc.json index a3d9c79..fc04c83 100644 --- a/configuration/pipeline_config/SAROP21-PPRM138_proc.json +++ b/configuration/pipeline_config/SAROP21-PPRM138_proc.json @@ -3,12 +3,15 @@ "image_background": null, "image_threshold": null, "image_region_of_interest": null, - "image_good_region": null, + "image_good_region": { + "threshold": 0.5, + "gfscale": 3.0 + }, "image_slices": null, "pipeline_type": "processing", "camera_name": "SAROP21-PPRM138", "name": "SAROP21-PPRM138_proc", - "function": "pprm.py", + "function": "pprm_gf.py", "mode": "PUSH", "no_client_timeout": 0, "port": "9015", diff --git a/configuration/pipeline_config/SAROP31-PBPS113_proc.json b/configuration/pipeline_config/SAROP31-PBPS113_proc.json index c6edcc7..3de9055 100644 --- a/configuration/pipeline_config/SAROP31-PBPS113_proc.json +++ b/configuration/pipeline_config/SAROP31-PBPS113_proc.json @@ -13,18 +13,18 @@ "reload": true, "no_client_timeout": 0, "up": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD1", - "down": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD0", - "right": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD2", - "left": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD3", - "up_calib": 1.8208785459297164e-07, - "down_calib": 5.903306456586534e-07, - "left_calib": 4.183929223930265e-07, - "right_calib": 2.1156685735853252e-07, - "horiz_calib": -50.98515422434627, - "vert_calib": 37.66049112145287, + "down": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD2", + "right": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD3", + "left": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD0", + "up_calib": 0.00044113806562722776, + "down_calib": 0.0005027126373913637, + "left_calib": 0.000981832177389583, + "right_calib": 0.0013349994126002586, + "horiz_calib": 19.01053828998306, + "vert_calib": -31.605842648794347, "uJ_calib": 605.9512700123181, "threshold": 0, - "queue_length": 1000, + "queue_length": 5000, "xpos_all_x_pvname": "SAROP31-PBPS113:XPOS-ALL-HIST-X", "xpos_all_y_pvname": "SAROP31-PBPS113:XPOS-ALL-HIST-Y", "xpos_all_m_pvname": "SAROP31-PBPS113:XPOS-ALL-HIST-M", @@ -52,5 +52,6 @@ "xpos_dif_m_pvname": "SAROP31-PBPS113:XPOS-DIF-HIST-M", "xpos_dif_w_pvname": "SAROP31-PBPS113:XPOS-DIF-HIST-W", "ypos_dif_m_pvname": "SAROP31-PBPS113:YPOS-DIF-HIST-M", - "ypos_dif_w_pvname": "SAROP31-PBPS113:YPOS-DIF-HIST-W" + "ypos_dif_w_pvname": "SAROP31-PBPS113:YPOS-DIF-HIST-W", + "port": "9013" } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PBPS113_sp.json b/configuration/pipeline_config/SAROP31-PBPS113_sp.json new file mode 100644 index 0000000..88d3c92 --- /dev/null +++ b/configuration/pipeline_config/SAROP31-PBPS113_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": "SAROP31-PBPS113", + "name": "SAROP31-PBPS113_sp" +} \ 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 74bbb49..f4e05a3 100644 --- a/configuration/pipeline_config/SAROP31-PBPS149_proc.json +++ b/configuration/pipeline_config/SAROP31-PBPS149_proc.json @@ -14,17 +14,17 @@ "reload": true, "no_client_timeout": 0, "up": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD1", - "down": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD0", - "right": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD2", - "left": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD3", - "up_calib": 6.833542027201211e-07, - "down_calib": 1.0964922139513327e-05, - "left_calib": 8.090292845948203e-05, - "right_calib": 0.0003278301577518719, - "horiz_calib": -9370.044107284775, - "vert_calib": 250.36649750252232, + "down": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD2", + "right": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD3", + "left": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD0", + "up_calib": 7.5263790554237735e-06, + "down_calib": 4.363640222681099e-06, + "left_calib": 1.8793355331081038e-06, + "right_calib": 2.2660518136916738e-06, + "horiz_calib": 27.766289597986965, + "vert_calib": -24.99909846548858, "uJ_calib": 605.9512700123181, - "threshold": 10, + "threshold": 0.0, "queue_length": 5000, "xpos_all_x_pvname": "SAROP31-PBPS149:XPOS-ALL-HIST-X", "xpos_all_y_pvname": "SAROP31-PBPS149:XPOS-ALL-HIST-Y", diff --git a/configuration/pipeline_config/SAROP31-PPRM113_ib.json b/configuration/pipeline_config/SAROP31-PPRM113_ib.json new file mode 100644 index 0000000..b145b8f --- /dev/null +++ b/configuration/pipeline_config/SAROP31-PPRM113_ib.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": "store", + "camera_name": "SAROP31-PPRM113", + "name": "SAROP31-PPRM113_ib" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PPRM113_proc.json b/configuration/pipeline_config/SAROP31-PPRM113_proc.json index 41d4eda..7e61eec 100644 --- a/configuration/pipeline_config/SAROP31-PPRM113_proc.json +++ b/configuration/pipeline_config/SAROP31-PPRM113_proc.json @@ -8,8 +8,9 @@ "pipeline_type": "processing", "camera_name": "SAROP31-PPRM113", "name": "SAROP31-PPRM113_proc", - "function": "pprm", + "function": "pprm.py", "mode": "PUSH", "no_client_timeout": 0, - "port": "9016" + "port": "9001", + "reload": true } \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PPRM150_ib.json b/configuration/pipeline_config/SAROP31-PPRM150_ib.json new file mode 100644 index 0000000..10a9ef6 --- /dev/null +++ b/configuration/pipeline_config/SAROP31-PPRM150_ib.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": "store", + "camera_name": "SAROP31-PPRM150", + "name": "SAROP31-PPRM150_ib" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SAROP31-PPRM150_proc.json b/configuration/pipeline_config/SAROP31-PPRM150_proc.json new file mode 100644 index 0000000..6ca4b54 --- /dev/null +++ b/configuration/pipeline_config/SAROP31-PPRM150_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", + "camera_name": "SAROP31-PPRM150", + "name": "SAROP31-PPRM150_proc", + "function": "pprm.py", + "mode": "PUSH", + "no_client_timeout": 0, + "port": "9003", + "reload": true +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json b/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json index acfb82d..c40ed49 100644 --- a/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json +++ b/configuration/pipeline_config/SATES21-CAMS-PATT1_spec_db.json @@ -1,13 +1,13 @@ { "image_background_enable": "passive", - "image_background": "", + "image_background": "SATES21-CAMS-PATT1_20220710_113609_788464", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, "image_slices": null, "pipeline_type": "processing", "function_old": "spectrometer.py", - "function": "profiles_spectrum.py", + "function": "spectrometer.py", "camera_name": "SATES21-CAMS-PATT1", "name": "SATES21-CAMS-PATT1_spec_db", "mode": "PUSH", @@ -30,4 +30,4 @@ "no_client_timeout": 0, "port": "9003", "threshold": 1000 -} +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATES21-CAMS154-M1_spec_db.json b/configuration/pipeline_config/SATES21-CAMS154-M1_spec_db.json index 97f5ce5..2354d71 100644 --- a/configuration/pipeline_config/SATES21-CAMS154-M1_spec_db.json +++ b/configuration/pipeline_config/SATES21-CAMS154-M1_spec_db.json @@ -1,6 +1,6 @@ { "image_background_enable": "passive", - "image_background": "SATES21-CAMS154-M1_20220519_131606_322355", + "image_background": "SATES21-CAMS154-M1_20220710_100935_829642", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/SATES24-CAMS161-M1_spec_db.json b/configuration/pipeline_config/SATES24-CAMS161-M1_spec_db.json index 8d7ba65..379bc5e 100644 --- a/configuration/pipeline_config/SATES24-CAMS161-M1_spec_db.json +++ b/configuration/pipeline_config/SATES24-CAMS161-M1_spec_db.json @@ -1,6 +1,6 @@ { "image_background_enable": "passive", - "image_background": "SATES24-CAMS161-M1_20220518_102858_994223", + "image_background": "SATES24-CAMS161-M1_20220710_101109_695617", "image_threshold": null, "image_region_of_interest": null, "image_good_region": null, diff --git a/configuration/pipeline_config/bs_timing_test.json b/configuration/pipeline_config/bs_timing_test.json index 417f096..2db4464 100644 --- a/configuration/pipeline_config/bs_timing_test.json +++ b/configuration/pipeline_config/bs_timing_test.json @@ -8,5 +8,7 @@ "SIN-CVME-TIFGUN-EVR0:BUNCH-1-OK" ], "mode": "PUB", + "abort_on_timeout": true, + "stream_timeout": 20, "function": "bs_timing_test" } diff --git a/configuration/pipeline_config/bs_timing_test_perm.json b/configuration/pipeline_config/bs_timing_test_perm.json index 5224e4a..76034c5 100644 --- a/configuration/pipeline_config/bs_timing_test_perm.json +++ b/configuration/pipeline_config/bs_timing_test_perm.json @@ -8,5 +8,7 @@ "SIN-CVME-TIFGUN-EVR0:BUNCH-1-OK" ], "mode": "PUB", + "abort_on_timeout": true, + "stream_timeout": 20, "function": "bs_timing_test" } diff --git a/configuration/pipeline_config/permanent_instances.json b/configuration/pipeline_config/permanent_instances.json index b98eac2..76add6c 100644 --- a/configuration/pipeline_config/permanent_instances.json +++ b/configuration/pipeline_config/permanent_instances.json @@ -8,6 +8,8 @@ "#testdb_ib": "testdb_ib", "SARES11-SPEC125-M1_psen_db": "SARES11-SPEC125-M1_psen_db1", "SARES11-SPEC125-M1_psen_ib": "SARES11-SPEC125-M1_psen_ib1", + "SARES11-XMI125-C4P1_db": "SARES11-XMI125-C4P1_db", + "SARES11-XMI125-C4P1_ib": "SARES11-XMI125-C4P1_ib", "SARES20-CAMS142-M1_psen_db": "SARES20-CAMS142-M1_psen_db1", "SARES20-CAMS142-M1_psen_ib": "SARES20-CAMS142-M1_psen_ib1", "SARES20-CAMS142-M5_psen_db": "SARES20-CAMS142-M5_psen_db1", @@ -26,6 +28,7 @@ "SAROP11-PBPS110_proc": "SAROP11-PBPS110_proc", "SAROP11-PBPS122_proc": "SAROP11-PBPS122_proc", "SAROP21-ATT01_proc": "SAROP21-ATT01_proc", + "SAROP21-PBPS103_proc": "SAROP21-PBPS103_proc", "SAROP21-PBPS133_proc": "SAROP21-PBPS133_proc", "SAROP21-PBPS138_proc": "SAROP21-PBPS138_proc", "SAROP21-PPRM102_ib": "SAROP21-PPRM102_ib", @@ -34,6 +37,10 @@ "SAROP21-PPRM138_proc": "SAROP21-PPRM138_proc", "SAROP31-PBPS113_proc": "SAROP31-PBPS113_proc", "SAROP31-PBPS149_proc": "SAROP31-PBPS149_proc", + "SAROP31-PPRM113_ib": "SAROP31-PPRM113_ib", + "SAROP31-PPRM113_proc": "SAROP31-PPRM113_proc", + "SAROP31-PPRM150_ib": "SAROP31-PPRM150_ib", + "SAROP31-PPRM150_proc": "SAROP31-PPRM150_proc", "SATES21-CAMS-PATT1_spec_db": "SATES21-CAMS-PATT1_spec_db", "SATES21-CAMS-PATT1_spec_ib": "SATES21-CAMS-PATT1_spec_ib", "SATES21-CAMS154-M1_spec_db": "SATES21-CAMS154-M1_spec_db", diff --git a/configuration/pipeline_config/servers.json b/configuration/pipeline_config/servers.json index 8d5f337..2fdc69b 100644 --- a/configuration/pipeline_config/servers.json +++ b/configuration/pipeline_config/servers.json @@ -46,6 +46,7 @@ "SAROP31-PBPS113_proc:9013", "SAROP31-PBPS149_proc:9011", "SAROP11-PBPS122_proc:9010", + "SAROP11-ATT01_proc:9014", "SAROP21-PBPS133_proc:9008", "SATOP31-PMOS132-2D_sp", "SATOP31-PMOS132-2D_pmos:9001", @@ -57,19 +58,30 @@ "enabled": true, "expanding": false, "instances": [] - }, "http://sf-daqsync-05.psi.ch:8881": { "cameras": [], "enabled": true, "expanding": false, - "instances": [] + "instances": [] }, "http://sf-daqsync-06.psi.ch:8881": { - "cameras": [], + "cameras": [ + "SARES30-CAMS156-XE", + "SAROP31-PPRM113", + "SAROP31-PPRM150" + ], "enabled": true, "expanding": false, - "instances": [] + "instances": [ + "SARES30-CAMS156-XE_sp", + "SAROP31-PPRM113_sp", + "SAROP31-PPRM150_sp", + "SAROP31-PPRM113_proc:9001", + "SAROP31-PPRM113_ib:9000", + "SAROP31-PPRM150_ib:9002", + "SAROP31-PPRM150_proc:9003" + ] }, "http://sf-daqsync-08.psi.ch:8881": { "cameras": [ @@ -100,9 +112,7 @@ "cameras": [], "enabled": true, "expanding": true, - "instances": [ - "SAROP11-ATT01_proc:9001" - ] + "instances": [] }, "http://sf-daqsync-11.psi.ch:8881": { "cameras": [ @@ -137,7 +147,7 @@ "SATES21-CAMS-PATT1_spec_db:9003", "SATES21-CAMS-PATT1_spec_ib:9002", "SATES21-CAMS-PATT1_sp" - ] + ] }, "http://sf-daqsync-13.psi.ch:8881": { "cameras": [ @@ -177,6 +187,7 @@ "SAROP21-PPRM138", "SARES20-DSDPPRM" ], + "enabled": true, "expanding": false, "instances": [ "SARES20-CAMS142-M1_psen_ib:9002", @@ -194,7 +205,7 @@ "SAROP21-PPRM138_proc:9015", "SAROP21-PPRM138_sp", "SARES20-PROF141-M1_sp", - "#SARES20-PROF141-M1_proc:9016", + "SARES20-PROF141-M1_proc:9016", "SARES20-PROF141-M1_ib:9013", "SARES20-PROF146-M1_sp", "SARES20-PROF146-M1_proc:9018", @@ -227,4 +238,4 @@ "expanding": false, "instances": [] } -} +} \ No newline at end of file diff --git a/configuration/user_scripts/SARES11-SPEC125-M1_tt.py b/configuration/user_scripts/SARES11-SPEC125-M1_tt.py index 7cbd6e4..a690f2f 100644 --- a/configuration/user_scripts/SARES11-SPEC125-M1_tt.py +++ b/configuration/user_scripts/SARES11-SPEC125-M1_tt.py @@ -17,7 +17,8 @@ lambdas = np.linspace(510.57796, 628.63459, num=2048) # calibration from 2022-05 nus = 299792458 / (lambdas * 10**-9) # frequency space, uneven nus_new = np.linspace(nus[0], nus[-1], num=2048, endpoint=True) # frequency space, even filters = { - "YAG": np.concatenate((np.ones(20),signal.tukey(40)[20:40], np.zeros(2008), np.zeros(2048))) # back timetool YAG + "YAG": np.concatenate((np.ones(20),signal.tukey(40)[20:40], np.zeros(2008), np.zeros(2048))), # back timetool YAG + "SiN": np.concatenate((signal.tukey(40)[25:40], np.zeros(2033), np.zeros(2048))) # SiN } # Functions for image analysis and spectral encoding processing @@ -101,7 +102,7 @@ def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata if roi_signal is not None: projection_background = get_roi_projection(background, roi_signal, project_axis) projection_signal = get_roi_projection(image, roi_signal, project_axis) - peak_pos, peak_amp, sig_deriv, sig_uninterp = edge("YAG", projection_background, projection_signal, 0) + peak_pos, peak_amp, sig_deriv, sig_uninterp = edge("SiN", projection_background, projection_signal, 0) except Exception as e: lineno = sys.exc_info()[2].tb_lineno diff --git a/configuration/user_scripts/SARES11-XMI125-C4P1_jetprojections.py b/configuration/user_scripts/SARES11-XMI125-C4P1_jetprojections.py new file mode 100644 index 0000000..75bae05 --- /dev/null +++ b/configuration/user_scripts/SARES11-XMI125-C4P1_jetprojections.py @@ -0,0 +1,41 @@ +from cam_server.pipeline.data_processing import functions, processor + +import json +from collections import deque +from logging import getLogger + +_logger = getLogger(__name__) + +background = deque(maxlen=4) + +DEFAULT_ROI_SIGNAL = None +DEFAULT_ROI_BACKGROUND = None + + +def get_roi_projection(image, roi, axis): + x_start, x_stop, y_start, y_stop = roi + cropped = image[x_start:x_stop, y_start:y_stop] + project = cropped.mean(axis=axis) + return project + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None): + + processed_data = dict() + + if bsdata is not None: + processed_data.update(bsdata) + + event = processed_data.get("SAR-CVME-TIFALL4:EvtSet", None) + + image_property_name = parameters["camera_name"] + roi_signal = parameters.get("roi_signal", DEFAULT_ROI_SIGNAL) + + processed_data[image_property_name + ".processing_parameters"] = json.dumps({"roi_signal": roi_signal}) + + if roi_signal: + jet_projection = get_roi_projection(image, roi_signal, 1) + processed_data[image_property_name + ".jet_projection"] = jet_projection + jet_width = get_roi_projection(image, roi_signal, 0) + processed_data[image_property_name + ".jet_width"] = jet_width + + return processed_data \ No newline at end of file diff --git a/configuration/user_scripts/SAROP21-ATT01_proc.py b/configuration/user_scripts/SAROP21-ATT01_proc.py index b605937..81bc499 100644 --- a/configuration/user_scripts/SAROP21-ATT01_proc.py +++ b/configuration/user_scripts/SAROP21-ATT01_proc.py @@ -1,5 +1,4 @@ from collections import deque -import logging from logging import getLogger from scipy.signal import savgol_filter import numpy as np @@ -69,73 +68,72 @@ def process(data, pulse_id, timestamp, params): if not initialized: initialize(params) output = {} - try: - # Read stream inputs - prof_sig = data[params["prof_sig"]] - if prof_sig is None: - #TODO - return - prof_sig = prof_sig.astype('l') - prof_sig_savgol = savgol_filter(prof_sig, filter_window, 3) - events = data[params["events"]] - - if events[dark_event] and use_dark: - buffer.append(prof_sig) - - if prof_sig_savgol.ndim == 1: - prof_sig_savgol = prof_sig_savgol[np.newaxis, :] - - if events[dark_event] and use_dark: - buffer_savgol.append(prof_sig_savgol) - edge_results = {"edge_pos": np.nan, "xcorr": np.nan, "xcorr_ampl": np.nan, "signal":np.nan} - else: - if events[fel_on_event] and buffer_savgol: - prof_sig_norm = prof_sig_savgol / np.mean(buffer_savgol, axis=0) - edge_results = find_edge(prof_sig_norm, step_length, edge_type, refinement) - elif events[fel_on_event] and not use_dark: - edge_results = find_edge(prof_sig_savgol, step_length, edge_type, refinement) - else: - edge_results = {"edge_pos": np.nan, "xcorr": np.nan, "xcorr_ampl": np.nan, "signal":np.nan} - - # calib edge - edge_results["arrival_time"] = np.polyval(calib,edge_results["edge_pos"]) - # sort edge by parity - if pulse_id %2 ==0: - edge_results["arrival_time_even"] = np.nan if np.isnan(edge_results["edge_pos"]) else edge_results["edge_pos"] * calib - edge_results["arrival_time_odd"] = np.nan - else: - edge_results["arrival_time_even"] = np.nan - edge_results["arrival_time_odd"] = np.nan if np.isnan(edge_results["edge_pos"]) else edge_results["edge_pos"] * calib - - # push pulse ID for debuging - edge_results["pulse_id"] = pulse_id - # Set bs outputs - for key, value in edge_results.items(): - if key in ("pulse_id", "arrival_time", "edge_pos", "xcorr_ampl"): - output[f"{device}:{key}"] = value - 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"] = np.zeros(len(prof_sig), prof_sig.dtype) #np.nan - output[f"{device}:dark_wf_savgol"] = np.zeros(len(prof_sig), prof_sig_savgol.dtype) #np.nan - - if buffer: - output[f"{device}:avg_dark_wf"] = np.mean(buffer, axis=0) - else: - output[f"{device}:avg_dark_wf"] = np.nan - - if buffer_savgol: - output[f"{device}:avg_dark_wf_savgol"] = np.mean(buffer_savgol, axis=0) - else: - output[f"{device}:avg_dark_wf_savgol"] = np.nan - return output - except Exception as e: - #_logger.debug("Error in " + __name__ + ": "+ str(e)) - logging.exception("message") - #raise - return None + # Read stream inputs + prof_sig = data[params["prof_sig"]] + try: + prof_sig_savgol = savgol_filter(prof_sig, filter_window, 3) + except: + output[f"{device}:raw_wf"] = prof_sig + return output # added for intermitent cases with prof_sig shorter than filter window + events = data[params["events"]] + + if events[dark_event] and use_dark: + buffer.append(prof_sig) + if prof_sig_savgol.ndim == 1: + prof_sig_savgol = prof_sig_savgol[np.newaxis, :] + + if events[dark_event] and use_dark: + buffer_savgol.append(prof_sig_savgol) + edge_results = {"edge_pos": np.nan, "xcorr": np.nan, "xcorr_ampl": np.nan, "signal":np.nan} + else: + if events[fel_on_event] and buffer_savgol: + prof_sig_norm = prof_sig_savgol / np.mean(buffer_savgol, axis=0) + edge_results = find_edge(prof_sig_norm, step_length, edge_type, refinement) + elif events[fel_on_event] and not use_dark: + edge_results = find_edge(prof_sig_savgol, step_length, edge_type, refinement) + else: + edge_results = {"edge_pos": np.nan, "xcorr": np.nan, "xcorr_ampl": np.nan, "signal":np.nan} + + # calib edge + edge_results["arrival_time"] = np.polyval(calib,edge_results["edge_pos"]) + # sort edge by parity + if pulse_id %2 ==0: + try: + edge_results["arrival_time_even"] = edge_results["edge_pos"] * calib + except: + edge_results["arrival_time_even"] = np.nan + edge_results["arrival_time_odd"] = np.nan + else: + edge_results["arrival_time_even"] = np.nan + try: + edge_results["arrival_time_odd"] = edge_results["edge_pos"] * calib + except: + edge_results["arrival_time_odd"] = np.nan + # push pulse ID for debuging + edge_results["pulse_id"] = pulse_id + # Set bs outputs + for key, value in edge_results.items(): + output[f"{device}:{key}"] = value + + 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"] = np.nan + output[f"{device}:dark_wf_savgol"] = np.nan + + if buffer: + output[f"{device}:avg_dark_wf"] = np.mean(buffer, axis=0) + else: + output[f"{device}:avg_dark_wf"] = np.nan + + if buffer_savgol: + output[f"{device}:avg_dark_wf_savgol"] = np.mean(buffer_savgol, axis=0) + else: + output[f"{device}:avg_dark_wf_savgol"] = np.nan + + return output diff --git a/configuration/user_scripts/pbps_full.py b/configuration/user_scripts/pbps_full.py index c748b51..69be6b3 100644 --- a/configuration/user_scripts/pbps_full.py +++ b/configuration/user_scripts/pbps_full.py @@ -137,8 +137,8 @@ def process(data, pulse_id, timestamp, params): xpos = ((right - left) / (right + left)) * params["horiz_calib"] ypos = ((up - down) / (up + down)) * params["vert_calib"] else: - xpos = np.nan - ypos = np.nan + xpos = 1.5 + ypos = 1.5 # Update buffers buffers["xpos_all"].append(xpos) diff --git a/configuration/user_scripts/pprm_gf.py b/configuration/user_scripts/pprm_gf.py new file mode 100644 index 0000000..78b2eaf --- /dev/null +++ b/configuration/user_scripts/pprm_gf.py @@ -0,0 +1,12 @@ +from collections import OrderedDict +from cam_server.pipeline.data_processing import functions, processor + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata): + r = processor.process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata) + ret = OrderedDict() + channels = ["intensity","x_center_of_mass","x_fwhm","x_rms","x_fit_amplitude", "x_fit_mean","x_fit_offset","x_fit_standard_deviation","x_profile","y_center_of_mass","y_fwhm","y_rms","y_fit_amplitude", "y_fit_mean","y_fit_offset","y_fit_standard_deviation","y_profile","gr_x_fit_amplitude", "gr_x_fit_mean","gr_x_fit_offset","gr_x_fit_standard_deviation","gr_x_profile","gr_y_fit_amplitude", "gr_y_fit_mean","gr_y_fit_offset","gr_y_fit_standard_deviation","gr_y_profile"] + prefix = parameters["camera_name"] + for c in channels: + ret[prefix+":"+c] = r[c] + return ret