Stream pipeline example

This commit is contained in:
root
2021-03-15 08:38:18 +01:00
parent 8788967a65
commit bc6729814e
51 changed files with 621 additions and 370 deletions

View File

@@ -1,23 +0,0 @@
{
"camera_calibration": {
"reference_marker": [
662,
592,
664,
594
],
"reference_marker_width": 2.0,
"reference_marker_height": 2.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": false,
"mirror_y": false,
"rotate": 3,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "Bernina_DSD_screen",
"source": "SARES20-DSDPPRM",
"type": "Bernina"
}

View File

@@ -1,23 +0,0 @@
{
"camera_calibration": {
"reference_marker": [
1133,
530,
1237,
630
],
"reference_marker_width": 43.0,
"reference_marker_height": 41.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"
}

View File

@@ -1,23 +0,0 @@
{
"camera_calibration": {
"reference_marker": [
1670,
1002,
1679,
1012
],
"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"
}

View File

@@ -1,12 +0,0 @@
{
"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"
}

View File

@@ -1,20 +0,0 @@
{
"camera_calibration": {
"reference_marker": [
0,
0,
2049,
1251
],
"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": "Bernina_spectral_encoding",
"source": "SARES20-CAMS142-M5"
}

View File

@@ -1,23 +0,0 @@
{
"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"
}

View File

@@ -14,10 +14,14 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "bsread",
"name": "SARES11-SPEC125-M1",
"prefix": "SARES11-SPEC125-M1",
"source": "SARES11-SPEC125-M1",
"connections": 4,
"buffer_size": 100
"buffer_size": 100,
"buffer_logs": true,
"protocol": "tcp"
}

View File

@@ -6,4 +6,4 @@
"source_type": "epics",
"source": "SARES11-XPR125-C4P2",
"name": "SARES11-XPR125-C4P2"
}
}

View File

@@ -19,5 +19,12 @@
"source_type": "epics",
"prefix": "SARES20-CAMS142-C1",
"name": "SARES20-CAMS142-C1",
"source": "SARES20-CAMS142-C1"
"source": "SARES20-CAMS142-C1",
"alias": [
"samplecam_sideview"
],
"group": [
"Photonics",
"Bernina"
]
}

View File

@@ -1,17 +1,17 @@
{
"camera_calibration": {
"reference_marker": [
951,
1077,
972,
1093
507,
842,
529,
853
],
"reference_marker_width": 100.0,
"reference_marker_height": 100.0,
"reference_marker_width": 188.0,
"reference_marker_height": 94.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": true,
"mirror_x": false,
"mirror_y": false,
"rotate": 1,
"roi": null,
@@ -19,5 +19,12 @@
"source_type": "epics",
"prefix": "SARES20-CAMS142-C2",
"name": "SARES20-CAMS142-C2",
"source": "SARES20-CAMS142-C2"
"source": "SARES20-CAMS142-C2",
"group": [
"Photonics",
"Bernina"
],
"alias": [
"samplecam_sideview (SARES20-CAMS142-C2)"
]
}

View File

@@ -1,5 +1,16 @@
{
"camera_calibration": null,
"camera_calibration": {
"reference_marker": [
910,
548,
1011,
648
],
"reference_marker_width": 2.0,
"reference_marker_height": 2.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
@@ -8,5 +19,12 @@
"source_type": "epics",
"prefix": "SARES20-CAMS142-C3",
"name": "SARES20-CAMS142-C3",
"source": "SARES20-CAMS142-C3"
"source": "SARES20-CAMS142-C3",
"alias": [
"samplecam_xrd (SARES20-CAMS142-C3)"
],
"group": [
"Photonics",
"Bernina"
]
}

View File

@@ -1,13 +1,13 @@
{
"camera_calibration": {
"reference_marker": [
836,
1137,
954,
1309
1084,
659,
1086,
661
],
"reference_marker_width": 500.0,
"reference_marker_height": 500.0,
"reference_marker_width": 2,
"reference_marker_height": 2,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
@@ -16,8 +16,15 @@
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"source_type": "bsread",
"prefix": "SARES20-CAMS142-M1",
"name": "SARES20-CAMS142-M1",
"source": "SARES20-CAMS142-M1"
"source": "SARES20-CAMS142-M1",
"group": [
"Photonics",
"Bernina"
],
"alias": [
"samplecam_sideview(SARES20-CAMS142-M1)"
]
}

View File

@@ -1,13 +1,13 @@
{
"camera_calibration": {
"reference_marker": [
1251,
983,
1352,
1083
1607,
1015,
1609,
1017
],
"reference_marker_width": 103.0,
"reference_marker_height": 75.0,
"reference_marker_width": 2.0,
"reference_marker_height": 2.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
@@ -19,5 +19,12 @@
"source_type": "epics",
"prefix": "SARES20-CAMS142-M2",
"name": "SARES20-CAMS142-M2",
"source": "SARES20-CAMS142-M2"
"source": "SARES20-CAMS142-M2",
"group": [
"Photonics",
"Bernina"
],
"alias": [
"samplecam_sideview(SARES20-CAMS142-M2)"
]
}

View File

@@ -2,22 +2,29 @@
"camera_calibration": {
"reference_marker": [
460,
539,
487,
546
468,
2087,
1869
],
"reference_marker_width": 3000.0,
"reference_marker_height": 3000.0,
"reference_marker_width": 2000.0,
"reference_marker_height": 2000.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": false,
"mirror_y": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"prefix": "SARES20-CAMS142-M3",
"name": "SARES20-CAMS142-M3",
"source": "SARES20-CAMS142-M3"
"source": "SARES20-CAMS142-M3",
"group": [
"Photonics",
"Bernina"
],
"alias": [
"inline_microscope"
]
}

View File

@@ -14,10 +14,16 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "bsread",
"prefix": "SARES20-CAMS142-M4",
"name": "SARES20-CAMS142-M4",
"source": "SARES20-CAMS142-M4",
"connections": 4,
"buffer_size": 100
}
"buffer_size": 100,
"group": [
"Photonics",
"Bernina"
]
}

View File

@@ -14,10 +14,19 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "bsread",
"prefix": "SARES20-CAMS142-M5",
"name": "SARES20-CAMS142-M5",
"source": "SARES20-CAMS142-M5",
"connections": 4,
"buffer_size": 100
}
"buffer_size": 100,
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera_spectrometer(SARES20-CAMS142-M5)"
]
}

