@@ -415,9 +415,9 class PlotData(Operation, Process): | |||
|
415 | 415 | if not self.polar: |
|
416 | 416 | ax.set_xlim(xmin, xmax) |
|
417 | 417 | ax.set_ylim(ymin, ymax) |
|
418 |
ax.set_title('{} |
|
|
418 | ax.set_title('{} {} {}'.format( | |
|
419 | 419 | self.titles[n], |
|
420 | self.getDateTime(self.max_time).strftime('%H:%M:%S'), | |
|
420 | self.getDateTime(self.max_time).strftime('%Y-%m-%dT%H:%M:%S'), | |
|
421 | 421 | self.time_label), |
|
422 | 422 | size=8) |
|
423 | 423 | else: |
@@ -1,5 +1,5 | |||
|
1 | 1 | ''' |
|
2 |
Created on |
|
|
2 | Created on Jan 15, 2018 | |
|
3 | 3 | |
|
4 | 4 | @author: Juan C. Espinoza |
|
5 | 5 | ''' |
@@ -7,7 +7,6 Created on Dec 27, 2017 | |||
|
7 | 7 | import os |
|
8 | 8 | import sys |
|
9 | 9 | import time |
|
10 | import json | |
|
11 | 10 | import glob |
|
12 | 11 | import datetime |
|
13 | 12 | import tarfile |
@@ -24,24 +23,6 from schainpy.utils import log | |||
|
24 | 23 | |
|
25 | 24 | UT1970 = datetime.datetime(1970, 1, 1) - datetime.timedelta(seconds=time.timezone) |
|
26 | 25 | |
|
27 | def load_json(obj): | |
|
28 | ''' | |
|
29 | Parse json as string instead of unicode | |
|
30 | ''' | |
|
31 | ||
|
32 | if isinstance(obj, str): | |
|
33 | iterable = json.loads(obj) | |
|
34 | else: | |
|
35 | iterable = obj | |
|
36 | ||
|
37 | if isinstance(iterable, dict): | |
|
38 | return {str(k): load_json(v) if isinstance(v, dict) else str(v) if isinstance(v, unicode) else v | |
|
39 | for k, v in iterable.items()} | |
|
40 | elif isinstance(iterable, (list, tuple)): | |
|
41 | return [str(v) if isinstance(v, unicode) else v for v in iterable] | |
|
42 | ||
|
43 | return iterable | |
|
44 | ||
|
45 | 26 | |
|
46 | 27 | class PXReader(JRODataReader, ProcessingUnit): |
|
47 | 28 | |
@@ -76,9 +57,9 class PXReader(JRODataReader, ProcessingUnit): | |||
|
76 | 57 | self.endTime = endTime |
|
77 | 58 | self.datatime = datetime.datetime(1900,1,1) |
|
78 | 59 | self.walk = walk |
|
79 |
self.nTries = kwargs.get('nTries', |
|
|
60 | self.nTries = kwargs.get('nTries', 10) | |
|
80 | 61 | self.online = kwargs.get('online', False) |
|
81 |
self.delay = kwargs.get('delay', |
|
|
62 | self.delay = kwargs.get('delay', 60) | |
|
82 | 63 | self.ele = kwargs.get('ext', '') |
|
83 | 64 | |
|
84 | 65 | if self.path is None: |
@@ -169,12 +150,12 class PXReader(JRODataReader, ProcessingUnit): | |||
|
169 | 150 | |
|
170 | 151 | if self.walk: |
|
171 | 152 | paths = [os.path.join(self.path, p) for p in os.listdir(self.path) if os.path.isdir(os.path.join(self.path, p))] |
|
153 | paths.sort() | |
|
172 | 154 | path = paths[-1] |
|
173 | 155 | else: |
|
174 |
path |
|
|
156 | path = self.path | |
|
175 | 157 | |
|
176 | 158 | new_files = [os.path.join(path, s) for s in glob.glob1(path, '*') if os.path.splitext(s)[-1] in self.ext and '{}'.format(self.ele) in s] |
|
177 | ||
|
178 | 159 | new_files.sort() |
|
179 | 160 | |
|
180 | 161 | for fullname in new_files: |
@@ -295,6 +276,9 class PXReader(JRODataReader, ProcessingUnit): | |||
|
295 | 276 | |
|
296 | 277 | self.datatime = datetime.datetime.utcfromtimestamp(self.header[0]['Time']) |
|
297 | 278 | |
|
279 | if self.online: | |
|
280 | break | |
|
281 | ||
|
298 | 282 | if (self.datatime < datetime.datetime.combine(self.startDate, self.startTime)) or \ |
|
299 | 283 | (self.datatime > datetime.datetime.combine(self.endDate, self.endTime)): |
|
300 | 284 | log.warning( |
General Comments 0
You need to be logged in to leave comments.
Login now