01.2025
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Mon Jan 13 17:07:30 CET 2025
|
||||
LastRunDate=250113
|
||||
FileSequentialNumber=13116
|
||||
DaySequentialNumber=4
|
||||
#Thu Jan 23 10:21:47 CET 2025
|
||||
LastRunDate=250123
|
||||
FileSequentialNumber=13160
|
||||
DaySequentialNumber=2
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#Mon Jan 13 15:40:25 CET 2025
|
||||
#Thu Jan 23 13:12:24 CET 2025
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000=
|
||||
@@ -9,29 +10,28 @@
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
|
||||
colormapLogarithmic=false
|
||||
spatialCalScaleX=-1.0
|
||||
spatialCalScaleY=-1.0
|
||||
spatialCalScaleX=-8.828541763475837
|
||||
spatialCalScaleY=-8.834897818216463
|
||||
serverURL=null
|
||||
rescaleOffset=0.0
|
||||
roiWidth=-1
|
||||
colormap=Flame
|
||||
imageWidth=1744
|
||||
invert=false
|
||||
colormapMin=72.0
|
||||
colormapMin=0.0
|
||||
rotationCrop=false
|
||||
roiHeight=-1
|
||||
colormapAutomatic=true
|
||||
roiY=0
|
||||
roiX=0
|
||||
spatialCalOffsetY=-50.00000000000001
|
||||
spatialCalOffsetX=-50.0
|
||||
spatialCalOffsetY=-907.000013614636
|
||||
spatialCalOffsetX=-627.9999990131071
|
||||
scale=1.0
|
||||
regionStart=
|
||||
grayscale=false
|
||||
rtY=1
|
||||
colormapMax=3000.0
|
||||
colormapMax=20.0
|
||||
spat=
|
||||
rotation=0.0
|
||||
rescaleFactor=1.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#Mon Dec 09 10:29:03 CET 2024
|
||||
#Wed Jan 22 09:48:29 CET 2025
|
||||
spatialCalOffsetY=-819.9999871547424
|
||||
spatialCalOffsetX=-861.0000211619925
|
||||
colormapLogarithmic=false
|
||||
|
||||
@@ -5,7 +5,9 @@ do_elog = True
|
||||
is_panel = get_exec_pars().source != CommandSource.ui #must be check before run
|
||||
USE_SCREEN_PANEL = False
|
||||
|
||||
run("CPython/wrapper")
|
||||
#run("CPython/wrapper")
|
||||
import_py("CPython/extremum", "extremum")
|
||||
|
||||
#Parameters
|
||||
if is_panel:
|
||||
start = args[0]
|
||||
@@ -112,11 +114,14 @@ try:
|
||||
plt.addSeries(LinePlotErrorSeries("Momentum Spread Fit", plt.getSeries(1).color, 2))
|
||||
plt.getSeries(2).setData(ph_p_fit, p_fit)
|
||||
plt.getSeries(3).setData(ph_dp_fit, dp_fit)
|
||||
#plt.getSeries(2).setData(ph_p_fit, p_fit, to_array([0.0]*len(ph_p_fit), 'd'), to_array([0.0]*len(ph_p_fit), 'd'))
|
||||
#plt.getSeries(3).setData(ph_dp_fit, dp_fit, to_array([0.0]*len(ph_dp_fit), 'd'), to_array([0.0]*len(ph_dp_fit), 'd'))
|
||||
plt.getSeries(2).setPointsVisible(False)
|
||||
plt.getSeries(3).setPointsVisible(False)
|
||||
plt.addMarker(ph_p_max, plt.AxisId.X, "%3.2f" % ph_p_max, plt.getSeries(0).color)
|
||||
plt.addMarker(ph_dp_min, plt.AxisId.X, "%3.2f" % ph_dp_min, plt.getSeries(1).color)
|
||||
except:
|
||||
except :
|
||||
print sys.exc_info()
|
||||
raise Exception("Fit failure")
|
||||
|
||||
# Calculating laser offset in deg
|
||||
|
||||
@@ -3,9 +3,9 @@ import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
|
||||
|
||||
dry_run = False
|
||||
do_elog = True
|
||||
#station = "S30CB09" # define param locally
|
||||
#bpm_ch = "SARCL02-DBPM110"
|
||||
#bpm_field = "X1"
|
||||
station = "S30CB12" # define param locally
|
||||
bpm_ch = "SARCL02-DBPM110"
|
||||
bpm_field = "X1"
|
||||
|
||||
run("RFscan/phase_scan_data.py")
|
||||
if get_exec_pars().args: # args is set by callin process (Qt panel)
|
||||
|
||||
@@ -7,6 +7,12 @@ from mathutils import fit_polynomial,fit_gaussian, fit_harmonic, calculate_peaks
|
||||
from mathutils import PolynomialFunction, Gaussian, HarmonicOscillator
|
||||
|
||||
import java.awt.Color as Color
|
||||
|
||||
try:
|
||||
from jeputils import import_py
|
||||
except:
|
||||
pass
|
||||
|
||||
run("Devices/Elements")
|
||||
|
||||
###################################################################################################
|
||||
|
||||
11
script/test/DataAPI.py
Normal file
11
script/test/DataAPI.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import ch.psi.utils.DataAPI as DataAPI
|
||||
|
||||
#da = DataAPI("https://data-api.psi.ch/sf")
|
||||
da = DataAPI("https://data-api.psi.ch/sf-databuffer")
|
||||
|
||||
|
||||
ret = da.queryData(["S10BC01-DBLM065:B1_LOSS"], 23251652441, 23251653739)
|
||||
plot([d['value'] for d in ret[0]['data']], xdata=[d['pulseId'] for d in ret[0]['data']])
|
||||
|
||||
ret = da.queryData(["S10BC01-DBLM065:B1_LOSS"], "2025-01-21T16:06:00.000", "2025-01-21T16:06:02.000")
|
||||
plot([d['value'] for d in ret[0]['data']], xdata=[d['pulseId'] for d in ret[0]['data']])
|
||||
84
script/test/DataBuffer.py
Normal file
84
script/test/DataBuffer.py
Normal file
@@ -0,0 +1,84 @@
|
||||
import json
|
||||
import requests
|
||||
|
||||
class DataBuffer:
|
||||
def __init__(self, url):
|
||||
self.url = url
|
||||
|
||||
def get_response(self, response, is_json=True):
|
||||
if response.status_code != 200:
|
||||
raise Exception(response.text)
|
||||
return json.loads(response.text) if is_json else response.text
|
||||
|
||||
def get_binary_response(self, response):
|
||||
if response.status_code != 200:
|
||||
raise Exception(response.text)
|
||||
return response.raw.read()
|
||||
|
||||
def get_data(self, req):
|
||||
return self.get_response(requests.post(url=self.url+"/query", json=req))
|
||||
|
||||
def get_channels(self):
|
||||
data = {
|
||||
"regex":"DWSC090",
|
||||
"backends":[
|
||||
"sf-databuffer"
|
||||
],
|
||||
"ordering":"asc",
|
||||
"reload":True
|
||||
}
|
||||
print self.url+"/channels"
|
||||
return self.get_response(requests.post(url=self.url+"/channels", json=data))
|
||||
|
||||
|
||||
|
||||
req = {
|
||||
"channels":[
|
||||
"S10BC01-DBLM065:B1_LOSS"
|
||||
],
|
||||
"range":{
|
||||
#"startPulseId":23251652441,
|
||||
#"endPulseId":23251653739,
|
||||
|
||||
"startDate":"2025-01-21T16:20:00.000",
|
||||
"startInclusive":True,
|
||||
"startExpansion":False,
|
||||
"endDate":"2025-01-21T16:20:01.000",
|
||||
"endInclusive":True,
|
||||
"endExpansion":False
|
||||
|
||||
|
||||
},
|
||||
"ordering":"asc",
|
||||
"configFields":[
|
||||
"globalDate",
|
||||
"type"
|
||||
],
|
||||
"eventFields":[
|
||||
"pulseId",
|
||||
"globalDate",
|
||||
"value"
|
||||
],
|
||||
"aggregation":{
|
||||
"aggregationType":"value",
|
||||
"aggregations":[
|
||||
"min",
|
||||
"mean",
|
||||
"max"
|
||||
],
|
||||
"nrOfBins":20
|
||||
},
|
||||
"response":{
|
||||
"format":"json",
|
||||
"compression":"none",
|
||||
},
|
||||
"mapping":{
|
||||
"incomplete":"provide-as-is"
|
||||
}
|
||||
}
|
||||
|
||||
db = DataBuffer ("http://data-api.psi.ch/sf-databuffer")
|
||||
#c = db.get_channels()
|
||||
ret = db.get_data(req)
|
||||
print ret
|
||||
plot([d[0]['value']['mean'] for d in ret['data']], xdata=[d[0]['pulseId'] for d in ret['data']])
|
||||
@@ -1,11 +1,11 @@
|
||||
CAMERA = "SARES20-CAMS142-M3"
|
||||
CAMERA = "SARFE10-PSSS059"
|
||||
#CAMERA = "SARFE10-PSSS059"
|
||||
#CAMERA = "SATES31-CAMS187-RIXS1"
|
||||
#CAMERA = "SAROP21-PPRM138"
|
||||
#CAMERA = "SARES20-CAMS142-C2"
|
||||
#CAMERA = "SATBD02-DSCR050"
|
||||
#CAMERA = "SARCL01-DSCR170"
|
||||
|
||||
CAMERA = "SATBD02-DSCR050"
|
||||
CAMERA_URL = caget(CAMERA + ":BSREADCONFIG").replace("tcp://daq", "tcp://")
|
||||
#CAMERA_URL= "tcp://sf-sioc-cs-83:9020"
|
||||
#sCAMERA_URL= "tcp://sf-daqsync-17:9002"
|
||||
|
||||
@@ -1,16 +1,24 @@
|
||||
#cam_server.stop()
|
||||
#cam_server.start("stream_example")
|
||||
cam_server.start("bs_timing_test")
|
||||
cam_server.start("simulation_sp", True)
|
||||
cam_server.stream.waitCacheChange(3000)
|
||||
|
||||
bscan (cam_server.stream, 100, save=False)
|
||||
#
|
||||
#bscan (cam_server.stream, 100, save=False)
|
||||
|
||||
names=[]
|
||||
data=[]
|
||||
for k,v in cam_server.value.items():
|
||||
#for k,v in cam_server.value.items():
|
||||
# names.append(k)
|
||||
# data.append(v)
|
||||
|
||||
for k in cam_server.value.keys():
|
||||
names.append(k)
|
||||
#data.append(v)
|
||||
|
||||
for v in cam_server.value.values():
|
||||
#names.append(k)
|
||||
data.append(v)
|
||||
|
||||
|
||||
plot(data, names)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user