View File

@@ -1,12 +1,32 @@
{
"camera_calibration": null,
"camera_calibration": {
"reference_marker": [
362,
223,
369,
237
],
"reference_marker_width": 200.0,
"reference_marker_height": 200.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"source_type": "epics",
"roi": null,
"image_background": null,
"source_type": "bsread",
"prefix": "SARES20-PROF141-M1",
"name": "SARES20-PROF141-M1",
"source": "SARES20-PROF141-M1",
"group": ["Photonics"],
"alias": []
}
"connections": 1,
"buffer_size": 100,
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera_microscope (SARES20-PROF141-M1)"
]
}

View File

@@ -1,25 +1,30 @@
{
"camera_calibration": {
"reference_marker": [
416,
275,
438,
286
423,
218,
433,
346
],
"reference_marker_width": 16.0,
"reference_marker_height": 8.0,
"reference_marker_width": 7.8,
"reference_marker_height": 100.0,
"angle_horizontal": 0.0,
"angle_vertical": 0.0
},
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"rotate": 1,
"roi": null,
"image_background": null,
"source_type": "bsread",
"name": "SARES20-PROF142-M1",
"prefix": "SARES20-PROF142-M1",
"source": "SARES20-PROF142-M1",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"Bernina_Xeye"
]
}

View File

@@ -3,10 +3,15 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"prefix": "SARES20-PROF146-M1",
"name": "SARES20-PROF146-M1",
"source": "SARES20-PROF146-M1",
"group": ["Photonics"],
"group": [
"Photonics",
"Bernina"
],
"alias": []
}
}

View File

@@ -14,9 +14,14 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SARFE10-PPRM053",
"source": "SARFE10-PPRM053",
"group": ["Photonics"],
"group": [
"Photonics",
"Bernina"
],
"alias": []
}
}

View File

@@ -14,9 +14,16 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SARFE10-PPRM064",
"source": "SARFE10-PPRM064",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera (SARFE10-PPRM064)"
]
}

View File

@@ -22,6 +22,10 @@
"name": "SARFE10-PSSS059",
"connections": 4,
"buffer_size": 100,
"group": ["Photonics"],
"alias": []
"group": [
"Photonics",
"Bernina"
],
"alias": [],
"protocol": "tcp"
}

View File

@@ -14,9 +14,15 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP11-PPRM066",
"source": "SAROP11-PPRM066",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics"
],
"alias": [
"camera (SAROP11-PPRM066)"
]
}

