Add late averaging for Furka
This commit is contained in:
@@ -1,21 +1,26 @@
|
||||
{
|
||||
"name": "SARCL02-DSCR280",
|
||||
"camera_calibration": {
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 8.0,
|
||||
"reference_marker_height": 6000.0,
|
||||
"reference_marker": [
|
||||
107,
|
||||
211,
|
||||
1938,
|
||||
900
|
||||
],
|
||||
"reference_marker_width": 16000.0
|
||||
},
|
||||
"source": "SARCL02-DSCR280",
|
||||
"mirror_y": false,
|
||||
"rotate": 1,
|
||||
"mirror_x": false,
|
||||
"group": ["Electrons"],
|
||||
"alias": []
|
||||
}
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
13,
|
||||
534,
|
||||
1849,
|
||||
1229
|
||||
],
|
||||
"reference_marker_width": 16000.0,
|
||||
"reference_marker_height": 6000.0,
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 8.0
|
||||
},
|
||||
"mirror_x": false,
|
||||
"mirror_y": false,
|
||||
"rotate": 1,
|
||||
"roi": null,
|
||||
"image_background": null,
|
||||
"source_type": "epics",
|
||||
"name": "SARCL02-DSCR280",
|
||||
"source": "SARCL02-DSCR280",
|
||||
"group": [
|
||||
"Electrons"
|
||||
],
|
||||
"alias": []
|
||||
}
|
||||
22
configuration/camera_config/SARES11-XPR125-C4P3.json
Normal file
22
configuration/camera_config/SARES11-XPR125-C4P3.json
Normal file
@@ -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,
|
||||
"roi": null,
|
||||
"image_background": null,
|
||||
"source_type": "epics",
|
||||
"name": "SARES11-XPR125-C4P3",
|
||||
"source": "SARES11-XPR125-C4P3"
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
1159,
|
||||
940,
|
||||
1706,
|
||||
981
|
||||
1412,
|
||||
1469,
|
||||
1513,
|
||||
1569
|
||||
],
|
||||
"reference_marker_width": 200.0,
|
||||
"reference_marker_height": 15.2,
|
||||
"reference_marker_width": 23.5,
|
||||
"reference_marker_height": 21.2,
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 0.0
|
||||
},
|
||||
"mirror_x": false,
|
||||
"mirror_x": true,
|
||||
"mirror_y": false,
|
||||
"rotate": 0,
|
||||
"rotate": 1,
|
||||
"roi": null,
|
||||
"image_background": null,
|
||||
"source_type": "bsread",
|
||||
@@ -21,7 +21,7 @@
|
||||
"name": "SARES20-CAMS142-C1",
|
||||
"source": "SARES20-CAMS142-C1",
|
||||
"alias": [
|
||||
"SAMPLECAM"
|
||||
"SAMPLECAM_FRONT (SARES20-CAMS142-C1)"
|
||||
],
|
||||
"group": [
|
||||
"Photonics",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
567,
|
||||
460,
|
||||
570,
|
||||
464
|
||||
1076,
|
||||
851,
|
||||
1133,
|
||||
893
|
||||
],
|
||||
"reference_marker_width": 73.0,
|
||||
"reference_marker_height": 96.0,
|
||||
"reference_marker_height": 54.0,
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 0.0
|
||||
},
|
||||
@@ -25,6 +25,6 @@
|
||||
"Bernina"
|
||||
],
|
||||
"alias": [
|
||||
"SAMPLECAM_SIDEVIEW_45DEG_THC (SARES20-CAMS142-C2)"
|
||||
"SAMPLECAM_BACK_RACKS (SARES20-CAMS142-C2)"
|
||||
]
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
"name": "SARES20-CAMS142-C3",
|
||||
"source": "SARES20-CAMS142-C3",
|
||||
"alias": [
|
||||
"SAMPLECAM_SIDEVIEW (SARES20-CAMS142-C3)"
|
||||
"SAMPLECAM_BACK_DOOR (SARES20-CAMS142-C3)"
|
||||
],
|
||||
"group": [
|
||||
"Photonics",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
1209,
|
||||
892,
|
||||
1328,
|
||||
1050
|
||||
943,
|
||||
1072,
|
||||
1027,
|
||||
1192
|
||||
],
|
||||
"reference_marker_width": 231.0,
|
||||
"reference_marker_height": 307.0,
|
||||
"reference_marker_width": 163.0,
|
||||
"reference_marker_height": 233.0,
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 0.0
|
||||
},
|
||||
|
||||
@@ -41,5 +41,6 @@
|
||||
2190,
|
||||
800,
|
||||
150
|
||||
]
|
||||
],
|
||||
"debug": true
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
81,
|
||||
48,
|
||||
231,
|
||||
200
|
||||
204,
|
||||
108,
|
||||
349,
|
||||
934
|
||||
],
|
||||
"reference_marker_width": 5000.0,
|
||||
"reference_marker_height": 5000.0,
|
||||
"reference_marker_height": 2000.0,
|
||||
"angle_horizontal": 0.0,
|
||||
"angle_vertical": 0.0
|
||||
},
|
||||
@@ -16,8 +16,8 @@
|
||||
"rotate": 0,
|
||||
"roi": null,
|
||||
"image_background": null,
|
||||
"forwarder_port": 9003,
|
||||
"source_type": "bsread",
|
||||
"forwarder_port": 9003,
|
||||
"source": "SATES30-CAMS182-GIGE1",
|
||||
"name": "SATES30-CAMS182-GIGE1",
|
||||
"prefix": "SATES30-CAMS182-GIGE1",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"camera_calibration": {
|
||||
"reference_marker": [
|
||||
396,
|
||||
30,
|
||||
1579,
|
||||
1218
|
||||
265,
|
||||
72,
|
||||
1253,
|
||||
1066
|
||||
],
|
||||
"reference_marker_width": 5000.0,
|
||||
"reference_marker_height": 5000.0,
|
||||
|
||||
@@ -13,5 +13,8 @@
|
||||
"Photonics",
|
||||
"Furka"
|
||||
],
|
||||
"alias": []
|
||||
"debug": true,
|
||||
"alias": [],
|
||||
"forwarder_port": 9007,
|
||||
"check_timestamp": true
|
||||
}
|
||||
24
configuration/camera_config/SLAAR11-LCAM-C431.json
Normal file
24
configuration/camera_config/SLAAR11-LCAM-C431.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"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": "SLAAR11-LCAM-C431",
|
||||
"name": "SLAAR11-LCAM-C431",
|
||||
"group": [
|
||||
"Laser"
|
||||
],
|
||||
"alias": []
|
||||
}
|
||||
16
configuration/camera_config/SLAAR21-LCAM-CT1C1.json
Normal file
16
configuration/camera_config/SLAAR21-LCAM-CT1C1.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"camera_calibration": null,
|
||||
"mirror_x": false,
|
||||
"mirror_y": false,
|
||||
"rotate": 0,
|
||||
"source_type": "bsread",
|
||||
"name": "SLAAR21-LCAM-CT1C1",
|
||||
"protocol": "tcp",
|
||||
"source": "SLAAR21-LCAM-CT1C1",
|
||||
"_debug": true,
|
||||
"group": [
|
||||
"Laser",
|
||||
"Bernina"
|
||||
],
|
||||
"_forwarder_port": 9030
|
||||
}
|
||||
16
configuration/camera_config/SLAAR21-LCAM-CT1C2.json
Normal file
16
configuration/camera_config/SLAAR21-LCAM-CT1C2.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"camera_calibration": null,
|
||||
"mirror_x": false,
|
||||
"mirror_y": false,
|
||||
"rotate": 0,
|
||||
"source_type": "bsread",
|
||||
"name": "SLAAR21-LCAM-CT1C2",
|
||||
"protocol": "tcp",
|
||||
"source": "SLAAR21-LCAM-CT1C2",
|
||||
"_debug": true,
|
||||
"group": [
|
||||
"Laser",
|
||||
"Bernina"
|
||||
],
|
||||
"_forwarder_port": 9032
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
"SARES11-SPEC125-M1": "SARES11-SPEC125-M1",
|
||||
"SARES11-SPEC125-M2": "SARES11-SPEC125-M2",
|
||||
"SARES20-CAMS142-M1": "SARES20-CAMS142-M1",
|
||||
"SARES20-CAMS142-M2": "SARES20-CAMS142-M2",
|
||||
"SARES20-CAMS142-M5": "SARES20-CAMS142-M5",
|
||||
"SARES30-CAMS156-XE": "SARES30-CAMS156-XE",
|
||||
"SARFE10-PPRM064": "SARFE10-PPRM064",
|
||||
@@ -19,6 +20,7 @@
|
||||
"SATES24-CAMS161-M1": "SATES24-CAMS161-M1",
|
||||
"SATES30-CAMS182-GIGE1": "SATES30-CAMS182-GIGE1",
|
||||
"SATES30-CAMS182-GIGE2": "SATES30-CAMS182-GIGE2",
|
||||
"SATES30-RIXS-CAM01": "SATES30-RIXS-CAM01",
|
||||
"SATES31-CAMS187-RIXS1": "SATES31-CAMS187-RIXS1",
|
||||
"SATOP21-PMOS127-2D": "SATOP21-PMOS127-2D",
|
||||
"SATOP31-PMOS132-2D": "SATOP31-PMOS132-2D",
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
"expanding": false,
|
||||
"instances": [
|
||||
"SARES20-CAMS142-M1",
|
||||
"SARES20-CAMS142-M2",
|
||||
"SARES20-CAMS142-M4",
|
||||
"SARES20-CAMS142-M5",
|
||||
"SARES20-PROF141-M1",
|
||||
@@ -85,7 +86,10 @@
|
||||
"SARES20-PROF146-M1",
|
||||
"SLAAR02-LPMO01-C321",
|
||||
"SLAAR02-LPMO02-C322",
|
||||
"SAROP21-PPRM133"
|
||||
"SAROP21-PPRM133",
|
||||
"SLAAR21-LCAM-CS842",
|
||||
"SLAAR21-LCAM-CT1C1",
|
||||
"SLAAR21-LCAM-CT1C2"
|
||||
]
|
||||
},
|
||||
"http://sf-daqsync-15.psi.ch:8880": {
|
||||
@@ -94,7 +98,8 @@
|
||||
"instances": [
|
||||
"SATES31-CAMS187-RIXS1",
|
||||
"SATES30-CAMS182-GIGE1",
|
||||
"SATES30-CAMS182-GIGE2"
|
||||
"SATES30-CAMS182-GIGE2",
|
||||
"SATES30-RIXS-CAM01"
|
||||
]
|
||||
},
|
||||
"http://sf-daqsync-16.psi.ch:8880": {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"image_background_enable": "passive",
|
||||
"image_background": "SARES11-SPEC125-M1_20230507_163124_994260",
|
||||
"image_background": "SARES11-SPEC125-M1_20230528_190225_021209",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"function": "SARES11-SPEC125-M1_tt.py",
|
||||
"function": "SARES11-SPEC125-M1_2tt.py",
|
||||
"camera_name": "SARES11-SPEC125-M1",
|
||||
"name": "SARES11-SPEC125-M1_psen_db",
|
||||
"mode": "PUSH",
|
||||
@@ -14,7 +14,13 @@
|
||||
0,
|
||||
2048,
|
||||
50,
|
||||
300
|
||||
200
|
||||
],
|
||||
"roi_signal2": [
|
||||
0,
|
||||
2048,
|
||||
250,
|
||||
400
|
||||
],
|
||||
"no_client_timeout": 0,
|
||||
"port": "9013",
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "myscreen",
|
||||
"name": "myscreen_sp"
|
||||
"camera_name": "SARES11-XPR125-C4P3",
|
||||
"name": "SARES11-XPR125-C4P3_sp"
|
||||
}
|
||||
@@ -19,12 +19,12 @@
|
||||
"down": "SAROP11-CVME-PBPS2:Lnk9Ch11-DATA-SUM",
|
||||
"right": "SAROP11-CVME-PBPS2:Lnk9Ch14-DATA-SUM",
|
||||
"left": "SAROP11-CVME-PBPS2:Lnk9Ch15-DATA-SUM",
|
||||
"up_calib": 5.487581379365339,
|
||||
"down_calib": 6.5694290116170215,
|
||||
"left_calib": 4.714773884372932,
|
||||
"right_calib": 4.9736472409598855,
|
||||
"horiz_calib": -4.131288944529578,
|
||||
"vert_calib": 4.049881575553348,
|
||||
"up_calib": 0.5765547724194534,
|
||||
"down_calib": 0.629603239864361,
|
||||
"left_calib": 0.6530107029826532,
|
||||
"right_calib": 0.6941451598287135,
|
||||
"horiz_calib": -5.1719577228641995,
|
||||
"vert_calib": 6.389710225223535,
|
||||
"uJ_calib": 605.4608924473305,
|
||||
"threshold": 0,
|
||||
"queue_length": 5000,
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
"down": "SAROP11-CVME-PBPS1:Lnk9Ch5-DATA-SUM",
|
||||
"right": "SAROP11-CVME-PBPS1:Lnk9Ch3-DATA-SUM",
|
||||
"left": "SAROP11-CVME-PBPS1:Lnk9Ch7-DATA-SUM",
|
||||
"up_calib": 0.4329961889591279,
|
||||
"down_calib": 0.2756326807724613,
|
||||
"left_calib": 0.1406206505323777,
|
||||
"right_calib": 0.15756942651115974,
|
||||
"horiz_calib": -4.876669457859753,
|
||||
"vert_calib": 4.488795635241031,
|
||||
"up_calib": 1.3170784909053646,
|
||||
"down_calib": 0.7802132837143382,
|
||||
"left_calib": 0.7509033641005436,
|
||||
"right_calib": 0.821373380836796,
|
||||
"horiz_calib": -4.1710745052592735,
|
||||
"vert_calib": 4.844916769802791,
|
||||
"uJ_calib": 605.9512700123181,
|
||||
"threshold": 0,
|
||||
"queue_length": 1000,
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
"down": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD2",
|
||||
"right": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD3",
|
||||
"left": "SAROP31-PBPS113:Lnk9Ch0-PP_VAL_PD0",
|
||||
"up_calib": 6.840257443212456e-06,
|
||||
"down_calib": 6.1653460988550605e-06,
|
||||
"left_calib": 1.6201787692292536e-05,
|
||||
"right_calib": 1.584162631910054e-05,
|
||||
"horiz_calib": -3.733833274072839,
|
||||
"vert_calib": -5.937107209807579,
|
||||
"up_calib": 1.6116935198445244e-05,
|
||||
"down_calib": 1.7494281469273323e-05,
|
||||
"left_calib": 4.3270966600698636e-05,
|
||||
"right_calib": 3.879033729594731e-05,
|
||||
"horiz_calib": -4.034562196356022,
|
||||
"vert_calib": -6.839696258843613,
|
||||
"uJ_calib": 941.943984588351,
|
||||
"threshold": 0,
|
||||
"queue_length": 5000,
|
||||
@@ -60,14 +60,14 @@
|
||||
0.3
|
||||
],
|
||||
"calib_x_norm": [
|
||||
0.07671441650364863,
|
||||
-0.0010584166106423775,
|
||||
-0.08397835040865761
|
||||
0.07449821626464098,
|
||||
0.0005958932347863629,
|
||||
-0.07421680429989863
|
||||
],
|
||||
"calib_x_norm_std": [
|
||||
0.24206983712709104,
|
||||
0.2517192221440592,
|
||||
0.2520562331441098
|
||||
0.04855156593259901,
|
||||
0.051051286192765735,
|
||||
0.05876136938532417
|
||||
],
|
||||
"calib_y_range": [
|
||||
-0.3,
|
||||
@@ -75,14 +75,14 @@
|
||||
0.3
|
||||
],
|
||||
"calib_y_norm": [
|
||||
0.0484748027920197,
|
||||
-0.00020584146521665983,
|
||||
-0.05258451427890211
|
||||
0.04395861917928205,
|
||||
0.00014199002803831937,
|
||||
-0.04376457455526574
|
||||
],
|
||||
"calib_y_norm_std": [
|
||||
0.27576174925738167,
|
||||
0.2568940077045247,
|
||||
0.25090631714920764
|
||||
0.053443256985745716,
|
||||
0.04917184029140196,
|
||||
0.056349840562236894
|
||||
],
|
||||
"calib_datetime": "2023-03-13 01:48:04"
|
||||
"calib_datetime": "2023-05-30 08:51:22"
|
||||
}
|
||||
@@ -17,12 +17,12 @@
|
||||
"down": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD2",
|
||||
"right": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD3",
|
||||
"left": "SAROP31-PBPS149:Lnk9Ch0-PP_VAL_PD0",
|
||||
"up_calib": 1.508662346943942e-06,
|
||||
"down_calib": 1.612838087958512e-06,
|
||||
"left_calib": 8.288800811575718e-07,
|
||||
"right_calib": 8.588190343731463e-07,
|
||||
"horiz_calib": -4.612748469769838,
|
||||
"vert_calib": -4.2123940480695445,
|
||||
"up_calib": 2.2755419526287142e-06,
|
||||
"down_calib": 2.4702806952286848e-06,
|
||||
"left_calib": 1.2467389547855256e-06,
|
||||
"right_calib": 1.2850241689915753e-06,
|
||||
"horiz_calib": -4.6898874532309005,
|
||||
"vert_calib": -4.191461530174274,
|
||||
"uJ_calib": 605.9512700123181,
|
||||
"threshold": 0.0,
|
||||
"queue_length": 5000,
|
||||
@@ -61,14 +61,14 @@
|
||||
0.3
|
||||
],
|
||||
"calib_x_norm": [
|
||||
0.06510022968417475,
|
||||
-0.00020972107922603213,
|
||||
-0.06497406418469041
|
||||
0.06411399525764434,
|
||||
0.0001758428549206672,
|
||||
-0.06382084454040991
|
||||
],
|
||||
"calib_x_norm_std": [
|
||||
0.027264758010278046,
|
||||
0.030226724851444217,
|
||||
0.027674513899714915
|
||||
0.027336294963008215,
|
||||
0.027818148361284857,
|
||||
0.02853702836194553
|
||||
],
|
||||
"calib_y_range": [
|
||||
-0.3,
|
||||
@@ -76,14 +76,14 @@
|
||||
0.3
|
||||
],
|
||||
"calib_y_norm": [
|
||||
0.06945988844641009,
|
||||
-0.0007141178504136682,
|
||||
-0.07297692851637332
|
||||
0.0693417671672449,
|
||||
-4.741442975529518e-05,
|
||||
-0.0738063914596704
|
||||
],
|
||||
"calib_y_norm_std": [
|
||||
0.02898536535723783,
|
||||
0.02802813913376357,
|
||||
0.027555030271288982
|
||||
0.028123280441208747,
|
||||
0.029229162548315823,
|
||||
0.031015460819767877
|
||||
],
|
||||
"calib_datetime": "2023-04-29 12:57:42"
|
||||
"calib_datetime": "2023-05-30 09:54:10"
|
||||
}
|
||||
@@ -3,15 +3,12 @@
|
||||
"image_background": "SATBD02-DSCR050_20221013_123827_350915",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": [
|
||||
175,
|
||||
1602,
|
||||
389,
|
||||
1464
|
||||
28,
|
||||
1092,
|
||||
6,
|
||||
1007
|
||||
],
|
||||
"image_good_region": {
|
||||
"threshold": 0.1,
|
||||
"gfscale": 10.0
|
||||
},
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "SATBD02-DSCR050",
|
||||
@@ -20,7 +17,10 @@
|
||||
"no_client_timeout": 0,
|
||||
"port": "9020",
|
||||
"Marker": [
|
||||
1280,
|
||||
1080
|
||||
]
|
||||
364,
|
||||
676
|
||||
],
|
||||
"reload": true,
|
||||
"function": "beam_full_width",
|
||||
"fw_threshold": 0.1
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"image_background_enable": "passive",
|
||||
"image_background": "SATES21-CAMS-PATT1_20230504_151024_448849",
|
||||
"image_background": "SATES21-CAMS-PATT1_20230531_133321_260634",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
@@ -17,17 +17,17 @@
|
||||
"project_axis": 0,
|
||||
"no_client_timeout": 0,
|
||||
"port": "9003",
|
||||
"threshold": 1,
|
||||
"threshold": 5,
|
||||
"roi_background": [
|
||||
22,
|
||||
1036,
|
||||
3,
|
||||
2519
|
||||
103,
|
||||
1153,
|
||||
72,
|
||||
1147
|
||||
],
|
||||
"roi_signal": [
|
||||
22,
|
||||
1036,
|
||||
3,
|
||||
2519
|
||||
103,
|
||||
1153,
|
||||
72,
|
||||
1147
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"image_background_enable": "passive",
|
||||
"image_background": "SATES21-CAMS154-M1_20230502_141426_180792",
|
||||
"image_background": "SATES21-CAMS154-M1_20230530_152447_004964",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
@@ -14,10 +14,29 @@
|
||||
"thread_buffer_size": 30,
|
||||
"project_axis": 0,
|
||||
"roi_signal": [
|
||||
20,
|
||||
200,
|
||||
500,
|
||||
1650
|
||||
7,
|
||||
895,
|
||||
0,
|
||||
2523
|
||||
],
|
||||
"threshold": 5
|
||||
"threshold": 5,
|
||||
"roi_background": [
|
||||
"(",
|
||||
"7",
|
||||
",",
|
||||
" ",
|
||||
"8",
|
||||
"9",
|
||||
"5",
|
||||
",",
|
||||
" ",
|
||||
"0",
|
||||
",",
|
||||
" ",
|
||||
"2",
|
||||
"5",
|
||||
"2",
|
||||
"3",
|
||||
")"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"image_background_enable": "passive",
|
||||
"image_background": "SATES24-CAMS161-M1_20230504_140735_343566",
|
||||
"image_background": "SATES24-CAMS161-M1_20230531_144316_923916",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
@@ -11,19 +11,19 @@
|
||||
"name": "SATES24-CAMS161-M1_spec_db",
|
||||
"mode": "PUSH",
|
||||
"roi_signal": [
|
||||
0,
|
||||
694,
|
||||
0,
|
||||
2317
|
||||
11,
|
||||
782,
|
||||
15,
|
||||
2540
|
||||
],
|
||||
"processing_threads": 4,
|
||||
"thread_buffer_size": 30,
|
||||
"project_axis": 0,
|
||||
"threshold": 0,
|
||||
"threshold": 5,
|
||||
"roi_background": [
|
||||
0,
|
||||
694,
|
||||
0,
|
||||
2317
|
||||
11,
|
||||
782,
|
||||
15,
|
||||
2540
|
||||
]
|
||||
}
|
||||
17
configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json
Normal file
17
configuration/pipeline_config/SATES30-RIXS-CAM01_proc.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"image_background_enable": true,
|
||||
"image_background": "SATES30-RIXS-CAM01_20230601_093318_381947",
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "SATES30-RIXS-CAM01",
|
||||
"name": "SATES30-RIXS-CAM01_proc",
|
||||
"function": "single_photon.c",
|
||||
"mode": "PUSH",
|
||||
"block": false,
|
||||
"threshold": 10.0,
|
||||
"_max_frame_rate": 5.1,
|
||||
"reload": true
|
||||
}
|
||||
@@ -7,5 +7,8 @@
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "SATES30-RIXS-CAM01",
|
||||
"name": "SATES30-RIXS-CAM01_sp"
|
||||
"name": "SATES30-RIXS-CAM01_sp",
|
||||
"max_frame_rate": 10.1,
|
||||
"late_averaging": 10,
|
||||
"function": "late_averaging.py"
|
||||
}
|
||||
@@ -8,5 +8,6 @@
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "SATES31-CAMS187-RIXS1",
|
||||
"name": "SATES31-CAMS187-RIXS1_sp",
|
||||
"max_frame_rate": 5.1
|
||||
"max_frame_rate": 5.1,
|
||||
"reload": true
|
||||
}
|
||||
21
configuration/pipeline_config/SATMA02_calib.json
Normal file
21
configuration/pipeline_config/SATMA02_calib.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"pipeline_type": "stream",
|
||||
"abort_on_timeout": false,
|
||||
"_stream_timeout": 20,
|
||||
"name": "SATMA02_calib",
|
||||
"input_pipeline": "S10BD01-DSCR030_sp1",
|
||||
"_input_pipeline": "SATBD02-DSCR050_sp1",
|
||||
"bsread_address2": "",
|
||||
"bsread_channels2": [
|
||||
"SATMA02-RLLE-DSP:PHASE-VS",
|
||||
"SATBD02-DBPM040:X2"
|
||||
],
|
||||
"include": [
|
||||
"x_center_of_mass",
|
||||
"SATMA02-RLLE-DSP:PHASE-VS",
|
||||
"SATBD02-DBPM040:X2"
|
||||
],
|
||||
"mode": "PUSH",
|
||||
"block": false,
|
||||
"function": "propagate_stream"
|
||||
}
|
||||
@@ -11,5 +11,6 @@
|
||||
"function": "pprm_simple.py",
|
||||
"mode": "PUSH",
|
||||
"debug": true,
|
||||
"no_client_timeout": 0
|
||||
"no_client_timeout": 0,
|
||||
"reload": true
|
||||
}
|
||||
12
configuration/pipeline_config/SLAAR11-LCAM-C431_sp.json
Normal file
12
configuration/pipeline_config/SLAAR11-LCAM-C431_sp.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"image_background_enable": false,
|
||||
"image_background": null,
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "SLAAR11-LCAM-C431",
|
||||
"name": "SLAAR11-LCAM-C431_sp",
|
||||
"max_frame_rate": 10.1
|
||||
}
|
||||
14
configuration/pipeline_config/SLAAR21-LCAM-CT1C1_proc.json
Normal file
14
configuration/pipeline_config/SLAAR21-LCAM-CT1C1_proc.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"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": "SLAAR21-LCAM-CT1C1",
|
||||
"name": "SLAAR21-LCAM-CT1C1_proc",
|
||||
"function": "pprm_simple.py",
|
||||
"mode": "PUSH",
|
||||
"no_client_timeout": 0
|
||||
}
|
||||
@@ -6,6 +6,6 @@
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "camera_name",
|
||||
"name": "camera_name_sp"
|
||||
"camera_name": "SLAAR21-LCAM-CT1C1",
|
||||
"name": "SLAAR21-LCAM-CT1C1_sp"
|
||||
}
|
||||
14
configuration/pipeline_config/SLAAR21-LCAM-CT1C2_proc.json
Normal file
14
configuration/pipeline_config/SLAAR21-LCAM-CT1C2_proc.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"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": "SLAAR21-LCAM-CT1C2",
|
||||
"name": "SLAAR21-LCAM-CT1C2_proc",
|
||||
"function": "pprm_simple.py",
|
||||
"mode": "PUSH",
|
||||
"no_client_timeout": 0
|
||||
}
|
||||
@@ -6,6 +6,6 @@
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "new_camera_name",
|
||||
"name": "new_camera_name_sp"
|
||||
"camera_name": "SLAAR21-LCAM-CT1C2",
|
||||
"name": "SLAAR21-LCAM-CT1C2_sp"
|
||||
}
|
||||
@@ -6,6 +6,6 @@
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "name:",
|
||||
"name": "name:_sp"
|
||||
"camera_name": "",
|
||||
"name": "_sp"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"image_background_enable": false,
|
||||
"image_background": null,
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"camera_name": "example",
|
||||
"name": "example_sp"
|
||||
}
|
||||
@@ -8,13 +8,15 @@
|
||||
"#SAROP11-ATT01_proc": "SAROP11-ATT01_proc",
|
||||
"#SAROP21-PPRM102_proc": "SAROP21-PPRM102_proc",
|
||||
"#SAROP31-PPRM113_proc": "SAROP31-PPRM113_proc",
|
||||
"#SATES30-RIXS-CAM01_sp1": "SATES30-RIXS-CAM01_sp",
|
||||
"#SATES31-CAMS187-RIXS1_sp1": "SATES31-CAMS187-RIXS1_sp",
|
||||
"#SATMA02_calib": "SATMA02_calib",
|
||||
"#SINBC02-DSRM310_profiles": "SINBC02-DSRM310_profiles",
|
||||
"#jungfrau_proc": "jungfrau_proc",
|
||||
"#test_merge": "test_merge",
|
||||
"#test_proc_with_bs": "test_proc_with_bs",
|
||||
"#test_str": "test_str",
|
||||
"#test_stream": "test_stream",
|
||||
"#test_tadej": "test_tadej",
|
||||
"#testdb_ib": "testdb_ib",
|
||||
"S10BD01-DSCR030_profiles": "S10BD01-DSCR030_profiles",
|
||||
"SARCL01-DSCR170_profiles": "SARCL01-DSCR170_profiles",
|
||||
@@ -48,6 +50,7 @@
|
||||
"SATES24-CAMS161-M1_spec_db": "SATES24-CAMS161-M1_spec_db",
|
||||
"SATES30-CAMS182-GIGE1_profiles": "SATES30-CAMS182-GIGE1_profiles",
|
||||
"SATES30-CAMS182-GIGE2_profiles": "SATES30-CAMS182-GIGE2_profiles",
|
||||
"SATES30-RIXS-CAM01_proc": "SATES30-RIXS-CAM01_proc",
|
||||
"SATES31-CAMS187-RIXS1_proc": "SATES31-CAMS187-RIXS1_proc",
|
||||
"SATOP21-PMOS127-2D_pmos": "SATOP21-PMOS127-2D_pmos",
|
||||
"SATOP31-PMOS132-2D_pmos": "SATOP31-PMOS132-2D_pmos",
|
||||
@@ -60,5 +63,9 @@
|
||||
"SLAAR21-LCAM-CS842_proc": "SLAAR21-LCAM-CS842_proc",
|
||||
"SLAAR21-LCAM-CS843_proc": "SLAAR21-LCAM-CS843_proc",
|
||||
"SLAAR21-LCAM-CS844_proc": "SLAAR21-LCAM-CS844_proc",
|
||||
"test_furka": "test_furka"
|
||||
"SLAAR21-LCAM-CT1C1_proc": "SLAAR21-LCAM-CT1C1_proc",
|
||||
"SLAAR21-LCAM-CT1C2_proc": "SLAAR21-LCAM-CT1C2_proc",
|
||||
"simulation_sp1": "simulation_sp",
|
||||
"test_furka": "test_furka",
|
||||
"test_tadej": "test_tadej"
|
||||
}
|
||||
@@ -63,6 +63,7 @@
|
||||
"simulation_2_sp",
|
||||
"simulation2_sp",
|
||||
"test_alain_100Hz:9010",
|
||||
"SATMA02_calib",
|
||||
"test_str:9000",
|
||||
"simulation_proc",
|
||||
"test_merge:9001",
|
||||
@@ -170,7 +171,8 @@
|
||||
"#SARES12-CAMS128-M1_psen_ib:9002",
|
||||
"#SARES12-CAMS128-M1_psen_db:9003",
|
||||
"SARES12-XPR128-C4F1_ib:9004",
|
||||
"SARES11-XMI125-C4P1_ib:9005"
|
||||
"SARES11-XMI125-C4P1_ib:9005",
|
||||
"SARES11-XMI125-C4P1_db:9011"
|
||||
]
|
||||
},
|
||||
"http://sf-daqsync-14.psi.ch:8881": {
|
||||
@@ -192,7 +194,9 @@
|
||||
"SLAAR21-LCAM-CS843",
|
||||
"SLAAR21-LCAM-CS844",
|
||||
"SLAAR02-LPMO02-C321",
|
||||
"SLAAR02-LPMO02-C322"
|
||||
"SLAAR02-LPMO02-C322",
|
||||
"SLAAR21-LCAM-CT1C1",
|
||||
"SLAAR21-LCAM-CT1C2"
|
||||
],
|
||||
"enabled": true,
|
||||
"expanding": false,
|
||||
@@ -228,6 +232,8 @@
|
||||
"SLAAR02-LPMO02-C322_proc:9026",
|
||||
"SLAAR21-LCAM-C561_proc:9027",
|
||||
"SLAAR21-LCAM-C562_proc:9028",
|
||||
"SLAAR21-LCAM-CT1C1_proc:9033",
|
||||
"SLAAR21-LCAM-CT1C2_proc:9035",
|
||||
"#arrival_time_proc:9008",
|
||||
"test_arrival"
|
||||
]
|
||||
@@ -246,6 +252,7 @@
|
||||
"SATES31-CAMS187-RIXS1_proc:9000",
|
||||
"SATES31-CAMS187-RIXS1_ib:9001",
|
||||
"SATES30-RIXS-CAM01_sp",
|
||||
"SATES30-RIXS-CAM01_proc:9006",
|
||||
"SATES30-CAMS182-GIGE1_sp",
|
||||
"SATES30-CAMS182-GIGE2_sp",
|
||||
"SATES30-CAMS182-GIGE1_profiles:9002",
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"camera_calibration": null,
|
||||
"image_background_enable": false,
|
||||
"image_background": null,
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_slices": null,
|
||||
"camera_name": "sf-daqsync-01:8889",
|
||||
"name": "sf-daqsync-01:8889_sp"
|
||||
}
|
||||
@@ -1,11 +1,22 @@
|
||||
{
|
||||
"image_background_enable": false,
|
||||
"image_background": null,
|
||||
"image_threshold": null,
|
||||
"image_region_of_interest": null,
|
||||
"image_good_region": null,
|
||||
"image_threshold": 7000.0,
|
||||
"image_region_of_interest": [
|
||||
462,
|
||||
344,
|
||||
390,
|
||||
159
|
||||
],
|
||||
"image_good_region": {
|
||||
"threshold": 0.1,
|
||||
"gfscale": 3.0
|
||||
},
|
||||
"image_slices": null,
|
||||
"pipeline_type": "processing",
|
||||
"camera_name": "simulation",
|
||||
"name": "simulation_sp"
|
||||
"name": "simulation_sp",
|
||||
"reload": true,
|
||||
"function": "beam_full_width",
|
||||
"fw_threshold": 0.3
|
||||
}
|
||||
@@ -11,5 +11,8 @@
|
||||
"_function": "furka.py",
|
||||
"function": "single_photon.c",
|
||||
"mode": "PUB",
|
||||
"reload": true
|
||||
"reload": true,
|
||||
"include": [
|
||||
"simulation:EVENT_NUM"
|
||||
]
|
||||
}
|
||||
154
configuration/user_scripts/SARES11-SPEC125-M1_2tt.py
Normal file
154
configuration/user_scripts/SARES11-SPEC125-M1_2tt.py
Normal file
@@ -0,0 +1,154 @@
|
||||
import sys
|
||||
import json
|
||||
|
||||
from logging import getLogger
|
||||
from scipy.interpolate import interp1d
|
||||
from scipy import signal
|
||||
from scipy.ndimage import gaussian_filter1d
|
||||
from scipy.ndimage import convolve1d
|
||||
import numpy as np
|
||||
|
||||
_logger = getLogger(__name__)
|
||||
|
||||
# Alvra spectral encoder constants/waveforms
|
||||
px2fs = 2.1 # calibration from ...
|
||||
#lambdas = 528.34 + 0.0261*np.arange(0,2048) # calibration from 2021-10-06
|
||||
lambdas = np.linspace(504.17385, 608.07410, num=2048) # calibration from 2023-04-25
|
||||
#lambdas = np.linspace(510.57796, 628.63459, num=2048) # calibration from 2022-05-18
|
||||
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
|
||||
"SiN5": np.concatenate((signal.tukey(40)[25:40], np.zeros(2033), np.zeros(2048))), # back timetool SiN
|
||||
"SiN2": np.concatenate((np.ones(5), signal.tukey(12)[9:11], signal.tukey(12)[0:4], np.ones(5), signal.tukey(40)[25:40], np.zeros(2017), np.zeros(2048))) # back timetool SiN
|
||||
}
|
||||
|
||||
# Functions for image analysis and spectral encoding processing
|
||||
def get_roi_projection(image, roi, axis):
|
||||
x_start, x_stop, y_start, y_stop = roi
|
||||
cropped = image[y_start:y_stop, x_start:x_stop]
|
||||
project = cropped.sum(axis=axis)
|
||||
return project.astype("int64")
|
||||
|
||||
|
||||
def interpolate(xold, xnew, vals):
|
||||
"""
|
||||
Interpolate vals from xold to xnew
|
||||
"""
|
||||
interp = interp1d(xold, vals, kind='cubic')
|
||||
return interp(xnew)
|
||||
|
||||
|
||||
def fourier_filter(vals, filt):
|
||||
"""
|
||||
Fourier transform, filter, inverse fourier transform, take the real part
|
||||
"""
|
||||
vals = np.hstack((vals, np.zeros_like(vals))) # pad
|
||||
transformed = np.fft.fft(vals)
|
||||
filtered = transformed * filt
|
||||
inverse = np.fft.ifft(filtered)
|
||||
invreal = 2 * np.real(inverse)
|
||||
return invreal
|
||||
|
||||
|
||||
def edge(filter_name, backgrounds, signals, peakback):
|
||||
"""
|
||||
returns:
|
||||
edge positions determined from argmax of peak traces, converted to fs
|
||||
edge amplitudes determined from the amax of the peak traces
|
||||
the actual peak traces, which are the derivative of signal traces (below)
|
||||
the raw signal traces, without any processing or smoothing except for the Fourier filter applied to remove the etalon
|
||||
"""
|
||||
ffilter = filters[filter_name]
|
||||
|
||||
# background normalization
|
||||
sig_norm = (signals / backgrounds) - 1
|
||||
# interpolate to get evenly sampled in frequency space
|
||||
sig_interp = interpolate(nus, nus_new, sig_norm)
|
||||
# Fourier filter
|
||||
#sig_filtered = fourier_filter(sig_interp, ffilter)
|
||||
sig_filtered = sig_interp
|
||||
# interpolate to get unevenly sampled in frequency space (back to original wavelength space)
|
||||
sig_uninterp = interpolate(nus_new, nus, sig_filtered[..., 0:2048]) + 1
|
||||
# peak via the derivative
|
||||
sig_deriv = 20000 * gaussian_filter1d(sig_uninterp, 50, order=1)
|
||||
sig_deriv -= peakback
|
||||
peak_pos = 1024 - (np.argmax(sig_deriv[500:1500], axis=-1) + 500)
|
||||
peak_pos *= px2fs
|
||||
peak_amp = np.amax(sig_deriv[500:1500], axis=-1)
|
||||
|
||||
return peak_pos, peak_amp, sig_deriv, sig_uninterp
|
||||
|
||||
|
||||
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None):
|
||||
try:
|
||||
"""
|
||||
takes an image, processes the signal, sends out the raw data and processed results
|
||||
"""
|
||||
image = image.astype(int)
|
||||
camera_name = parameters["camera_name"]
|
||||
background = parameters.get("background_data")
|
||||
background = background.astype(int)
|
||||
background_name = parameters.get("image_background")
|
||||
background_mode = parameters.get("image_background_enable")
|
||||
roi_signal = parameters.get("roi_signal")
|
||||
roi_signal2 = parameters.get("roi_signal2")
|
||||
project_axis = parameters.get("project_axis", 0)
|
||||
# events = bsdata["SAR-CVME-TIFALL4:EvtSet"]
|
||||
# laser_off = int(events[21])
|
||||
# laser_on = int(events[18])
|
||||
# fel_on = int(events[13])
|
||||
|
||||
# maintain the structure of processing_parameters
|
||||
background_shape = None
|
||||
|
||||
# maintain the structure of res
|
||||
projection_signal = projection_background = None
|
||||
|
||||
try:
|
||||
|
||||
if roi_signal is not None:
|
||||
projection_background = get_roi_projection(background, roi_signal, project_axis)
|
||||
projection_background2 = get_roi_projection(background, roi_signal2, project_axis)
|
||||
projection_signal = get_roi_projection(image, roi_signal, project_axis)
|
||||
projection_signal2 = get_roi_projection(image, roi_signal2, project_axis)
|
||||
peak_pos, peak_amp, sig_deriv, sig_uninterp = edge("YAG", projection_background, projection_signal, 0)
|
||||
peak_pos2, peak_amp2, sig_deriv2, sig_uninterp2 = edge("YAG", projection_background2, projection_signal2, 0)
|
||||
|
||||
except Exception as e:
|
||||
lineno = sys.exc_info()[2].tb_lineno
|
||||
tn = type(e).__name__
|
||||
status = f"Error in line number {lineno}: {tn}: {e}"
|
||||
raise e
|
||||
else:
|
||||
status = "OK"
|
||||
|
||||
processing_parameters = {
|
||||
"status": status,
|
||||
"background_name": background_name,
|
||||
"roi_signal": roi_signal,
|
||||
}
|
||||
|
||||
processing_parameters = json.dumps(processing_parameters)
|
||||
|
||||
res = {
|
||||
camera_name + ".processing_parameters": processing_parameters,
|
||||
camera_name + ".projection_signal": projection_signal,
|
||||
camera_name + ".projection_background": projection_background,
|
||||
camera_name + ".edge_position": peak_pos,
|
||||
camera_name + ".edge_amplitude": peak_amp,
|
||||
camera_name + ".edge_derivative": sig_deriv,
|
||||
camera_name + ".edge_raw": sig_uninterp,
|
||||
camera_name + ".projection_signal2": projection_signal2,
|
||||
camera_name + ".projection_background2": projection_background2,
|
||||
camera_name + ".edge_position2": peak_pos2,
|
||||
camera_name + ".edge_amplitude2": peak_amp2,
|
||||
camera_name + ".edge_derivative2": sig_deriv2,
|
||||
camera_name + ".edge_raw2": sig_uninterp2
|
||||
|
||||
}
|
||||
return res
|
||||
|
||||
except:
|
||||
_logger.exception("Error in processing function")
|
||||
raise
|
||||
@@ -11,7 +11,7 @@ import numpy as np
|
||||
_logger = getLogger(__name__)
|
||||
|
||||
# Alvra spectral encoder constants/waveforms
|
||||
px2fs = 1.91 # calibration from ...
|
||||
px2fs = 2.1 # calibration from ...
|
||||
#lambdas = 528.34 + 0.0261*np.arange(0,2048) # calibration from 2021-10-06
|
||||
lambdas = np.linspace(504.17385, 608.07410, num=2048) # calibration from 2023-04-25
|
||||
#lambdas = np.linspace(510.57796, 628.63459, num=2048) # calibration from 2022-05-18
|
||||
@@ -19,7 +19,8 @@ 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
|
||||
"SiN": np.concatenate((signal.tukey(40)[25:40], np.zeros(2033), np.zeros(2048))) # back timetool SiN
|
||||
"SiN5": np.concatenate((signal.tukey(40)[25:40], np.zeros(2033), np.zeros(2048))), # back timetool SiN
|
||||
"SiN2": np.concatenate((np.ones(5), signal.tukey(12)[9:11], signal.tukey(12)[0:4], np.ones(5), signal.tukey(40)[25:40], np.zeros(2017), np.zeros(2048))) # back timetool SiN
|
||||
}
|
||||
|
||||
# Functions for image analysis and spectral encoding processing
|
||||
@@ -65,7 +66,8 @@ def edge(filter_name, backgrounds, signals, peakback):
|
||||
# interpolate to get evenly sampled in frequency space
|
||||
sig_interp = interpolate(nus, nus_new, sig_norm)
|
||||
# Fourier filter
|
||||
sig_filtered = fourier_filter(sig_interp, ffilter)
|
||||
#sig_filtered = fourier_filter(sig_interp, ffilter)
|
||||
sig_filtered = sig_interp
|
||||
# interpolate to get unevenly sampled in frequency space (back to original wavelength space)
|
||||
sig_uninterp = interpolate(nus_new, nus, sig_filtered[..., 0:2048]) + 1
|
||||
# peak via the derivative
|
||||
|
||||
142
configuration/user_scripts/SARES11-SPEC125-M1_tt_events.py
Normal file
142
configuration/user_scripts/SARES11-SPEC125-M1_tt_events.py
Normal file
@@ -0,0 +1,142 @@
|
||||
import sys
|
||||
import json
|
||||
|
||||
from logging import getLogger
|
||||
from scipy.interpolate import interp1d
|
||||
from scipy import signal
|
||||
from scipy.ndimage import gaussian_filter1d
|
||||
from scipy.ndimage import convolve1d
|
||||
import numpy as np
|
||||
|
||||
_logger = getLogger(__name__)
|
||||
|
||||
# Alvra spectral encoder constants/waveforms
|
||||
px2fs = 2.1 # calibration from ...
|
||||
#lambdas = 528.34 + 0.0261*np.arange(0,2048) # calibration from 2021-10-06
|
||||
lambdas = np.linspace(504.17385, 608.07410, num=2048) # calibration from 2023-04-25
|
||||
#lambdas = np.linspace(510.57796, 628.63459, num=2048) # calibration from 2022-05-18
|
||||
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
|
||||
"SiN": np.concatenate((signal.tukey(40)[25:40], np.zeros(2033), np.zeros(2048))) # back timetool SiN
|
||||
}
|
||||
|
||||
# Functions for image analysis and spectral encoding processing
|
||||
def get_roi_projection(image, roi, axis):
|
||||
x_start, x_stop, y_start, y_stop = roi
|
||||
cropped = image[y_start:y_stop, x_start:x_stop]
|
||||
project = cropped.sum(axis=axis)
|
||||
return project.astype("int64")
|
||||
|
||||
|
||||
def interpolate(xold, xnew, vals):
|
||||
"""
|
||||
Interpolate vals from xold to xnew
|
||||
"""
|
||||
interp = interp1d(xold, vals, kind='cubic')
|
||||
return interp(xnew)
|
||||
|
||||
|
||||
def fourier_filter(vals, filt):
|
||||
"""
|
||||
Fourier transform, filter, inverse fourier transform, take the real part
|
||||
"""
|
||||
vals = np.hstack((vals, np.zeros_like(vals))) # pad
|
||||
transformed = np.fft.fft(vals)
|
||||
filtered = transformed * filt
|
||||
inverse = np.fft.ifft(filtered)
|
||||
invreal = 2 * np.real(inverse)
|
||||
return invreal
|
||||
|
||||
|
||||
def edge(filter_name, backgrounds, signals, peakback):
|
||||
"""
|
||||
returns:
|
||||
edge positions determined from argmax of peak traces, converted to fs
|
||||
edge amplitudes determined from the amax of the peak traces
|
||||
the actual peak traces, which are the derivative of signal traces (below)
|
||||
the raw signal traces, without any processing or smoothing except for the Fourier filter applied to remove the etalon
|
||||
"""
|
||||
ffilter = filters[filter_name]
|
||||
|
||||
# background normalization
|
||||
sig_norm = (signals / backgrounds) - 1
|
||||
# interpolate to get evenly sampled in frequency space
|
||||
sig_interp = interpolate(nus, nus_new, sig_norm)
|
||||
# Fourier filter
|
||||
sig_filtered = fourier_filter(sig_interp, ffilter)
|
||||
# interpolate to get unevenly sampled in frequency space (back to original wavelength space)
|
||||
sig_uninterp = interpolate(nus_new, nus, sig_filtered[..., 0:2048]) + 1
|
||||
# peak via the derivative
|
||||
sig_deriv = 20000 * gaussian_filter1d(sig_uninterp, 50, order=1)
|
||||
sig_deriv -= peakback
|
||||
peak_pos = 1024 - (np.argmax(sig_deriv[500:1500], axis=-1) + 500)
|
||||
peak_pos *= px2fs
|
||||
peak_amp = np.amax(sig_deriv[500:1500], axis=-1)
|
||||
|
||||
return peak_pos, peak_amp, sig_deriv, sig_uninterp
|
||||
|
||||
|
||||
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None):
|
||||
try:
|
||||
"""
|
||||
takes an image, processes the signal, sends out the raw data and processed results
|
||||
"""
|
||||
image = image.astype(int)
|
||||
camera_name = parameters["camera_name"]
|
||||
background = parameters.get("background_data")
|
||||
background = background.astype(int)
|
||||
background_name = parameters.get("image_background")
|
||||
background_mode = parameters.get("image_background_enable")
|
||||
roi_signal = parameters.get("roi_signal")
|
||||
project_axis = parameters.get("project_axis", 0)
|
||||
# events = bsdata["SAR-CVME-TIFALL4:EvtSet"]
|
||||
# laser_off = int(events[21])
|
||||
# laser_on = int(events[18])
|
||||
# fel_on = int(events[13])
|
||||
|
||||
# maintain the structure of processing_parameters
|
||||
background_shape = None
|
||||
|
||||
# maintain the structure of res
|
||||
projection_signal = projection_background = None
|
||||
|
||||
try:
|
||||
|
||||
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("SiN", projection_background, projection_signal, 0)
|
||||
|
||||
except Exception as e:
|
||||
lineno = sys.exc_info()[2].tb_lineno
|
||||
tn = type(e).__name__
|
||||
status = f"Error in line number {lineno}: {tn}: {e}"
|
||||
raise e
|
||||
else:
|
||||
status = "OK"
|
||||
|
||||
processing_parameters = {
|
||||
"status": status,
|
||||
"background_name": background_name,
|
||||
"roi_signal": roi_signal,
|
||||
}
|
||||
|
||||
processing_parameters = json.dumps(processing_parameters)
|
||||
|
||||
res = {
|
||||
camera_name + ".processing_parameters": processing_parameters,
|
||||
camera_name + ".projection_signal": projection_signal,
|
||||
camera_name + ".projection_background": projection_background,
|
||||
camera_name + ".edge_position": peak_pos,
|
||||
camera_name + ".edge_amplitude": peak_amp,
|
||||
camera_name + ".edge_derivative": sig_deriv,
|
||||
camera_name + ".edge_raw": sig_uninterp
|
||||
}
|
||||
return res
|
||||
|
||||
except:
|
||||
_logger.exception("Error in processing function")
|
||||
raise
|
||||
|
||||
@@ -127,6 +127,18 @@ def process(data, pulse_id, timestamp, params):
|
||||
except:
|
||||
edge_results["arrival_time_odd"] = calib
|
||||
|
||||
try:
|
||||
#_logger.warning("Shape: " + str(edge_results["signal"].shape))
|
||||
edge_results["signal"] = edge_results["signal"].reshape((edge_results["signal"].shape[1],))
|
||||
except:
|
||||
#_logger.warning("Shape err" + str(edge_results["signal"]))
|
||||
pass
|
||||
try:
|
||||
#_logger.warning("Shape: " + str(edge_results["signal"].shape))
|
||||
edge_results["xcorr"] = edge_results["xcorr"].reshape((edge_results["xcorr"].shape[1],))
|
||||
except:
|
||||
#_logger.warning("Shape err" + str(edge_results["signal"]))
|
||||
pass
|
||||
|
||||
# push pulse ID for debuging
|
||||
edge_results["pulse_id"] = pulse_id
|
||||
@@ -139,16 +151,7 @@ def process(data, pulse_id, timestamp, params):
|
||||
# output[f"{device}:arrival_time_even"] = None
|
||||
# Set bs outputs
|
||||
#log = ""
|
||||
for key, value in edge_results.items():
|
||||
if isinstance(value,np.floating):
|
||||
value=float(value)
|
||||
if isinstance(value,np.integer):
|
||||
value=int(value)
|
||||
if type(value) == list:
|
||||
value = np.array(value)
|
||||
#if isinstance(value,np.ndarray):
|
||||
# log = log + " | " + str(key) + " - " + str(value.dtype) + " - " + str(value.shape)
|
||||
#log = log + " | " + str(key) + " - " + str(type(value))
|
||||
for key, value in edge_results.items():
|
||||
output[f"{device}:{key}"] = value
|
||||
#_logger.info(log)
|
||||
|
||||
|
||||
27
configuration/user_scripts/late_averaging.py
Normal file
27
configuration/user_scripts/late_averaging.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import numpy
|
||||
from cam_server.pipeline.data_processing import functions, processor
|
||||
from logging import getLogger
|
||||
|
||||
_logger = getLogger(__name__)
|
||||
image_buffer = []
|
||||
|
||||
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None):
|
||||
global image_buffer
|
||||
averaging = parameters.get("late_averaging")
|
||||
if averaging:
|
||||
while len(image_buffer) >= averaging:
|
||||
image_buffer.pop(0)
|
||||
image_buffer.append(image)
|
||||
try:
|
||||
frames = numpy.array(image_buffer)
|
||||
image = numpy.average(frames, 0)
|
||||
#_logger.info("Averaged: %d" % len(image_buffer))
|
||||
except:
|
||||
# Different shapes
|
||||
image_buffer = []
|
||||
return None
|
||||
else:
|
||||
image_buffer = []
|
||||
|
||||
ret = processor.process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata)
|
||||
return ret
|
||||
@@ -9,18 +9,21 @@
|
||||
const char *CHANNEL_NAMES[] = {"EVENT_NUM", "EVENT_I", "EVENT_J", "EVENT_CHARGE", "EVENT_ETA_X", "EVENT_ETA_Y", "EVENT_I_INTERP", "EVENT_J_INTERP"};
|
||||
|
||||
|
||||
const int MAX_NUM_EVENTS= 1000; // max number of events per frame
|
||||
const int EVENT_CHANNELS = 7;
|
||||
// max number of events per frame
|
||||
#define MAX_NUM_EVENTS 100
|
||||
#define EVENT_CHANNELS 7
|
||||
|
||||
double evt_p[EVENT_CHANNELS][MAX_NUM_EVENTS];
|
||||
|
||||
|
||||
struct events_double func_ph_1d_double( double *frame, int i_dim, int j_dim, double *th_m);
|
||||
//struct decl.
|
||||
struct events_double {
|
||||
double **evnt_ijc;
|
||||
int evnt_num;
|
||||
};
|
||||
int func_ph_1d_double( double *frame, int i_dim, int j_dim, double *th_m);
|
||||
|
||||
|
||||
void setArrayToValue(double array[], int size, double value) {
|
||||
for (int i = 0; i < size; i++) {
|
||||
array[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
//def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None):
|
||||
PyObject *process(PyObject *self, PyObject *args)
|
||||
@@ -54,19 +57,28 @@ PyObject *process(PyObject *self, PyObject *args)
|
||||
|
||||
int i,j,l;
|
||||
int i_dim=size_y;
|
||||
int j_dim=size_x;
|
||||
int j_dim=size_x;
|
||||
|
||||
PyObject* threshold_obj = PyDict_GetItemString(pars, "threshold");
|
||||
double threshold_val = 60000.0;
|
||||
if (threshold_obj!=NULL){
|
||||
if (PyFloat_Check(threshold_obj)) {
|
||||
threshold_val = PyFloat_AsDouble(threshold_obj);
|
||||
} else if (PyLong_Check(threshold_obj)) {
|
||||
threshold_val = PyLong_AsDouble(threshold_obj);
|
||||
}
|
||||
}
|
||||
double *threshold = malloc(i_dim*j_dim*sizeof(double));
|
||||
for(i=0; i<i_dim;i++) {
|
||||
for(j=0;j<j_dim;j++) {
|
||||
threshold[i*j_dim+j]=90.0;
|
||||
threshold[i*j_dim+j]=100.0;//threshold_val;
|
||||
}
|
||||
}
|
||||
//background (all matrices are indexed in 1d)
|
||||
double *background = malloc(i_dim*j_dim*sizeof(double));
|
||||
for(i=0; i<i_dim;i++) {
|
||||
for(j=0;j<j_dim;j++) {
|
||||
background[i*j_dim+j]=10.0;
|
||||
background[i*j_dim+j]=0.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,33 +89,34 @@ PyObject *process(PyObject *self, PyObject *args)
|
||||
frameBKsub[i*j_dim+j]=(double)img_data[i*j_dim+j] - background[i*j_dim+j];
|
||||
}
|
||||
}
|
||||
struct events_double evns1d = func_ph_1d_double( frameBKsub, i_dim, j_dim, threshold);
|
||||
int evnt_num = func_ph_1d_double( frameBKsub, i_dim, j_dim, threshold);
|
||||
|
||||
//Create return dictionary
|
||||
PyObject *ret = PyDict_New();
|
||||
PyObject* camera_name = PyDict_GetItemString(pars, "camera_name");
|
||||
const char * camera_name_str = PyUnicode_AsUTF8(camera_name);
|
||||
char channel_name[200];
|
||||
char channel_name[200];
|
||||
//PyDict_SetItemString(ret, "camera_name", camera_name);
|
||||
sprintf(channel_name, "%s:%s",camera_name_str, CHANNEL_NAMES[0]);
|
||||
PyDict_SetItemString(ret, channel_name, PyLong_FromLong(evns1d.evnt_num));
|
||||
PyDict_SetItemString(ret, channel_name, PyLong_FromLong(evnt_num));
|
||||
for (int i=0; i<EVENT_CHANNELS; i++){
|
||||
sprintf(channel_name, "%s:%s",camera_name_str, CHANNEL_NAMES[i+1]);
|
||||
npy_intp arr_dims[1] = {MAX_NUM_EVENTS};
|
||||
PyObject *parr =PyArray_SimpleNewFromData(1, arr_dims, NPY_FLOAT64, evns1d.evnt_ijc);
|
||||
//setArrayToValue(evt_p[i],MAX_NUM_EVENTS, i+10.0);
|
||||
PyObject *parr =PyArray_SimpleNewFromData(1, arr_dims, NPY_DOUBLE, evt_p[i]);
|
||||
PyDict_SetItemString(ret, channel_name, parr);
|
||||
}
|
||||
for (l = 0; l < EVENT_CHANNELS; l++) {
|
||||
free(evns1d.evnt_ijc[l]);
|
||||
}
|
||||
free(evns1d.evnt_ijc);
|
||||
//for (l = 0; l < EVENT_CHANNELS; l++) {
|
||||
// free(evns1d.evnt_ijc[l]);
|
||||
//}
|
||||
//free(evns1d.evnt_ijc);
|
||||
free(frameBKsub);
|
||||
free(background);
|
||||
free(threshold);
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct events_double func_ph_1d_double( double *frame, int i_dim, int j_dim, double *th_m)
|
||||
int func_ph_1d_double( double *frame, int i_dim, int j_dim, double *th_m)
|
||||
{
|
||||
//int th= 50;
|
||||
int i, j, l=0, m=0, n=0, evt_m_i=0, evt_i=0 ;
|
||||
@@ -111,9 +124,9 @@ PyObject *process(PyObject *self, PyObject *args)
|
||||
double charge_evt;
|
||||
int th;
|
||||
|
||||
double **evt_p= (double**)malloc(EVENT_CHANNELS * sizeof(double*));
|
||||
for (l = 0; l < EVENT_CHANNELS; l++) {
|
||||
evt_p[l] = (double*)malloc(MAX_NUM_EVENTS * sizeof(double));}
|
||||
//double **evt_p= (double**)malloc(EVENT_CHANNELS * sizeof(double*));
|
||||
//for (l = 0; l < EVENT_CHANNELS; l++) {
|
||||
// evt_p[l] = (double*)malloc(MAX_NUM_EVENTS * sizeof(double));}
|
||||
|
||||
/*Counter variables for the loop*/
|
||||
double charge = 0;
|
||||
@@ -124,7 +137,7 @@ PyObject *process(PyObject *self, PyObject *args)
|
||||
double C[]= { 4.37805097e-03, 2.43266401e-01, -7.81479328e+00, 7.70533057e+01, -2.37906124e+02, 3.42988113e+02, -2.35979731e+02, 6.24074562e+01};
|
||||
double D[]= {-2.05180773e-04, 4.35314696e-01, -1.32557223e+01, 1.19990373e+02, -3.80696758e+02, 5.81427096e+02, -4.30789104e+02, 1.23894761e+02};
|
||||
|
||||
for(i=0; i<i_dim-1; i++) {
|
||||
for(i=0; i<i_dim-1; i++) {
|
||||
if (evt_i>=MAX_NUM_EVENTS){
|
||||
break;
|
||||
}
|
||||
@@ -206,9 +219,6 @@ PyObject *process(PyObject *self, PyObject *args)
|
||||
}
|
||||
}
|
||||
}
|
||||
struct events_double events_i_d;
|
||||
events_i_d.evnt_ijc = evt_p;
|
||||
events_i_d.evnt_num = evt_i;
|
||||
return events_i_d;
|
||||
return evt_i;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user