diff --git a/configuration/camera_config/Bernina_samplecam_inline.json b/configuration/camera_config/Bernina_samplecam_inline.json new file mode 100644 index 0000000..de691d6 --- /dev/null +++ b/configuration/camera_config/Bernina_samplecam_inline.json @@ -0,0 +1,23 @@ +{ + "camera_calibration": { + "reference_marker": [ + 1093, + 427, + 1463, + 802 + ], + "reference_marker_width": 1.0, + "reference_marker_height": 1.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "prefix": "SLAAR21-LCAM-C532", + "name": "Bernina_samplecam_inline", + "source": "SLAAR21-LCAM-C532" +} \ No newline at end of file diff --git a/configuration/camera_config/Bernina_samplecam_sideview.json b/configuration/camera_config/Bernina_samplecam_sideview.json new file mode 100644 index 0000000..80bdb3f --- /dev/null +++ b/configuration/camera_config/Bernina_samplecam_sideview.json @@ -0,0 +1,23 @@ +{ + "camera_calibration": { + "reference_marker": [ + 1524, + 945, + 1622, + 1046 + ], + "reference_marker_width": 1.0, + "reference_marker_height": 1.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "prefix": "SARES20-CAMS142-C1", + "name": "Bernina_samplecam_sideview", + "source": "SARES20-CAMS142-C1" +} \ No newline at end of file diff --git a/configuration/camera_config/Bernina_samplecam_xrd.json b/configuration/camera_config/Bernina_samplecam_xrd.json new file mode 100644 index 0000000..4c96a40 --- /dev/null +++ b/configuration/camera_config/Bernina_samplecam_xrd.json @@ -0,0 +1,12 @@ +{ + "camera_calibration": null, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "prefix": "SARES20-CAMS142-C3", + "name": "Bernina_samplecam_xrd", + "source": "SARES20-CAMS142-C3" +} \ No newline at end of file diff --git a/configuration/camera_config/Bernina_xeye.json b/configuration/camera_config/Bernina_xeye.json new file mode 100644 index 0000000..0a6255b --- /dev/null +++ b/configuration/camera_config/Bernina_xeye.json @@ -0,0 +1,23 @@ +{ + "camera_calibration": { + "reference_marker": [ + 416, + 275, + 438, + 286 + ], + "reference_marker_width": 16.0, + "reference_marker_height": 8.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "name": "Bernina_xeye", + "prefix": "SARES20-PROF142-M1", + "source": "SARES20-PROF142-M1" +} \ No newline at end of file diff --git a/configuration/camera_config/IR_Beam_Monitor_I.json b/configuration/camera_config/IR_Beam_Monitor_I.json new file mode 100644 index 0000000..864736b --- /dev/null +++ b/configuration/camera_config/IR_Beam_Monitor_I.json @@ -0,0 +1,22 @@ +{ + "camera_calibration": { + "reference_marker": [ + 565, + 345, + 666, + 445 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "name": "IR_Beam_Monitor_I", + "source": "SLAAR21-LCAM-C511" +} \ No newline at end of file diff --git a/configuration/camera_config/IR_Beam_Monitor_II.json b/configuration/camera_config/IR_Beam_Monitor_II.json new file mode 100644 index 0000000..0b00e57 --- /dev/null +++ b/configuration/camera_config/IR_Beam_Monitor_II.json @@ -0,0 +1,22 @@ +{ + "camera_calibration": { + "reference_marker": [ + 568, + 440, + 668, + 540 + ], + "reference_marker_width": 118.0, + "reference_marker_height": 87.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "roi": null, + "image_background": null, + "source_type": "epics", + "name": "IR_Beam_Monitor_II", + "source": "SLAAR21-LCAM-C531" +} \ No newline at end of file diff --git a/configuration/camera_config/SARES12-CAMS128-M1.json b/configuration/camera_config/SARES12-CAMS128-M1.json new file mode 100644 index 0000000..82b9c43 --- /dev/null +++ b/configuration/camera_config/SARES12-CAMS128-M1.json @@ -0,0 +1,22 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SARES12-CAMS128-M1", + "prefix": "SARES12-CAMS128-M1", + "source": "SARES12-CAMS128-M1", + "connections": 2 +} diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE1.json b/configuration/camera_config/SATES21-CAMS154-GIGE1.json new file mode 100644 index 0000000..5c73c78 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE1.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE1", + "source": "SATES21-CAMS154-GIGE1" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE2.json b/configuration/camera_config/SATES21-CAMS154-GIGE2.json new file mode 100644 index 0000000..4693ac2 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE2.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE2", + "source": "SATES21-CAMS154-GIGE2" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE3.json b/configuration/camera_config/SATES21-CAMS154-GIGE3.json new file mode 100644 index 0000000..20a05b8 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE3.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE3", + "source": "SATES21-CAMS154-GIGE3" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE4.json b/configuration/camera_config/SATES21-CAMS154-GIGE4.json new file mode 100644 index 0000000..8ca0140 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE4.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE4", + "source": "SATES21-CAMS154-GIGE4" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE5.json b/configuration/camera_config/SATES21-CAMS154-GIGE5.json new file mode 100644 index 0000000..b6f5b34 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE5.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE5", + "source": "SATES21-CAMS154-GIGE5" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE6.json b/configuration/camera_config/SATES21-CAMS154-GIGE6.json new file mode 100644 index 0000000..2f95b6c --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE6.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE6", + "source": "SATES21-CAMS154-GIGE6" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE7.json b/configuration/camera_config/SATES21-CAMS154-GIGE7.json new file mode 100644 index 0000000..f7aa37d --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE7.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE7", + "source": "SATES21-CAMS154-GIGE7" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE7b.json b/configuration/camera_config/SATES21-CAMS154-GIGE7b.json new file mode 100644 index 0000000..72d58f7 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE7b.json @@ -0,0 +1,22 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES21-CAMS154-GIGE7b", + "prefix": "SATES21-CAMS154-GIGE7", + "source": "SATES21-CAMS154-GIGE7", + "connections": 1 +} diff --git a/configuration/camera_config/SATES21-CAMS154-GIGE8.json b/configuration/camera_config/SATES21-CAMS154-GIGE8.json new file mode 100644 index 0000000..4faf741 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-GIGE8.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATES21-CAMS154-GIGE8", + "source": "SATES21-CAMS154-GIGE8" +} \ No newline at end of file diff --git a/configuration/camera_config/SATES21-CAMS154-M1.json b/configuration/camera_config/SATES21-CAMS154-M1.json new file mode 100644 index 0000000..9fbc2c4 --- /dev/null +++ b/configuration/camera_config/SATES21-CAMS154-M1.json @@ -0,0 +1,23 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "bsread", + "name": "SATES21-CAMS154-M1", + "prefix": "SATES21-CAMS154-M1", + "source": "SATES21-CAMS154-M1", + "connections": 4, + "buffer_size": 100 +} diff --git a/configuration/camera_config/SATES24-CAMS161-M1.json b/configuration/camera_config/SATES24-CAMS161-M1.json new file mode 100644 index 0000000..d7beee4 --- /dev/null +++ b/configuration/camera_config/SATES24-CAMS161-M1.json @@ -0,0 +1,23 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "name": "SATES24-CAMS161-M1", + "prefix": "SATES24-CAMS161-M1", + "source": "SATES24-CAMS161-M1", + "source_type": "bsread", + "connections": 4, + "buffer_size": 100 +} diff --git a/configuration/camera_config/SATFE10-PSRD066.json b/configuration/camera_config/SATFE10-PSRD066.json new file mode 100644 index 0000000..f70fedc --- /dev/null +++ b/configuration/camera_config/SATFE10-PSRD066.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATFE10-PSRD066", + "source": "SATFE10-PSRD066" +} \ No newline at end of file diff --git a/configuration/camera_config/SATOP11-PSCR074.json b/configuration/camera_config/SATOP11-PSCR074.json new file mode 100644 index 0000000..c1f073e --- /dev/null +++ b/configuration/camera_config/SATOP11-PSCR074.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 100, + 46, + 565, + 438 + ], + "reference_marker_width": 13000.0, + "reference_marker_height": 11000.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATOP11-PSCR074", + "source": "SATOP11-PSCR074" +} \ No newline at end of file diff --git a/configuration/camera_config/SATOP11-PSCR086.json b/configuration/camera_config/SATOP11-PSCR086.json new file mode 100644 index 0000000..cf4ff61 --- /dev/null +++ b/configuration/camera_config/SATOP11-PSCR086.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 114, + 43, + 539, + 329 + ], + "reference_marker_width": 12000.0, + "reference_marker_height": 9000.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATOP11-PSCR086", + "source": "SATOP11-PSCR086" +} \ No newline at end of file diff --git a/configuration/camera_config/SATOP11-PSCR090.json b/configuration/camera_config/SATOP11-PSCR090.json new file mode 100644 index 0000000..a237b29 --- /dev/null +++ b/configuration/camera_config/SATOP11-PSCR090.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 91, + 97, + 559, + 492 + ], + "reference_marker_width": 13000.0, + "reference_marker_height": 11000.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "name": "SATOP11-PSCR090", + "source": "SATOP11-PSCR090" +} \ No newline at end of file diff --git a/configuration/camera_config/SATOP21-PSCR140.json b/configuration/camera_config/SATOP21-PSCR140.json new file mode 100644 index 0000000..b887456 --- /dev/null +++ b/configuration/camera_config/SATOP21-PSCR140.json @@ -0,0 +1,20 @@ +{ + "camera_calibration": { + "reference_marker": [ + 0, + 0, + 100, + 100 + ], + "reference_marker_width": 100.0, + "reference_marker_height": 100.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "epics", + "source": "SATOP21-PSCR140", + "name": "SATOP21-PSCR140" +} \ No newline at end of file diff --git a/configuration/camera_config/servers.back b/configuration/camera_config/servers.back new file mode 100644 index 0000000..9cb6e57 --- /dev/null +++ b/configuration/camera_config/servers.back @@ -0,0 +1,39 @@ +{ + "http://sf-daqsync-01.psi.ch:8880": { + "expanding": true, + "instances": [ + ] + }, + "http://sf-daqsync-02.psi.ch:8880": { + "expanding": false, + "instances": [ + "SARFE10-PSSS059" + ] + }, + "http://sf-daqsync-03.psi.ch:8880": { + "expanding": true, + "instances": [ + ] + }, + "http://sf-daqsync-04.psi.ch:8880": { + "expanding": false, + "instances": [ + "SATES21-CAMS154-M1", + "SATES24-CAMS161-M1" + ] + }, + "http://sf-daqsync-05.psi.ch:8880": { + "expanding": true, + "instances": [ + "SARES11-SPEC125-M1", + "SARES11-SPEC125-M2" + ] + }, + "http://sf-daqsync-06.psi.ch:8880": { + "expanding": true, + "instances": [ + "SARES20-CAMS142-M4", + "SARES20-CAMS142-M5" + ] + } +} diff --git a/configuration/camera_config/servers.test b/configuration/camera_config/servers.test new file mode 100644 index 0000000..0800f89 --- /dev/null +++ b/configuration/camera_config/servers.test @@ -0,0 +1,34 @@ +{ + "http://sf-daqsync-01.psi.ch:8880": { + "expanding": true, + "instances": [ + ] + }, + "http://sf-daqsync-02.psi.ch:8880": { + "expanding": false, + "instances": [ + "SARFE10-PSSS059" + ] + }, + "http://sf-daqsync-04.psi.ch:8880": { + "expanding": false, + "instances": [ + "SATES21-CAMS154-M1", + "SATES24-CAMS161-M1" + ] + }, + "http://sf-daqsync-05.psi.ch:8880": { + "expanding": true, + "instances": [ + "SARES11-SPEC125-M1", + "SARES11-SPEC125-M2" + ] + }, + "http://sf-daqsync-06.psi.ch:8880": { + "expanding": true, + "instances": [ + "SARES20-CAMS142-M4", + "SARES20-CAMS142-M5" + ] + } +} diff --git a/configuration/camera_config/simulation_2.json b/configuration/camera_config/simulation_2.json new file mode 100644 index 0000000..addc607 --- /dev/null +++ b/configuration/camera_config/simulation_2.json @@ -0,0 +1,25 @@ +{ + "camera_calibration": { + "reference_marker": [ + 211, + 173, + 1063, + 793 + ], + "reference_marker_width": 30000.0, + "reference_marker_height": 30000.0, + "angle_horizontal": 0.0, + "angle_vertical": 0.0 + }, + "mirror_x": false, + "mirror_y": false, + "rotate": 0, + "source_type": "simulation", + "name": "simulation_big", + "source": "", + "frame_rate": 5, + "size_x": 20, + "size_y":20, + "simulate_pulse_id": true, + "image_type": "static_raw" +} diff --git a/configuration/pipeline_config/Alvra_PSEN_align.json b/configuration/pipeline_config/Alvra_PSEN_align.json new file mode 100644 index 0000000..03c07ae --- /dev/null +++ b/configuration/pipeline_config/Alvra_PSEN_align.json @@ -0,0 +1,19 @@ +{ + "image_background_enable": false, + "image_background": null, + "image_threshold": null, + "image_region_of_interest": [ + 0, + 659, + 0, + 494 + ], + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "camera_name": "SARES11-SPEC125-M2", + "name": "Alvra_PSEN_align", + "bsread_channels": [ + "SARFE10-PSSS059:SPECTRUM_CENTER" + ] +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARES12-CAMS128-M1_psen_db.json b/configuration/pipeline_config/SARES12-CAMS128-M1_psen_db.json new file mode 100644 index 0000000..c7e811e --- /dev/null +++ b/configuration/pipeline_config/SARES12-CAMS128-M1_psen_db.json @@ -0,0 +1,25 @@ +{ + "image_background_enable": false, + "image_background": "SARES12-CAMS128-M1_20200604_125721_845028", + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "function": "psen_min_processing", + "camera_name": "SARES12-CAMS128-M1", + "name": "SARES12-CAMS128-M1_psen_db", + "mode": "PUSH", + "roi_background": [ + 800, + 450, + 1300, + 450 + ], + "roi_signal": [ + 800, + 450, + 700, + 450 + ] +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARES12-CAMS128-M1_psen_ib.json b/configuration/pipeline_config/SARES12-CAMS128-M1_psen_ib.json new file mode 100644 index 0000000..c48d69c --- /dev/null +++ b/configuration/pipeline_config/SARES12-CAMS128-M1_psen_ib.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": "store", + "camera_name": "SARES12-CAMS128-M1", + "name": "SARES12-CAMS128-M1_psen_ib", + "stream_port": 0 +} diff --git a/configuration/pipeline_config/SARFE10-PSSS059_psss.json b/configuration/pipeline_config/SARFE10-PSSS059_psss.json new file mode 100644 index 0000000..7f738c1 --- /dev/null +++ b/configuration/pipeline_config/SARFE10-PSSS059_psss.json @@ -0,0 +1,16 @@ +{ + "image_background_enable": "passive", + "image_background": "SARFE10-PSSS059:FPICTURE_12826023152_25", + "image_threshold": null, + "image_region_of_interest": null, + "image_good_region": null, + "image_slices": null, + "pipeline_type": "processing", + "camera_name": "SARFE10-PSSS059", + "name": "SARFE10-PSSS059_psss", + "function": "psss.py", + "mode": "PUSH", + "no_client_timeout": 0, + "port": "8889", + "reload": false +} \ No newline at end of file diff --git a/configuration/pipeline_config/SARFE10-PSSS059_store.json b/configuration/pipeline_config/SARFE10-PSSS059_store.json new file mode 100644 index 0000000..435e226 --- /dev/null +++ b/configuration/pipeline_config/SARFE10-PSSS059_store.json @@ -0,0 +1,5 @@ +{ + "pipeline_type": "store", + "camera_name": "SARFE10-PSSS059", + "name": "SARFE10-PSSS059_store" +} diff --git a/configuration/pipeline_config/SATES21-CAMS154-M1_psen_db.json b/configuration/pipeline_config/SATES21-CAMS154-M1_psen_db.json new file mode 100644 index 0000000..dd3483d --- /dev/null +++ b/configuration/pipeline_config/SATES21-CAMS154-M1_psen_db.json @@ -0,0 +1,27 @@ +{ + "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": "psen_min_processing", + "camera_name": "SATES21-CAMS154-M1", + "name": "SATES21-CAMS154-M1_psen_db", + "mode": "PUSH", + "roi_background": [ + 300, + 2048, + 600, + 400 + ], + "roi_signal": [ + 300, + 2048, + 1150, + 400 + ], + "no_client_timeout": 0, + "port": "9001" +} diff --git a/configuration/pipeline_config/SATES21-CAMS154-M1_psen_ib.json b/configuration/pipeline_config/SATES21-CAMS154-M1_psen_ib.json new file mode 100644 index 0000000..5763655 --- /dev/null +++ b/configuration/pipeline_config/SATES21-CAMS154-M1_psen_ib.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": "store", + "camera_name": "SATES21-CAMS154-M1", + "name": "SATES21-CAMS154-M1_psen_ib", + "stream_port": 0 +} diff --git a/configuration/pipeline_config/SATES24-CAMS161-M1_psen_db.json b/configuration/pipeline_config/SATES24-CAMS161-M1_psen_db.json new file mode 100644 index 0000000..78fa09a --- /dev/null +++ b/configuration/pipeline_config/SATES24-CAMS161-M1_psen_db.json @@ -0,0 +1,25 @@ +{ + "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": "psen_min_processing", + "camera_name": "SATES24-CAMS161-M1", + "name": "SATES24-CAMS161-M1_psen_db", + "mode": "PUSH", + "roi_background": [ + 300, + 2048, + 600, + 400 + ], + "roi_signal": [ + 300, + 2048, + 1150, + 400 + ] +} diff --git a/configuration/pipeline_config/SATES24-CAMS161-M1_psen_ib.json b/configuration/pipeline_config/SATES24-CAMS161-M1_psen_ib.json new file mode 100644 index 0000000..6155d6f --- /dev/null +++ b/configuration/pipeline_config/SATES24-CAMS161-M1_psen_ib.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": "store", + "camera_name": "SATES24-CAMS161-M1", + "name": "SATES24-CAMS161-M1_psen_ib", + "stream_port": 0 +} diff --git a/configuration/pipeline_config/SATOP11-PSCR074_acd.json b/configuration/pipeline_config/SATOP11-PSCR074_acd.json new file mode 100644 index 0000000..4968f75 --- /dev/null +++ b/configuration/pipeline_config/SATOP11-PSCR074_acd.json @@ -0,0 +1,17 @@ +{ + "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", + "include": [ + "x_center_of_mass", + "y_center_of_mass", + "x_fit_mean", + "y_fit_mean" + ], + "camera_name": "SATOP11-PSCR074", + "name": "SATOP11-PSCR074_acd" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATOP11-PSCR086_acd.json b/configuration/pipeline_config/SATOP11-PSCR086_acd.json new file mode 100644 index 0000000..5adc29d --- /dev/null +++ b/configuration/pipeline_config/SATOP11-PSCR086_acd.json @@ -0,0 +1,17 @@ +{ + "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", + "include": [ + "x_center_of_mass", + "y_center_of_mass", + "x_fit_mean", + "y_fit_mean" + ], + "camera_name": "SATOP11-PSCR086", + "name": "SATOP11-PSCR086_acd" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATOP11-PSCR090_acd.json b/configuration/pipeline_config/SATOP11-PSCR090_acd.json new file mode 100644 index 0000000..d0489fb --- /dev/null +++ b/configuration/pipeline_config/SATOP11-PSCR090_acd.json @@ -0,0 +1,17 @@ +{ + "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", + "include": [ + "x_center_of_mass", + "y_center_of_mass", + "x_fit_mean", + "y_fit_mean" + ], + "camera_name": "SATOP11-PSCR090", + "name": "SATOP11-PSCR090_acd" +} \ No newline at end of file diff --git a/configuration/pipeline_config/SATOP21-PSCR140_acd.json b/configuration/pipeline_config/SATOP21-PSCR140_acd.json new file mode 100644 index 0000000..e4f3043 --- /dev/null +++ b/configuration/pipeline_config/SATOP21-PSCR140_acd.json @@ -0,0 +1,17 @@ +{ + "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", + "include": [ + "x_center_of_mass", + "y_center_of_mass", + "x_fit_mean", + "y_fit_mean" + ], + "camera_name": "SATOP21-PSCR140", + "name": "SATOP21-PSCR140_acd" +} \ No newline at end of file diff --git a/configuration/user_scripts/arrival_time_proc.py b/configuration/user_scripts/arrival_time_proc.py new file mode 100644 index 0000000..0b8b693 --- /dev/null +++ b/configuration/user_scripts/arrival_time_proc.py @@ -0,0 +1,12 @@ +import json +import numpy +from cam_server.pipeline.data_processing import functions +from logging import getLogger + +_logger = getLogger(__name__) + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata): + ret = {} + ret["test"] = 1 + return ret diff --git a/configuration/user_scripts/binning.py b/configuration/user_scripts/binning.py new file mode 100644 index 0000000..6208292 --- /dev/null +++ b/configuration/user_scripts/binning.py @@ -0,0 +1,14 @@ +from cam_server.pipeline.data_processing import processor + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None): + if parameters.get("binning_x") or parameters.get("binning_y"): + by, bx = int(parameters.get("binning_y",1)), int(parameters.get("binning_x",1)) + sy, sx = image.shape + x_axis = x_axis.reshape(int(sx / bx), int(bx)).mean(axis=(1)) + y_axis = y_axis.reshape(int(sy / by), int(by)).mean(axis=(1)) + image = image.reshape(int(sy / by), int(by), int(sx / bx), int(bx) ).sum(axis=(1, 3)).astype("uint16") + ret = processor.process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata) + return ret + + diff --git a/configuration/user_scripts/psen_min_proc_binning.py b/configuration/user_scripts/psen_min_proc_binning.py new file mode 100644 index 0000000..9df544b --- /dev/null +++ b/configuration/user_scripts/psen_min_proc_binning.py @@ -0,0 +1,45 @@ +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_x_profile(image, roi): + offset_x, size_x, offset_y, size_y = roi + roi_image = image[offset_y:offset_y + size_y, offset_x:offset_x + size_x] + + return roi_image.sum(0) + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, image_background_array=None): + + processed_data = dict() + + by, bx = 2,2 + sy, sx = image.shape + #x_axis = x_axis.reshape(int(sx / bx), int(bx)).mean(axis=(1)) + #y_axis = y_axis.reshape(int(sy / by), int(by)).mean(axis=(1)) + image = image.reshape(int(sy / by), int(by), int(sx / bx), int(bx) ).sum(axis=(1, 3)).astype("uint16") + + image_property_name = parameters["camera_name"] + roi_signal = parameters.get("roi_signal", DEFAULT_ROI_SIGNAL) + roi_background = parameters.get("roi_background", DEFAULT_ROI_BACKGROUND) + + processed_data[image_property_name + ".processing_parameters"] = json.dumps({"roi_signal": roi_signal, + "roi_background": roi_background}) + + if roi_signal: + signal_profile = get_roi_x_profile(image, roi_signal) + processed_data[image_property_name + ".roi_signal_x_profile"] = signal_profile + + if roi_background: + processed_data[image_property_name + ".roi_background_x_profile"] = get_roi_x_profile(image, roi_background) + + return processed_data + diff --git a/configuration/user_scripts/psss.py b/configuration/user_scripts/psss.py new file mode 100644 index 0000000..53c69cc --- /dev/null +++ b/configuration/user_scripts/psss.py @@ -0,0 +1,161 @@ +from logging import getLogger + +from cam_server.pipeline.data_processing import functions +from cam_server.pipeline.data_processing.functions import chunk_copy + +import json + +import numpy +import scipy.signal +import scipy.optimize +import numba +numba.set_num_threads(4) + +import epics + +_logger = getLogger(__name__) + +output_pv, center_pv, fwhm_pv, ymin_pv, ymax_pv, axis_pv = None, None, None, None, None, None +roi = [0, 0] +initialized = False + + +@numba.njit(parallel=True) +def get_spectrum (image, background): + y = image.shape[0] + x = image.shape[1] + + profile = numpy.zeros(x, dtype=numpy.uint32) + b = 0 + for i in numba.prange(y): + for j in range(x): + v = image[i,j] + b = background[i,j] + if v > b: + v -= b + else: + v = 0 + profile[j] += v + return profile + + +def initialize(parameters): + global ymin_pv, ymax_pv, axis_pv, output_pv, center_pv, fwhm_pv + + + + epics_pv_name_prefix = parameters["camera_name"] + output_pv_name = epics_pv_name_prefix + ":SPECTRUM_Y" + center_pv_name = epics_pv_name_prefix + ":SPECTRUM_CENTER" + fwhm_pv_name = epics_pv_name_prefix + ":SPECTRUM_FWHM" + ymin_pv_name = epics_pv_name_prefix + ":SPC_ROI_YMIN" + ymax_pv_name = epics_pv_name_prefix + ":SPC_ROI_YMAX" + axis_pv_name = epics_pv_name_prefix + ":SPECTRUM_X" + epics.ca.clear_cache() + + output_pv = epics.PV(output_pv_name) + center_pv = epics.PV(center_pv_name) + fwhm_pv = epics.PV(fwhm_pv_name) + + ymin_pv = epics.PV(ymin_pv_name) + ymax_pv = epics.PV(ymax_pv_name) + axis_pv = epics.PV(axis_pv_name) + ymin_pv.wait_for_connection() + ymax_pv.wait_for_connection() + axis_pv.wait_for_connection() + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None, background=None): + global roi, initialized + global ymin_pv, ymax_pv, axis_pv, output_pv, center_pv, fwhm_pv + + if not initialized: + initialize(parameters) + initialized = True + + processed_data = dict() + + epics_pv_name_prefix = parameters["camera_name"] + + if ymin_pv and ymin_pv.connected: + roi[0] = ymin_pv.value + if ymax_pv and ymax_pv.connected: + roi[1] = ymax_pv.value + if axis_pv and axis_pv.connected: + axis = axis_pv.value + else: + axis = None + + if axis is None: + _logger.warning("Energy axis not connected"); + return None + + if len(axis) < image.shape[1]: + _logger.warning("Energy axis length %d < image width %d", len(axis), image.shape[1]) + return None + + # match the energy axis to image width + axis = axis[:image.shape[1]] + + processing_image = image + nrows, ncols = processing_image.shape + + # validate background data + background_image = parameters.pop('background_data', None) + + if isinstance(background_image, numpy.ndarray): + #background_image = chunk_copy(background_image) + if background_image.shape != processing_image.shape: + background_image = None + else: + background_image = None + + processed_data[epics_pv_name_prefix + ":processing_parameters"] = json.dumps( + {"roi": roi, "background": None if (background_image is None) else parameters.get('image_background')}) + + # crop the image in y direction + ymin, ymax = int(roi[0]), int(roi[1]) + if nrows >= ymax > ymin >= 0: + if (nrows != ymax) or (ymin != 0): + processing_image = processing_image[ymin: ymax, :] + if background_image is not None: + background_image = background_image[ymin:ymax, :] + + # remove the background and collapse in y direction to get the spectrum + if background_image is not None: + spectrum = get_spectrum(processing_image, background_image) + else: + spectrum = processing_image.sum(0, 'uint32') + + # smooth the spectrum with savgol filter with 51 window size and 3rd order polynomial + smoothed_spectrum = scipy.signal.savgol_filter(spectrum, 51, 3) + + # check wether spectrum has only noise. the average counts per pixel at the peak + # should be larger than 1.5 to be considered as having real signals. + minimum, maximum = smoothed_spectrum.min(), smoothed_spectrum.max() + amplitude = maximum - minimum + skip = True + if amplitude > nrows * 1.5: + skip = False + # gaussian fitting + offset, amplitude, center, sigma = functions.gauss_fit_psss(smoothed_spectrum[::2], axis[::2], + offset=minimum, amplitude=amplitude, skip=skip) + + # outputs + processed_data[epics_pv_name_prefix + ":SPECTRUM_Y"] = spectrum + processed_data[epics_pv_name_prefix + ":SPECTRUM_X"] = axis + processed_data[epics_pv_name_prefix + ":SPECTRUM_CENTER"] = center + processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"] = 2.355 * sigma + + if output_pv and output_pv.connected: + output_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_Y"]) + _logger.debug("caput on %s for pulse_id %s", output_pv, pulse_id) + + if center_pv and center_pv.connected: + center_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_CENTER"]) + + if fwhm_pv and fwhm_pv.connected: + fwhm_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"]) + + return processed_data + diff --git a/configuration/user_scripts/psss_debug.py b/configuration/user_scripts/psss_debug.py new file mode 100644 index 0000000..0b894de --- /dev/null +++ b/configuration/user_scripts/psss_debug.py @@ -0,0 +1,138 @@ +from logging import getLogger + +from cam_server.pipeline.data_processing import functions + +import json + +import numpy +import scipy.signal +import scipy.optimize + +import epics + + +_logger = getLogger(__name__) + +output_pv, center_pv, fwhm_pv, ymin_pv, ymax_pv, axis_pv = None, None, None, None, None, None +roi = [0, 0] +initialized = False + + +def initialize(parameters): + global ymin_pv, ymax_pv, axis_pv, output_pv, center_pv, fwhm_pv + + + + epics_pv_name_prefix = parameters["camera_name"] + _logger.warning("epics_pv_name_prefix: " + str(epics_pv_name_prefix)) + output_pv_name = epics_pv_name_prefix + ":SPECTRUM_Y" + center_pv_name = epics_pv_name_prefix + ":SPECTRUM_CENTER" + fwhm_pv_name = epics_pv_name_prefix + ":SPECTRUM_FWHM" + ymin_pv_name = epics_pv_name_prefix + ":SPC_ROI_YMIN" + ymax_pv_name = epics_pv_name_prefix + ":SPC_ROI_YMAX" + axis_pv_name = epics_pv_name_prefix + ":SPECTRUM_X" + epics.ca.clear_cache() + + output_pv = epics.PV(output_pv_name) + center_pv = epics.PV(center_pv_name) + fwhm_pv = epics.PV(fwhm_pv_name) + + ymin_pv = epics.PV(ymin_pv_name) + ymax_pv = epics.PV(ymax_pv_name) + axis_pv = epics.PV(axis_pv_name) + ymin_pv.wait_for_connection() + ymax_pv.wait_for_connection() + axis_pv.wait_for_connection() + _logger.warning("output_pv_name: " + str(output_pv_name)) + + +def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None): + global roi, initialized + global ymin_pv, ymax_pv, axis_pv, output_pv, center_pv, fwhm_pv + + if not initialized: + initialize(parameters) + initialized = True + + processed_data = dict() + + epics_pv_name_prefix = parameters["camera_name"] + + if ymin_pv and ymin_pv.connected: + roi[0] = ymin_pv.value + if ymax_pv and ymax_pv.connected: + roi[1] = ymax_pv.value + if axis_pv and axis_pv.connected: + axis = axis_pv.value + else: + axis = None + + if axis is None or len(axis) != image.shape[1]: + _logger.warning("Invalid energy axis") + return None + + #processed_data[epics_pv_name_prefix + ":processing_parameters"] = json.dumps({"roi": roi, "background": parameters['background']}) + parameters["roi"] = roi + processed_data[epics_pv_name_prefix + ":processing_parameters"] = json.dumps(parameters) + + + processing_image = image + nrows, ncols = processing_image.shape + + """ + # validate background data + background_image = parameters.get('background_data') + if isinstance(background_image, numpy.ndarray): + if background_image.shape != processing_image.shape: + background_image = None + else: + background_image = None + """ + + # crop the image in y direction + ymin, ymax = roi + if nrows >= ymax > ymin >= 0: + if (nrows != ymax) or (ymin != 0): + processing_image = processing_image[int(ymin):int(ymax), :] + """ + if background_image is not None: + background_image = background_image[ymin:ymax, :] + + # remove the background and collapse in y direction to get the spectrum + if background_image is not None: + spectrum = functions.get_spectrum(processing_image, background_image) + else: + """ + spectrum = processing_image.sum(0, 'uint32') + + # smooth the spectrum with savgol filter with 51 window size and 3rd order polynomial + smoothed_spectrum = scipy.signal.savgol_filter(spectrum, 51, 3) + + # check wether spectrum has only noise. the average counts per pixel at the peak + # should be larger than 1.5 to be considered as having real signals. + minimum, maximum = smoothed_spectrum.min(), smoothed_spectrum.max() + amplitude = maximum - minimum + skip = True + if amplitude > nrows * 1.5: + skip = False + # gaussian fitting + offset, amplitude, center, sigma = functions.gauss_fit_psss(smoothed_spectrum[::2], axis[::2], + offset=minimum, amplitude=amplitude, skip=skip) + + # outputs + processed_data[epics_pv_name_prefix + ":SPECTRUM_Y"] = spectrum + processed_data[epics_pv_name_prefix + ":SPECTRUM_X"] = axis + processed_data[epics_pv_name_prefix + ":SPECTRUM_CENTER"] = center + processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"] = 2.355 * sigma + + if output_pv and output_pv.connected: + output_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_Y"]) + _logger.debug("caput on %s for pulse_id %s", output_pv, pulse_id) + + if center_pv and center_pv.connected: + center_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_CENTER"]) + + if fwhm_pv and fwhm_pv.connected: + fwhm_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"]) + + return processed_data diff --git a/configuration/user_scripts/test_arrival.py b/configuration/user_scripts/test_arrival.py new file mode 100644 index 0000000..46dec82 --- /dev/null +++ b/configuration/user_scripts/test_arrival.py @@ -0,0 +1,13 @@ +import json +import numpy +from cam_server.pipeline.data_processing import functions +from logging import getLogger + +_logger = getLogger(__name__) + +def process(data, pulse_id, timestamp, parameters): + ret = {} + ret["test"] = 1 + return ret + +