View File

@@ -14,9 +14,16 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP21-PPRM094",
"source": "SAROP21-PPRM094",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera (SAROP21-PPRM094)"
]
}

View File

@@ -14,9 +14,16 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP21-PPRM102",
"source": "SAROP21-PPRM102",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera (SAROP21-PPRM102)"
]
}

View File

@@ -14,9 +14,16 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"source_type": "epics",
"roi": null,
"image_background": null,
"source_type": "bsread",
"name": "SAROP21-PPRM133",
"source": "SAROP21-PPRM133",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera (SAROP21-PPRM133)"
]
}

View File

@@ -19,6 +19,11 @@
"source_type": "epics",
"name": "SAROP21-PPRM138",
"source": "SAROP21-PPRM138",
"group": ["Photonics"],
"alias": []
}
"group": [
"Photonics",
"Bernina"
],
"alias": [
"camera (SAROP21-PPRM138)"
]
}

View File

@@ -1,21 +1,27 @@
{
"camera_calibration": {
"angle_vertical": 0.0,
"angle_horizontal": 0.0,
"reference_marker_height": 100.0,
"reference_marker": [
0,
0,
100,
100
],
"reference_marker_width": 100.0
},
"name": "SAROP21-PPRM146",
"source": "SAROP21-PPRM146",
"rotate": 0,
"mirror_y": false,
"mirror_x": false,
"group": ["Photonics"],
"alias": []
}
"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,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP21-PPRM146",
"source": "SAROP21-PPRM146",
"group": [
"Photonics",
"Bernina"
],
"alias": []
}

View File

@@ -1,21 +1,27 @@
{
"camera_calibration": {
"angle_vertical": 0.0,
"angle_horizontal": 0.0,
"reference_marker_height": 100.0,
"reference_marker": [
0,
0,
100,
100
],
"reference_marker_width": 100.0
},
"name": "SAROP21-PSCR097",
"source": "SAROP21-PSCR097",
"rotate": 0,
"mirror_y": false,
"mirror_x": false,
"group": ["Photonics"],
"alias": []
}
"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,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP21-PSCR097",
"source": "SAROP21-PSCR097",
"group": [
"Photonics",
"Bernina"
],
"alias": []
}

View File

@@ -14,8 +14,14 @@
"mirror_x": true,
"mirror_y": false,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SAROP21-PSRD103",
"source": "SAROP21-PSRD103",
"group": ["Photonics"],
"group": [
"Photonics",
"Bernina"
],
"alias": []
}
}

View File

@@ -19,5 +19,7 @@
"prefix": "SATES21-CAMS154-M1",
"source": "SATES21-CAMS154-M1",
"connections": 4,
"buffer_size": 100
"buffer_size": 100,
"buffer_logs":true,
"protocol": "tcp"
}

View File

@@ -14,10 +14,18 @@
"mirror_x": false,
"mirror_y": false,
"rotate": 0,
"name": "SATES24-CAMS161-M1",
"prefix": "SATES24-CAMS161-M1",
"source": "SATES24-CAMS161-M1",
"roi": null,
"image_background": null,
"source_type": "bsread",
"source": "SATES24-CAMS161-M1",
"name": "SATES24-CAMS161-M1",
"connections": 4,
"buffer_size": 100
"buffer_size": 100,
"prefix": "SATES24-CAMS161-M1",
"group": [
"Photonics",
"Maloja"
],
"alias": [
]
}

View File

@@ -2,9 +2,9 @@
"camera_calibration": {
"reference_marker": [
628,
465,
1107,
631
442,
1103,
604
],
"reference_marker_width": 6000.0,
"reference_marker_height": 2000.0,
@@ -14,10 +14,14 @@
"mirror_x": true,
"mirror_y": true,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"prefix": "SATMA01-DSCR030",
"name": "SATMA01-DSCR030",
"source": "SATMA01-DSCR030",
"group": ["Electrons"],
"group": [
"Electrons"
],
"alias": []
}
}

View File

