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