##// END OF EJS Templates
Few fixes with merging empty csv files from Web Services...
jeandet -
r1433:aaf8b0146447
parent child
Show More
@@ -1,1 +1,1
1 Subproject commit 9a080a34054c21a67236f761e8843005c07ff0ba
1 Subproject commit 5f1aaa704ac36252027b9da0064bdf1de063df0d
@@ -15,6 +15,7 amda = AMDA()
15 15
16 16 def get_sample(metadata,start,stop):
17 17 ts_type = pysciqlopcore.ScalarTimeSerie
18 default_ctor_args = 1
18 19 try:
19 20 param_id = None
20 21 for key,value in metadata:
@@ -25,18 +26,18 def get_sample(metadata,start,stop):
25 26 ts_type = pysciqlopcore.VectorTimeSerie
26 27 elif value == 'multicomponent':
27 28 ts_type = pysciqlopcore.MultiComponentTimeSerie
29 default_ctor_args = (0,2)
28 30 tstart=datetime.datetime.fromtimestamp(start, tz=timezone.utc)
29 31 tend=datetime.datetime.fromtimestamp(stop, tz=timezone.utc)
30 df = amda.get_parameter(start_time=tstart, stop_time=tend, parameter_id=param_id)
32 df = amda.get_parameter(start_time=tstart, stop_time=tend, parameter_id=param_id, method="REST")
31 33 #t = np.array([d.timestamp()-7200 for d in df.index])
32 34 t = np.array([d.timestamp() for d in df.index])
33 35 values = df.values
34 36 return ts_type(t,values.transpose())
35 return ts_type(1)
36 37 except Exception as e:
37 38 print(traceback.format_exc())
38 39 print("Error in amda.py ",str(e))
39 return ts_type(1)
40 return ts_type(default_ctor_args)
40 41
41 42
42 43 if len(amda.component) is 0:
@@ -3,6 +3,7 sys.path.append("/home/jeandet/Documents/prog/build-SciQLop-Desktop-Debug/core")
3 3 import PythonProviders
4 4 import pysciqlopcore
5 5 import numpy as np
6 import math
6 7
7 8 someglobal = 1
8 9
@@ -25,7 +26,7 def make_multicomponent(x):
25 26
26 27
27 28 def get_data(metadata,start,stop):
28 x = np.arange(start, stop)
29 x = np.arange(math.ceil(start), math.floor(stop))
29 30 for key,value in metadata:
30 31 if key == 'xml:id':
31 32 param_id = value
General Comments 0
You need to be logged in to leave comments. Login now