@@ -1,21 +1,26 @@
{
"name": "SINLH02-DSCR220",
"camera_calibration": {
"angle_horizontal": 15.8,
"angle_vertical": 0.0,
"reference_marker_height": 16000.0,
"reference_marker": [
35,
8,
564,
612
],
"reference_marker_width": 16000.0
},
"source": "SINLH02-DSCR220",
"mirror_y": true,
"rotate": 0,
"mirror_x": true,
"group": ["Electrons"],
"alias": []
}
"camera_calibration": {
"reference_marker": [
35,
8,
564,
612
],
"reference_marker_width": 16000.0,
"reference_marker_height": 16000.0,
"angle_horizontal": 15.8,
"angle_vertical": 0.0
},
"mirror_x": true,
"mirror_y": true,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SINLH02-DSCR220",
"source": "SINLH02-DSCR220",
"group": [
"Electrons"
],
"alias": []
}

View File

@@ -1,21 +1,26 @@
{
"name": "SINSB03-DSCR110",
"camera_calibration": {
"angle_horizontal": 8.0,
"angle_vertical": 0.0,
"reference_marker_height": 16000.0,
"reference_marker": [
585,
61,
1354,
2111
],
"reference_marker_width": 6000.0
},
"source": "SINSB03-DSCR110",
"mirror_y": true,
"rotate": 0,
"mirror_x": true,
"group": ["Electrons"],
"alias": []
}
"camera_calibration": {
"reference_marker": [
587,
61,
1353,
2111
],
"reference_marker_width": 6000.0,
"reference_marker_height": 16000.0,
"angle_horizontal": 8.0,
"angle_vertical": 0.0
},
"mirror_x": true,
"mirror_y": true,
"rotate": 0,
"roi": null,
"image_background": null,
"source_type": "epics",
"name": "SINSB03-DSCR110",
"source": "SINSB03-DSCR110",
"group": [
"Electrons"
],
"alias": []
}

View File

@@ -11,7 +11,7 @@
]
},
"http://sf-daqsync-03.psi.ch:8880": {
"expanding": true,
"expanding": false,
"instances": [
]
},

View File

@@ -4,6 +4,16 @@
"instances": [
]
},
"http://sf-daqsync-09.psi.ch:8880": {
"expanding": true,
"instances": [
]
},
"http://sf-daqsync-10.psi.ch:8880": {
"expanding": true,
"instances": [
]
},
"http://sf-daqsync-02.psi.ch:8880": {
"expanding": false,
"instances": [
@@ -32,6 +42,7 @@
"http://sf-daqsync-06.psi.ch:8880": {
"expanding": true,
"instances": [
"SARES20-CAMS142-M1",
"SARES20-CAMS142-M4",
"SARES20-CAMS142-M5"
]

View File

@@ -10,17 +10,22 @@
"SARFE10-PSSS059"
]
},
"http://sf-daqsync-03.psi.ch:8880": {
"expanding": false,
"instances": [
"SATES21-CAMS154-M1",
"SARES11-SPEC125-M1"
]
},
"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"
]
},

View File

@@ -1,5 +1,5 @@
{
"image_background_enable": false,
"image_background_enable": true,
"image_background": null,
"image_threshold": null,
"image_region_of_interest": null,
@@ -21,5 +21,9 @@
100,
1900,
100
]
],
"processing_threads": 6,
"thread_buffer_size": 30,
"abort_on_error": false,
"no_client_timeout": 0
}

View File

@@ -8,5 +8,7 @@
"pipeline_type": "store",
"camera_name": "SARES11-SPEC125-M1",
"name": "SARES11-SPEC125-M1_psen_ib",
"stream_port": 0
"stream_port": 0,
"port": "9013",
"module":0
}

View File

@@ -11,15 +11,15 @@
"name": "SARES20-CAMS142-M5_psen_db",
"mode": "PUSH",
"roi_signal": [
0,
2049,
350,
500
10,
2190,
400,
200
],
"roi_background": [
0,
2049,
0,
10,
2190,
600,
200
],
"no_client_timeout": 0,

View File

@@ -0,0 +1,14 @@
{
"pipeline_type": "stream",
"name": "SARFE10-PBPS053_proc",
"bsread_address": "",
"bsread_channels": [
"SARFE10-CVME-PHO6212:Lnk9Ch12-DATA-SUM",
"SARFE10-CVME-PHO6212:Lnk9Ch13-DATA-SUM",
"SARFE10-CVME-PHO6212:Lnk9Ch14-DATA-SUM",
"SARFE10-CVME-PHO6212:Lnk9Ch15-DATA-SUM"
],
"mode": "PUB",
"function": "SARFE10-PBPS053_proc.py",
"reload": true
}

View File

