22 lines
823 B
Python
22 lines
823 B
Python
baseurl = "https://data-api.psi.ch/sf"
|
|
filename = "/Users/gobbo_a/dev/back/test.h5"
|
|
channels = ["SARFE10-PSSS059:FIT-COM", "S10BC01-DBPM010:Q1"]
|
|
start = "2023-12-10T08:50:00.000Z" #args.start.astimezone(pytz.timezone('UTC')).strftime("%Y-%m-%dT%H:%M:%S.%fZ") # isoformat() # "2019-12-13T09:00:00.000000000Z"
|
|
end = "2023-12-10T08:50:05.000Z" # args.end.astimezone(pytz.timezone('UTC')).strftime("%Y-%m-%dT%H:%M:%S.%fZ") # .isoformat() # "2019-12-13T09:00:00.100000000Z"
|
|
|
|
|
|
api = DataAPI(baseurl)
|
|
ret = api.queryData(channels, start, end)
|
|
print ret
|
|
|
|
channel_data = ret[0]["data"]
|
|
y1=[v["value"] for v in channel_data]
|
|
x1=[v["globalSeconds"] for v in channel_data]
|
|
|
|
|
|
channel_data = ret[1]["data"]
|
|
y2=[v["value"] for v in channel_data]
|
|
x2=[v["globalSeconds"] for v in channel_data]
|
|
|
|
|
|
plot([y1, y2], channels, xdata=[x1, x2]) |