@@ -1,6 +1,6 @@
{
"image_background_enable": "passive",
"image_background": "SARFE10-PSSS059:FPICTURE_13075009136_100",
"image_background_enable": true,
"image_background": "SARFE10-PSSS059:FPICTURE_11147675390_10",
"image_threshold": null,
"image_region_of_interest": null,
"image_good_region": null,
@@ -12,5 +12,8 @@
"mode": "PUSH",
"no_client_timeout": 0,
"port": "8889",
"reload": false
"reload": true,
"processing_threads": 6,
"thread_buffer_size": 30,
"abort_on_error": false
}

View File

@@ -1,5 +1,5 @@
{
"image_background_enable": false,
"image_background_enable": true,
"image_background": null,
"image_threshold": null,
"image_region_of_interest": null,
@@ -12,16 +12,18 @@
"mode": "PUSH",
"roi_background": [
300,
2048,
1548,
600,
400
],
"roi_signal": [
300,
2048,
1548,
1150,
400
],
"no_client_timeout": 0,
"port": "9001"
}
"processing_threads": 6,
"thread_buffer_size": 30,
"abort_on_error": false
}

View File

@@ -8,5 +8,7 @@
"pipeline_type": "store",
"camera_name": "SATES21-CAMS154-M1",
"name": "SATES21-CAMS154-M1_psen_ib",
"stream_port": 0
"stream_port": 0,
"port": "9011",
"module":0
}

View File

@@ -3,15 +3,21 @@
"SARES11-SPEC125-M1_psen_ib": "SARES11-SPEC125-M1_psen_ib1",
"SARES11-SPEC125-M2_psen_db": "SARES11-SPEC125-M2_psen_db1",
"SARES11-SPEC125-M2_psen_ib": "SARES11-SPEC125-M2_psen_ib1",
"SARES20-CAMS142-M4_psen_db": "SARES20-CAMS142-M4_psen_db1",
"SARES20-CAMS142-M4_psen_ib": "SARES20-CAMS142-M4_psen_ib1",
"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",
"SARES20-CAMS142-M5_psen_ib": "SARES20-CAMS142-M5_psen_ib1",
"SARES20-PROF141-M1_proc": "SARES20-PROF141-M1_proc1",
"SARES20-PROF142-M1_ib": "SARES20-PROF142-M1_ib1",
"SARES20-PROF142-M1_proc": "SARES20-PROF142-M1_proc1",
"SARES20-PROF146-M1_proc": "SARES20-PROF146-M_proc1",
"SARFE10-PBPS053_proc": "SARFE10-PBPS053_proc1",
"SARFE10-PSSS059_psss": "SARFE10-PSSS059_psss1",
"SARFE10-PSSS059_store": "SARFE10-PSSS059_store1",
"SAROP21-PPRM138_proc": "SAROP21-PPRM138_proc1",
"SATES21-CAMS154-M1_psen_db": "SATES21-CAMS154-M1_psen_db1",
"SATES21-CAMS154-M1_psen_ib": "SATES21-CAMS154-M1_psen_ib1",
"SATES24-CAMS161-M1_psen_db": "SATES24-CAMS161-M1_psen_db1",
"SATES24-CAMS161-M1_psen_ib": "SATES24-CAMS161-M1_psen_ib1"
"SATES24-CAMS161-M1_psen_ib": "SATES24-CAMS161-M1_psen_ib1",
"testdb_ib": "testdb_ib1"
}

View File

@@ -4,6 +4,16 @@
"expanding": true,
"instances": []
},
"http://sf-daqsync-09.psi.ch:8881": {
"cameras": [],
"expanding": true,
"instances": []
},
"http://sf-daqsync-10.psi.ch:8881": {
"cameras": [],
"expanding": true,
"instances": []
},
"http://sf-daqsync-02.psi.ch:8881": {
"cameras": [
"SARFE10-PSSS059"
@@ -15,9 +25,9 @@
]
},
"http://sf-daqsync-03.psi.ch:8881": {
"cameras": [],
"cameras": ["testdb","simulation_2"],
"expanding": false,
"instances": []
"instances": ["testdb_ib:9005", "simulation_2_sp", "SARFE10-PBPS053_proc:9004"]
},
"http://sf-daqsync-04.psi.ch:8881": {
"cameras": ["SATES21-CAMS154-M1", "SATES24-CAMS161-M1"],
@@ -46,15 +56,24 @@
]
},
"http://sf-daqsync-06.psi.ch:8881": {
"cameras": ["SARES20-CAMS142-M4", "SARES20-CAMS142-M5", "Bernina_spectral_encoding", "Bernina_spatial_encoding", "SARES20-PROF142-M1"],
"cameras": ["SARES20-CAMS142-M4", "SARES20-CAMS142-M5", "Bernina_spectral_encoding", "Bernina_spatial_encoding", "SARES20-PROF142-M1", "SARES20-PROF141-M1", "SARES20-PROF146-M1" ,"SAROP21-PPRM138"],
"expanding": false,
"instances": [
"SARES20-CAMS142-M1_psen_ib:9002",
"SARES20-CAMS142-M1_psen_db:9003",
"SARES20-CAMS142-M4_psen_ib:9000",
"SARES20-CAMS142-M4_psen_db:9001",
"SARES20-CAMS142-M5_psen_ib:9010",
"SARES20-CAMS142-M5_psen_db:9011",
"SARES20-PROF142-M1_sp",
"SARES20-PROF142-M1_ib:9005",
"SARES20-PROF142-M1_proc:9017",
"SAROP21-PPRM138_proc:9015",
"SAROP21-PPRM138_sp",
"SARES20-PROF141-M1_sp",
"SARES20-PROF141-M1_proc:9016",
"SARES20-PROF146-M1_sp",
"SARES20-PROF146-M1_proc:9018",
"arrival_time_proc:9008",
"test_arrival"
]

View File

@@ -0,0 +1,101 @@
from logging import getLogger
import epics
from threading import Thread, RLock, Event
from collections import deque
import time
from cam_server.pipeline.data_processing import functions
from cam_server.utils import create_thread_pvs
import numpy as np
_logger = getLogger(__name__)
OUTPUT_CHANNEL_NAME = "SLAAR11-GEN:LAS-XRAY"
PROC_CHANNEL_NAME = "SLAAR11-GEN:LAS-EVR"
SIZE_BUFFER = 5
output_pv = None
buffer = None
buffer_lock = None
initialized = False
processing_thread = None
def initialize(parameters):
global output_pv, buffer, buffer_lock, initialized, processing_thread
epics.ca.clear_cache()
[output_pv] = create_thread_pvs([OUTPUT_CHANNEL_NAME])
output_pv.wait_for_connection()
#If raising this exception then the pipeline won't start
if not output_pv.connected:
raise ("Cannot connect to " + OUTPUT_CHANNEL_NAME)
buffer = deque(maxlen=SIZE_BUFFER)
buffer_lock = RLock()
processing_thread = Thread(target=process_thread_task, args=(buffer, buffer_lock))
processing_thread.start()
initialized = True
#Processing the buffer every second and setting result to EPICS channel
def process_thread_task(buffer, buffer_lock):
_logger.info("Start buffer processing thread")
try:
[proc_pv] = create_thread_pvs([PROC_CHANNEL_NAME])
proc_pv.wait_for_connection()
if not proc_pv.connected:
raise ("Cannot connect to " + PROC_CHANNEL_NAME)
while True:
if proc_pv.connected:
b = None
with buffer_lock:
if (len(buffer) >= SIZE_BUFFER):
b= buffer.copy()
if b is not None:
calc = sum(b)/len(b)
proc_pv.put(calc)
time.sleep(1.0)
except Exception as e:
_logger.error("Error on buffer processing thread %s" % (str(e)))
finally:
_logger.info("Exit buffer processing thread")
def process(data, pulse_id, timestamp, parameters):
global output_pv, buffer, buffer_lock, initialized, processing_thread
#Initialize on first run
if not initialized:
initialize(parameters)
#Read stream inputs
ch12 = data["SARFE10-CVME-PHO6212:Lnk9Ch12-DATA-SUM"]
ch13 = data["SARFE10-CVME-PHO6212:Lnk9Ch13-DATA-SUM"]
ch14 = data["SARFE10-CVME-PHO6212:Lnk9Ch14-DATA-SUM"]
ch15 = data["SARFE10-CVME-PHO6212:Lnk9Ch15-DATA-SUM"]
#Calculations
try:
sum = ch12 + ch13 + ch14 + ch15
except:
sum = float("nan")
#Handle thread buffer
with buffer_lock:
buffer.append(sum)
#Update EPICS channels
if output_pv and output_pv.connected:
last = float(output_pv.value)
output_pv.put(sum)
else:
last = float('nan')
#Set outputs
data["sum"] = sum
data["last"] = last
data["alive"] = 1 if processing_thread.is_alive() else 0
return data

View File

@@ -0,0 +1,13 @@
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"]
prefix = parameters["camera_name"]
for c in channels:
ret[prefix+":"+c] = r[c]
return ret

View File

@@ -16,9 +16,18 @@ def get_roi_x_profile(image, roi):
return roi_image.sum(0)
#_logger.warning("----- START ---- ")
#pid = None
#sent=None
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, image_background_array=None):
#global pid, sent
#if pid is not None:
# if pid != sent:
# _logger.warning("ERROR sending %s PID: %d" % (parameters["camera_name"], pid,))
# if (pid+1) != pulse_id:
# _logger.warning("ERROR %s PID: waiting %d - received %d" % (parameters["camera_name"], pid+1,pulse_id))
#pid = pulse_id
processed_data = dict()
image_property_name = parameters["camera_name"]
@@ -34,6 +43,6 @@ def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, image_
if roi_background:
processed_data[image_property_name + ".roi_background_x_profile"] = get_roi_x_profile(image, roi_background)
#sent = pid
return processed_data

View File

@@ -1,7 +1,8 @@
from logging import getLogger
from cam_server.pipeline.data_processing import functions
from cam_server.pipeline.data_processing.functions import chunk_copy
from cam_server.utils import create_thread_pvs, epics_lock
import json
@@ -9,28 +10,29 @@ import numpy
import scipy.signal
import scipy.optimize
import numba
numba.set_num_threads(4)
import epics
numba.set_num_threads(4)
_logger = getLogger(__name__)
output_pv, center_pv, fwhm_pv, ymin_pv, ymax_pv, axis_pv = None, None, None, None, None, None
channel_names = None
output_pv, center_pv, fwhm_pv, ymin_pv, ymax_pv, axis_pv = None, None, None, None, None, None
roi = [0, 0]
initialized = False
sent_pid = -1
@numba.njit(parallel=True)
def get_spectrum (image, background):
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]
v = image[i, j]
b = background[i, j]
if v > b:
v -= b
else:
@@ -41,9 +43,7 @@ def get_spectrum (image, background):
def initialize(parameters):
global ymin_pv, ymax_pv, axis_pv, output_pv, center_pv, fwhm_pv
global channel_names
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"
@@ -51,30 +51,18 @@ def initialize(parameters):
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()
channel_names = [output_pv_name, center_pv_name, fwhm_pv_name, ymin_pv_name, ymax_pv_name, axis_pv_name]
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
global roi, initialized, sent_pid
global channel_names
if not initialized:
initialize(parameters)
initialized = True
[output_pv, center_pv, fwhm_pv, ymin_pv, ymax_pv, axis_pv] = create_thread_pvs(channel_names)
processed_data = dict()
epics_pv_name_prefix = parameters["camera_name"]
if ymin_pv and ymin_pv.connected:
@@ -100,13 +88,12 @@ def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata
processing_image = image
nrows, ncols = processing_image.shape
# validate background data
# validate background data if passive mode (background subtraction handled here)
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:
_logger.info("Invalid background shape: %s instead of %s" % (str(background_image.shape), str(processing_image.shape)))
_logger.info("Invalid background shape: %s instead of %s" % (
str(background_image.shape), str(processing_image.shape)))
background_image = None
else:
background_image = None
@@ -126,7 +113,7 @@ def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata
if background_image is not None:
spectrum = get_spectrum(processing_image, background_image)
else:
spectrum = processing_image.sum(0, 'uint32')
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)
@@ -140,23 +127,28 @@ def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata
skip = False
# gaussian fitting
offset, amplitude, center, sigma = functions.gauss_fit_psss(smoothed_spectrum[::2], axis[::2],
offset=minimum, amplitude=amplitude, skip=skip)
offset=minimum, amplitude=amplitude, skip=skip, maxfev=20)
# 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
processed_data[epics_pv_name_prefix + ":SPECTRUM_CENTER"] = numpy.float64(center)
processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"] = numpy.float64(2.355 * sigma)
if epics_lock.acquire(False):
try:
if pulse_id > sent_pid:
sent_pid = pulse_id
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 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 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"])
if fwhm_pv and fwhm_pv.connected:
fwhm_pv.put(processed_data[epics_pv_name_prefix + ":SPECTRUM_FWHM"])
finally:
epics_lock.release()
return processed_data