The requested changes are too big and content was truncated. Show full diff
@@ -1,1034 +1,1051 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on September , 2012 |
|
3 | 3 | @author: |
|
4 | 4 | ''' |
|
5 | 5 | from xml.etree.ElementTree import Element, SubElement |
|
6 | 6 | from xml.etree import ElementTree as ET |
|
7 | 7 | from xml.dom import minidom |
|
8 | 8 | |
|
9 | 9 | #import datetime |
|
10 | 10 | from model import * |
|
11 | 11 | |
|
12 | 12 | import ast |
|
13 | 13 | |
|
14 | 14 | def prettify(elem): |
|
15 | 15 | """Return a pretty-printed XML string for the Element. |
|
16 | 16 | """ |
|
17 | 17 | rough_string = ET.tostring(elem, 'utf-8') |
|
18 | 18 | reparsed = minidom.parseString(rough_string) |
|
19 | 19 | return reparsed.toprettyxml(indent=" ") |
|
20 | 20 | |
|
21 | 21 | class ParameterConf(): |
|
22 | 22 | |
|
23 | 23 | id = None |
|
24 | 24 | name = None |
|
25 | 25 | value = None |
|
26 | 26 | format = None |
|
27 | 27 | |
|
28 | 28 | __formated_value = None |
|
29 | 29 | |
|
30 | 30 | ELEMENTNAME = 'Parameter' |
|
31 | 31 | |
|
32 | 32 | def __init__(self): |
|
33 | 33 | |
|
34 | 34 | self.format = 'str' |
|
35 | 35 | |
|
36 | 36 | def getElementName(self): |
|
37 | 37 | |
|
38 | 38 | return self.ELEMENTNAME |
|
39 | 39 | |
|
40 | 40 | def getValue(self): |
|
41 | 41 | |
|
42 | 42 | if self.__formated_value != None: |
|
43 | 43 | |
|
44 | 44 | return self.__formated_value |
|
45 | 45 | |
|
46 | 46 | value = self.value |
|
47 | 47 | |
|
48 | 48 | if self.format == 'bool': |
|
49 | 49 | value = int(value) |
|
50 | 50 | |
|
51 | 51 | if self.format == 'list': |
|
52 | 52 | strList = value.split(',') |
|
53 | 53 | |
|
54 | 54 | self.__formated_value = strList |
|
55 | 55 | |
|
56 | 56 | return self.__formated_value |
|
57 | 57 | |
|
58 | 58 | if self.format == 'intlist': |
|
59 | 59 | """ |
|
60 | 60 | Example: |
|
61 | 61 | value = (0,1,2) |
|
62 | 62 | """ |
|
63 | value = value.replace('(', '') | |
|
64 | value = value.replace(')', '') | |
|
65 | ||
|
66 | value = value.replace('[', '') | |
|
67 | value = value.replace(']', '') | |
|
68 | ||
|
63 | 69 | strList = value.split(',') |
|
64 | 70 | intList = [int(x) for x in strList] |
|
65 | 71 | |
|
66 | 72 | self.__formated_value = intList |
|
67 | 73 | |
|
68 | 74 | return self.__formated_value |
|
69 | 75 | |
|
70 | 76 | if self.format == 'floatlist': |
|
71 | 77 | """ |
|
72 | 78 | Example: |
|
73 | 79 | value = (0.5, 1.4, 2.7) |
|
74 | 80 | """ |
|
81 | ||
|
82 | value = value.replace('(', '') | |
|
83 | value = value.replace(')', '') | |
|
84 | ||
|
85 | value = value.replace('[', '') | |
|
86 | value = value.replace(']', '') | |
|
87 | ||
|
75 | 88 | strList = value.split(',') |
|
76 | 89 | floatList = [float(x) for x in strList] |
|
77 | 90 | |
|
78 | 91 | self.__formated_value = floatList |
|
79 | 92 | |
|
80 | 93 | return self.__formated_value |
|
81 | 94 | |
|
82 | 95 | if self.format == 'date': |
|
83 | 96 | strList = value.split('/') |
|
84 | 97 | intList = [int(x) for x in strList] |
|
85 | 98 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
86 | 99 | |
|
87 | 100 | self.__formated_value = date |
|
88 | 101 | |
|
89 | 102 | return self.__formated_value |
|
90 | 103 | |
|
91 | 104 | if self.format == 'time': |
|
92 | 105 | strList = value.split(':') |
|
93 | 106 | intList = [int(x) for x in strList] |
|
94 | 107 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
95 | 108 | |
|
96 | 109 | self.__formated_value = time |
|
97 | 110 | |
|
98 | 111 | return self.__formated_value |
|
99 | 112 | |
|
100 | 113 | if self.format == 'pairslist': |
|
101 | 114 | """ |
|
102 | 115 | Example: |
|
103 | 116 | value = (0,1),(1,2) |
|
104 | 117 | """ |
|
105 | 118 | |
|
106 | 119 | value = value.replace('(', '') |
|
107 | 120 | value = value.replace(')', '') |
|
108 | 121 | |
|
122 | value = value.replace('[', '') | |
|
123 | value = value.replace(']', '') | |
|
124 | ||
|
109 | 125 | strList = value.split(',') |
|
110 | 126 | intList = [int(item) for item in strList] |
|
111 | 127 | pairList = [] |
|
112 | 128 | for i in range(len(intList)/2): |
|
113 | 129 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
114 | 130 | |
|
115 | 131 | self.__formated_value = pairList |
|
116 | 132 | |
|
117 | 133 | return self.__formated_value |
|
118 | 134 | |
|
119 | 135 | if self.format == 'multilist': |
|
120 | 136 | """ |
|
121 | 137 | Example: |
|
122 | 138 | value = (0,1,2),(3,4,5) |
|
123 | 139 | """ |
|
124 | 140 | multiList = ast.literal_eval(value) |
|
125 | 141 | |
|
126 | 142 | self.__formated_value = multiList |
|
127 | 143 | |
|
128 | 144 | return self.__formated_value |
|
129 | 145 | |
|
130 | 146 | format_func = eval(self.format) |
|
131 | 147 | |
|
132 | 148 | self.__formated_value = format_func(value) |
|
133 | 149 | |
|
134 | 150 | return self.__formated_value |
|
135 | 151 | |
|
136 | 152 | def setup(self, id, name, value, format='str'): |
|
137 | 153 | |
|
138 | 154 | self.id = id |
|
139 | 155 | self.name = name |
|
140 | 156 | self.value = str(value) |
|
141 | 157 | self.format = str.lower(format) |
|
142 | 158 | |
|
143 | 159 | def update(self, name, value, format='str'): |
|
144 | 160 | |
|
145 | 161 | self.name = name |
|
146 | 162 | self.value = str(value) |
|
147 | 163 | self.format = format |
|
148 | 164 | |
|
149 | 165 | def makeXml(self, opElement): |
|
150 | 166 | |
|
151 | 167 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
152 | 168 | parmElement.set('id', str(self.id)) |
|
153 | 169 | parmElement.set('name', self.name) |
|
154 | 170 | parmElement.set('value', self.value) |
|
155 | 171 | parmElement.set('format', self.format) |
|
156 | 172 | |
|
157 | 173 | def readXml(self, parmElement): |
|
158 | 174 | |
|
159 | 175 | self.id = parmElement.get('id') |
|
160 | 176 | self.name = parmElement.get('name') |
|
161 | 177 | self.value = parmElement.get('value') |
|
162 | 178 | self.format = str.lower(parmElement.get('format')) |
|
163 | 179 | |
|
164 | 180 | #Compatible with old signal chain version |
|
165 | 181 | if self.format == 'int' and self.name == 'idfigure': |
|
166 | 182 | self.name = 'id' |
|
167 | 183 | |
|
168 | 184 | def printattr(self): |
|
169 | 185 | |
|
170 | 186 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
171 | 187 | |
|
172 | 188 | class OperationConf(): |
|
173 | 189 | |
|
174 | 190 | id = None |
|
175 | 191 | name = None |
|
176 | 192 | priority = None |
|
177 | 193 | type = None |
|
178 | 194 | |
|
179 | 195 | parmConfObjList = [] |
|
180 | 196 | |
|
181 | 197 | ELEMENTNAME = 'Operation' |
|
182 | 198 | |
|
183 | 199 | def __init__(self): |
|
184 | 200 | |
|
185 | 201 | self.id = 0 |
|
186 | 202 | self.name = None |
|
187 | 203 | self.priority = None |
|
188 | 204 | self.type = 'self' |
|
189 | 205 | |
|
190 | 206 | |
|
191 | 207 | def __getNewId(self): |
|
192 | 208 | |
|
193 | 209 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
194 | 210 | |
|
195 | 211 | def getElementName(self): |
|
196 | 212 | |
|
197 | 213 | return self.ELEMENTNAME |
|
198 | 214 | |
|
199 | 215 | def getParameterObjList(self): |
|
200 | 216 | |
|
201 | 217 | return self.parmConfObjList |
|
202 | 218 | |
|
203 | 219 | def getParameterObj(self, parameterName): |
|
204 | 220 | |
|
205 | 221 | for parmConfObj in self.parmConfObjList: |
|
206 | 222 | |
|
207 | 223 | if parmConfObj.name != parameterName: |
|
208 | 224 | continue |
|
209 | 225 | |
|
210 | 226 | return parmConfObj |
|
211 | 227 | |
|
212 | 228 | return None |
|
213 | 229 | |
|
214 | 230 | def getParameterObjfromValue(self,parameterValue): |
|
215 | 231 | for parmConfObj in self.parmConfObjList: |
|
216 | 232 | |
|
217 | 233 | if parmConfObj.getValue() != parameterValue: |
|
218 | 234 | continue |
|
219 | 235 | |
|
220 | 236 | return parmConfObj.getValue() |
|
221 | 237 | |
|
222 | 238 | return None |
|
223 | 239 | |
|
224 | 240 | def getParameterValue(self, parameterName): |
|
225 | 241 | |
|
226 | 242 | parameterObj = self.getParameterObj(parameterName) |
|
227 | 243 | value = parameterObj.getValue() |
|
228 | 244 | |
|
229 | 245 | return value |
|
230 | 246 | |
|
231 | 247 | def setup(self, id, name, priority, type): |
|
232 | 248 | |
|
233 | 249 | self.id = id |
|
234 | 250 | self.name = name |
|
235 | 251 | self.type = type |
|
236 | 252 | self.priority = priority |
|
237 | 253 | |
|
238 | 254 | self.parmConfObjList = [] |
|
239 | 255 | |
|
240 | 256 | def removeParameters(self): |
|
241 | 257 | |
|
242 | 258 | for obj in self.parmConfObjList: |
|
243 | 259 | del obj |
|
244 | 260 | |
|
245 | 261 | self.parmConfObjList = [] |
|
246 | 262 | |
|
247 | 263 | def addParameter(self, name, value, format='str'): |
|
248 | 264 | |
|
249 | 265 | id = self.__getNewId() |
|
250 | 266 | |
|
251 | 267 | parmConfObj = ParameterConf() |
|
252 | 268 | parmConfObj.setup(id, name, value, format) |
|
253 | 269 | |
|
254 | 270 | self.parmConfObjList.append(parmConfObj) |
|
255 | 271 | |
|
256 | 272 | return parmConfObj |
|
257 | 273 | |
|
258 | 274 | def changeParameter(self, name, value, format='str'): |
|
259 | 275 | |
|
260 | 276 | parmConfObj = self.getParameterObj(name) |
|
261 | 277 | parmConfObj.update(name, value, format) |
|
262 | 278 | |
|
263 | 279 | return parmConfObj |
|
264 | 280 | |
|
265 | 281 | def makeXml(self, upElement): |
|
266 | 282 | |
|
267 | 283 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
268 | 284 | opElement.set('id', str(self.id)) |
|
269 | 285 | opElement.set('name', self.name) |
|
270 | 286 | opElement.set('type', self.type) |
|
271 | 287 | opElement.set('priority', str(self.priority)) |
|
272 | 288 | |
|
273 | 289 | for parmConfObj in self.parmConfObjList: |
|
274 | 290 | parmConfObj.makeXml(opElement) |
|
275 | 291 | |
|
276 | 292 | def readXml(self, opElement): |
|
277 | 293 | |
|
278 | 294 | self.id = opElement.get('id') |
|
279 | 295 | self.name = opElement.get('name') |
|
280 | 296 | self.type = opElement.get('type') |
|
281 | 297 | self.priority = opElement.get('priority') |
|
282 | 298 | |
|
283 | 299 | #Compatible with old signal chain version |
|
284 | 300 | #Use of 'run' method instead 'init' |
|
285 | 301 | if self.type == 'self' and self.name == 'init': |
|
286 | 302 | self.name = 'run' |
|
287 | 303 | |
|
288 | 304 | self.parmConfObjList = [] |
|
289 | 305 | |
|
290 | 306 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
291 | 307 | |
|
292 | 308 | for parmElement in parmElementList: |
|
293 | 309 | parmConfObj = ParameterConf() |
|
294 | 310 | parmConfObj.readXml(parmElement) |
|
295 | 311 | |
|
296 | 312 | #Compatible with old signal chain version |
|
297 | 313 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
298 | 314 | if self.type != 'self' and self.name == 'Plot': |
|
299 | 315 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
300 | 316 | self.name = parmConfObj.value |
|
301 | 317 | continue |
|
302 | 318 | |
|
303 | 319 | self.parmConfObjList.append(parmConfObj) |
|
304 | 320 | |
|
305 | 321 | def printattr(self): |
|
306 | 322 | |
|
307 | 323 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
308 | 324 | self.id, |
|
309 | 325 | self.name, |
|
310 | 326 | self.type, |
|
311 | 327 | self.priority) |
|
312 | 328 | |
|
313 | 329 | for parmConfObj in self.parmConfObjList: |
|
314 | 330 | parmConfObj.printattr() |
|
315 | 331 | |
|
316 | 332 | def createObject(self): |
|
317 | 333 | |
|
318 | 334 | if self.type == 'self': |
|
319 | 335 | raise ValueError, "This operation type cannot be created" |
|
320 | 336 | |
|
321 | 337 | if self.type == 'external' or self.type == 'other': |
|
322 | 338 | className = eval(self.name) |
|
323 | 339 | opObj = className() |
|
324 | 340 | |
|
325 | 341 | return opObj |
|
326 | 342 | |
|
327 | 343 | class ProcUnitConf(): |
|
328 | 344 | |
|
329 | 345 | id = None |
|
330 | 346 | name = None |
|
331 | 347 | datatype = None |
|
332 | 348 | inputId = None |
|
333 | 349 | parentId = None |
|
334 | 350 | |
|
335 | 351 | opConfObjList = [] |
|
336 | 352 | |
|
337 | 353 | procUnitObj = None |
|
338 | 354 | opObjList = [] |
|
339 | 355 | |
|
340 | 356 | ELEMENTNAME = 'ProcUnit' |
|
341 | 357 | |
|
342 | 358 | def __init__(self): |
|
343 | 359 | |
|
344 | 360 | self.id = None |
|
345 | 361 | self.datatype = None |
|
346 | 362 | self.name = None |
|
347 | 363 | self.inputId = None |
|
348 | 364 | |
|
349 | 365 | self.opConfObjList = [] |
|
350 | 366 | |
|
351 | 367 | self.procUnitObj = None |
|
352 | 368 | self.opObjDict = {} |
|
353 | 369 | |
|
354 | 370 | def __getPriority(self): |
|
355 | 371 | |
|
356 | 372 | return len(self.opConfObjList)+1 |
|
357 | 373 | |
|
358 | 374 | def __getNewId(self): |
|
359 | 375 | |
|
360 | 376 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
361 | 377 | |
|
362 | 378 | def getElementName(self): |
|
363 | 379 | |
|
364 | 380 | return self.ELEMENTNAME |
|
365 | 381 | |
|
366 | 382 | def getId(self): |
|
367 | 383 | |
|
368 | 384 | return str(self.id) |
|
369 | 385 | |
|
370 | 386 | def getInputId(self): |
|
371 | 387 | |
|
372 | 388 | return str(self.inputId) |
|
373 | 389 | |
|
374 | 390 | def getOperationObjList(self): |
|
375 | 391 | |
|
376 | 392 | return self.opConfObjList |
|
377 | 393 | |
|
378 | 394 | def getOperationObj(self, name=None): |
|
379 | 395 | |
|
380 | 396 | for opConfObj in self.opConfObjList: |
|
381 | 397 | |
|
382 | 398 | if opConfObj.name != name: |
|
383 | 399 | continue |
|
384 | 400 | |
|
385 | 401 | return opConfObj |
|
386 | 402 | |
|
387 | 403 | return None |
|
388 | 404 | |
|
389 | 405 | def getOpObjfromParamValue(self,value=None): |
|
390 | 406 | |
|
391 | 407 | for opConfObj in self.opConfObjList: |
|
392 | 408 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
393 | 409 | continue |
|
394 | 410 | return opConfObj |
|
395 | 411 | return None |
|
396 | 412 | |
|
397 | 413 | def getProcUnitObj(self): |
|
398 | 414 | |
|
399 | 415 | return self.procUnitObj |
|
400 | 416 | |
|
401 | 417 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
402 | 418 | |
|
403 | 419 | self.id = id |
|
404 | 420 | self.name = name |
|
405 | 421 | self.datatype = datatype |
|
406 | 422 | self.inputId = inputId |
|
407 | 423 | self.parentId = parentId |
|
408 | 424 | |
|
409 | 425 | self.opConfObjList = [] |
|
410 | 426 | |
|
411 | 427 | self.addOperation(name='run', optype='self') |
|
412 | 428 | |
|
413 | 429 | def removeOperations(self): |
|
414 | 430 | |
|
415 | 431 | for obj in self.opConfObjList: |
|
416 | 432 | del obj |
|
417 | 433 | |
|
418 | 434 | self.opConfObjList = [] |
|
419 | 435 | self.addOperation(name='run') |
|
420 | 436 | |
|
421 | 437 | def addParameter(self, **kwargs): |
|
422 | 438 | ''' |
|
423 | 439 | Add parameters to "run" operation |
|
424 | 440 | ''' |
|
425 | 441 | opObj = self.opConfObjList[0] |
|
426 | 442 | |
|
427 | 443 | opObj.addParameter(**kwargs) |
|
428 | 444 | |
|
429 | 445 | return opObj |
|
430 | 446 | |
|
431 | 447 | def addOperation(self, name, optype='self'): |
|
432 | 448 | |
|
433 | 449 | id = self.__getNewId() |
|
434 | 450 | priority = self.__getPriority() |
|
435 | 451 | |
|
436 | 452 | opConfObj = OperationConf() |
|
437 | 453 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
438 | 454 | |
|
439 | 455 | self.opConfObjList.append(opConfObj) |
|
440 | 456 | |
|
441 | 457 | return opConfObj |
|
442 | 458 | |
|
443 | 459 | def makeXml(self, procUnitElement): |
|
444 | 460 | |
|
445 | 461 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
446 | 462 | upElement.set('id', str(self.id)) |
|
447 | 463 | upElement.set('name', self.name) |
|
448 | 464 | upElement.set('datatype', self.datatype) |
|
449 | 465 | upElement.set('inputId', str(self.inputId)) |
|
450 | 466 | |
|
451 | 467 | for opConfObj in self.opConfObjList: |
|
452 | 468 | opConfObj.makeXml(upElement) |
|
453 | 469 | |
|
454 | 470 | def readXml(self, upElement): |
|
455 | 471 | |
|
456 | 472 | self.id = upElement.get('id') |
|
457 | 473 | self.name = upElement.get('name') |
|
458 | 474 | self.datatype = upElement.get('datatype') |
|
459 | 475 | self.inputId = upElement.get('inputId') |
|
460 | 476 | |
|
461 | 477 | self.opConfObjList = [] |
|
462 | 478 | |
|
463 | 479 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
464 | 480 | |
|
465 | 481 | for opElement in opElementList: |
|
466 | 482 | opConfObj = OperationConf() |
|
467 | 483 | opConfObj.readXml(opElement) |
|
468 | 484 | self.opConfObjList.append(opConfObj) |
|
469 | 485 | |
|
470 | 486 | def printattr(self): |
|
471 | 487 | |
|
472 | 488 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
473 | 489 | self.id, |
|
474 | 490 | self.name, |
|
475 | 491 | self.datatype, |
|
476 | 492 | self.inputId) |
|
477 | 493 | |
|
478 | 494 | for opConfObj in self.opConfObjList: |
|
479 | 495 | opConfObj.printattr() |
|
480 | 496 | |
|
481 | 497 | def createObjects(self): |
|
482 | 498 | |
|
483 | 499 | className = eval(self.name) |
|
484 | 500 | procUnitObj = className() |
|
485 | 501 | |
|
486 | 502 | for opConfObj in self.opConfObjList: |
|
487 | 503 | |
|
488 | 504 | if opConfObj.type == 'self': |
|
489 | 505 | continue |
|
490 | 506 | |
|
491 | 507 | opObj = opConfObj.createObject() |
|
492 | 508 | |
|
493 | 509 | self.opObjDict[opConfObj.id] = opObj |
|
494 | 510 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
495 | 511 | |
|
496 | 512 | self.procUnitObj = procUnitObj |
|
497 | 513 | |
|
498 | 514 | return procUnitObj |
|
499 | 515 | |
|
500 | 516 | def run(self): |
|
501 | 517 | |
|
502 | 518 | finalSts = False |
|
503 | 519 | |
|
504 | 520 | for opConfObj in self.opConfObjList: |
|
505 | 521 | |
|
506 | 522 | kwargs = {} |
|
507 | 523 | for parmConfObj in opConfObj.getParameterObjList(): |
|
508 | 524 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
509 | 525 | continue |
|
510 | 526 | |
|
511 | 527 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
512 | 528 | |
|
513 | 529 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
514 | 530 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
515 | 531 | opName = opConfObj.name, |
|
516 | 532 | opId = opConfObj.id, |
|
517 | 533 | **kwargs) |
|
518 | 534 | finalSts = finalSts or sts |
|
519 | 535 | |
|
520 | 536 | return finalSts |
|
521 | 537 | |
|
522 | 538 | def close(self): |
|
523 | 539 | |
|
524 | 540 | for opConfObj in self.opConfObjList: |
|
525 | 541 | if opConfObj.type == 'self': |
|
526 | 542 | continue |
|
527 | 543 | |
|
528 | 544 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
529 | 545 | opObj.close() |
|
530 | 546 | |
|
531 | 547 | self.procUnitObj.close() |
|
532 | 548 | |
|
533 | 549 | return |
|
534 | 550 | |
|
535 | 551 | class ReadUnitConf(ProcUnitConf): |
|
536 | 552 | |
|
537 | 553 | path = None |
|
538 | 554 | startDate = None |
|
539 | 555 | endDate = None |
|
540 | 556 | startTime = None |
|
541 | 557 | endTime = None |
|
542 | 558 | |
|
543 | 559 | ELEMENTNAME = 'ReadUnit' |
|
544 | 560 | |
|
545 | 561 | def __init__(self): |
|
546 | 562 | |
|
547 | 563 | self.id = None |
|
548 | 564 | self.datatype = None |
|
549 | 565 | self.name = None |
|
550 | 566 | self.inputId = 0 |
|
551 | 567 | |
|
552 | 568 | self.opConfObjList = [] |
|
553 | 569 | self.opObjList = [] |
|
554 | 570 | |
|
555 | 571 | def getElementName(self): |
|
556 | 572 | |
|
557 | 573 | return self.ELEMENTNAME |
|
558 | 574 | |
|
559 | 575 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
560 | 576 | |
|
561 | 577 | self.id = id |
|
562 | 578 | self.name = name |
|
563 | 579 | self.datatype = datatype |
|
564 | 580 | |
|
565 | 581 | self.path = path |
|
566 | 582 | self.startDate = startDate |
|
567 | 583 | self.endDate = endDate |
|
568 | 584 | self.startTime = startTime |
|
569 | 585 | self.endTime = endTime |
|
570 | 586 | |
|
571 | 587 | self.addRunOperation(**kwargs) |
|
572 | 588 | |
|
573 | 589 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, **kwargs): |
|
574 | 590 | |
|
575 | 591 | self.datatype = datatype |
|
576 | 592 | self.path = path |
|
577 | 593 | self.startDate = startDate |
|
578 | 594 | self.endDate = endDate |
|
579 | 595 | self.startTime = startTime |
|
580 | 596 | self.endTime = endTime |
|
581 | 597 | |
|
582 | 598 | self.updateRunOperation(**kwargs) |
|
583 | 599 | |
|
584 | 600 | def addRunOperation(self, **kwargs): |
|
585 | 601 | |
|
586 | 602 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
587 | 603 | |
|
588 | 604 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
589 | 605 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
590 | 606 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
591 | 607 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
592 | 608 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
593 | 609 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
594 | 610 | |
|
595 | 611 | for key, value in kwargs.items(): |
|
596 | 612 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
597 | 613 | |
|
598 | 614 | return opObj |
|
599 | 615 | |
|
600 | 616 | def updateRunOperation(self, **kwargs): |
|
601 | 617 | |
|
602 | 618 | opObj = self.getOperationObj(name = 'run') |
|
603 | 619 | opObj.removeParameters() |
|
604 | 620 | |
|
605 | 621 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
606 | 622 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
607 | 623 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
608 | 624 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
609 | 625 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
610 | 626 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
611 | 627 | |
|
612 | 628 | for key, value in kwargs.items(): |
|
613 | 629 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
614 | 630 | |
|
615 | 631 | return opObj |
|
616 | 632 | |
|
617 | 633 | class Project(): |
|
618 | 634 | |
|
619 | 635 | id = None |
|
620 | 636 | name = None |
|
621 | 637 | description = None |
|
622 | 638 | # readUnitConfObjList = None |
|
623 | 639 | procUnitConfObjDict = None |
|
624 | 640 | |
|
625 | 641 | ELEMENTNAME = 'Project' |
|
626 | 642 | |
|
627 | 643 | def __init__(self, control=None, dataq=None): |
|
628 | 644 | |
|
629 | 645 | self.id = None |
|
630 | 646 | self.name = None |
|
631 | 647 | self.description = None |
|
632 | 648 | |
|
633 | 649 | self.procUnitConfObjDict = {} |
|
634 | 650 | |
|
635 | 651 | #global data_q |
|
636 | 652 | #data_q = dataq |
|
637 | 653 | |
|
638 | 654 | if control==None: |
|
639 | 655 | control = {} |
|
640 | 656 | control['stop'] = False |
|
641 | 657 | control['pause'] = False |
|
642 | 658 | |
|
643 | 659 | self.control = control |
|
644 | 660 | |
|
645 | 661 | def __getNewId(self): |
|
646 | 662 | |
|
647 | 663 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
648 | 664 | |
|
649 | 665 | return str(id) |
|
650 | 666 | |
|
651 | 667 | def getElementName(self): |
|
652 | 668 | |
|
653 | 669 | return self.ELEMENTNAME |
|
654 | 670 | |
|
655 | 671 | def getId(self): |
|
656 | 672 | |
|
657 | 673 | return self.id |
|
658 | 674 | |
|
659 | 675 | def setup(self, id, name, description): |
|
660 | 676 | |
|
661 | 677 | self.id = id |
|
662 | 678 | self.name = name |
|
663 | 679 | self.description = description |
|
664 | 680 | |
|
665 | 681 | def update(self, name, description): |
|
666 | 682 | |
|
667 | 683 | self.name = name |
|
668 | 684 | self.description = description |
|
669 | 685 | |
|
670 | 686 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
671 | 687 | |
|
672 | 688 | #Compatible with old signal chain version |
|
673 | 689 | if datatype==None and name==None: |
|
674 | 690 | raise ValueError, "datatype or name should be defined" |
|
675 | 691 | |
|
676 | 692 | if name==None: |
|
677 | 693 | if 'Reader' in datatype: |
|
678 | 694 | name = datatype |
|
679 | 695 | else: |
|
680 | 696 | name = '%sReader' %(datatype) |
|
681 | 697 | |
|
682 | 698 | if datatype==None: |
|
683 | 699 | datatype = name.replace('Reader','') |
|
684 | 700 | |
|
685 | 701 | id = self.__getNewId() |
|
686 | 702 | |
|
687 | 703 | readUnitConfObj = ReadUnitConf() |
|
688 | 704 | readUnitConfObj.setup(id, name, datatype, parentId=self.id, **kwargs) |
|
689 | 705 | |
|
690 | 706 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
691 | 707 | |
|
692 | 708 | return readUnitConfObj |
|
693 | 709 | |
|
694 | 710 | def addProcUnit(self, inputId=0, datatype=None, name=None): |
|
695 | 711 | |
|
696 | 712 | #Compatible with old signal chain version |
|
697 | 713 | if datatype==None and name==None: |
|
698 | 714 | raise ValueError, "datatype or name should be defined" |
|
699 | 715 | |
|
700 | 716 | if name==None: |
|
701 | 717 | if 'Proc' in datatype: |
|
702 | 718 | name = datatype |
|
703 | 719 | else: |
|
704 | 720 | name = '%sProc' %(datatype) |
|
705 | 721 | |
|
706 | 722 | if datatype==None: |
|
707 | 723 | datatype = name.replace('Proc','') |
|
708 | 724 | |
|
709 | 725 | id = self.__getNewId() |
|
710 | 726 | |
|
711 | 727 | procUnitConfObj = ProcUnitConf() |
|
712 | 728 | procUnitConfObj.setup(id, name, datatype, inputId, parentId=self.id) |
|
713 | 729 | |
|
714 | 730 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
715 | 731 | |
|
716 | 732 | return procUnitConfObj |
|
717 | 733 | |
|
718 | 734 | def getReadUnitId(self): |
|
719 | 735 | |
|
720 | 736 | readUnitConfObj = self.getReadUnitObj() |
|
721 | 737 | |
|
722 | 738 | return readUnitConfObj.id |
|
723 | 739 | |
|
724 | 740 | def getReadUnitObj(self): |
|
725 | 741 | |
|
726 | 742 | for obj in self.procUnitConfObjDict.values(): |
|
727 | 743 | if obj.getElementName() == "ReadUnit": |
|
728 | 744 | return obj |
|
729 | 745 | |
|
730 | 746 | return None |
|
731 | 747 | |
|
732 | 748 | def getProcUnitObj(self, id): |
|
733 | 749 | |
|
734 | 750 | return self.procUnitConfObjDict[id] |
|
735 | 751 | |
|
736 | 752 | def getProcUnitObjByName(self, name): |
|
737 | 753 | |
|
738 | 754 | for obj in self.procUnitConfObjDict.values(): |
|
739 | 755 | if obj.name == name: |
|
740 | 756 | return obj |
|
741 | 757 | |
|
742 | 758 | return None |
|
743 | 759 | |
|
744 | 760 | def makeXml(self): |
|
745 | 761 | |
|
746 | 762 | projectElement = Element('Project') |
|
747 | 763 | projectElement.set('id', str(self.id)) |
|
748 | 764 | projectElement.set('name', self.name) |
|
749 | 765 | projectElement.set('description', self.description) |
|
750 | 766 | |
|
751 | 767 | # for readUnitConfObj in self.readUnitConfObjList: |
|
752 | 768 | # readUnitConfObj.makeXml(projectElement) |
|
753 | 769 | |
|
754 | 770 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
755 | 771 | procUnitConfObj.makeXml(projectElement) |
|
756 | 772 | |
|
757 | 773 | self.projectElement = projectElement |
|
758 | 774 | |
|
759 | 775 | def writeXml(self, filename): |
|
760 | 776 | |
|
761 | 777 | self.makeXml() |
|
762 | 778 | |
|
763 | 779 | #print prettify(self.projectElement) |
|
764 | 780 | |
|
765 | 781 | ElementTree(self.projectElement).write(filename, method='xml') |
|
766 | 782 | |
|
767 | 783 | def readXml(self, filename): |
|
768 | 784 | |
|
769 | 785 | #tree = ET.parse(filename) |
|
770 | 786 | self.projectElement = None |
|
771 | 787 | # self.readUnitConfObjList = [] |
|
772 | 788 | self.procUnitConfObjDict = {} |
|
773 | 789 | |
|
774 | 790 | self.projectElement = ElementTree().parse(filename) |
|
775 | 791 | |
|
776 | 792 | self.project = self.projectElement.tag |
|
777 | 793 | |
|
778 | 794 | self.id = self.projectElement.get('id') |
|
779 | 795 | self.name = self.projectElement.get('name') |
|
780 | 796 | self.description = self.projectElement.get('description') |
|
781 | 797 | |
|
782 | 798 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
783 | 799 | |
|
784 | 800 | for readUnitElement in readUnitElementList: |
|
785 | 801 | readUnitConfObj = ReadUnitConf() |
|
786 | 802 | readUnitConfObj.readXml(readUnitElement) |
|
787 | 803 | |
|
788 | 804 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
789 | 805 | |
|
790 | 806 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
791 | 807 | |
|
792 | 808 | for procUnitElement in procUnitElementList: |
|
793 | 809 | procUnitConfObj = ProcUnitConf() |
|
794 | 810 | procUnitConfObj.readXml(procUnitElement) |
|
795 | 811 | |
|
796 | 812 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
797 | 813 | |
|
798 | 814 | def printattr(self): |
|
799 | 815 | |
|
800 | 816 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
801 | 817 | self.name, |
|
802 | 818 | self.description) |
|
803 | 819 | |
|
804 | 820 | # for readUnitConfObj in self.readUnitConfObjList: |
|
805 | 821 | # readUnitConfObj.printattr() |
|
806 | 822 | |
|
807 | 823 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
808 | 824 | procUnitConfObj.printattr() |
|
809 | 825 | |
|
810 | 826 | def createObjects(self): |
|
811 | 827 | |
|
812 | 828 | # for readUnitConfObj in self.readUnitConfObjList: |
|
813 | 829 | # readUnitConfObj.createObjects() |
|
814 | 830 | |
|
815 | 831 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
816 | 832 | procUnitConfObj.createObjects() |
|
817 | 833 | |
|
818 | 834 | def __connect(self, objIN, thisObj): |
|
819 | 835 | |
|
820 | 836 | thisObj.setInput(objIN.getOutputObj()) |
|
821 | 837 | |
|
822 | 838 | def connectObjects(self): |
|
823 | 839 | |
|
824 | 840 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
825 | 841 | |
|
826 | 842 | inputId = thisPUConfObj.getInputId() |
|
827 | 843 | |
|
828 | 844 | if int(inputId) == 0: |
|
829 | 845 | continue |
|
830 | 846 | |
|
831 | 847 | #Get input object |
|
832 | 848 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
833 | 849 | puObjIN = puConfINObj.getProcUnitObj() |
|
834 | 850 | |
|
835 | 851 | #Get current object |
|
836 | 852 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
837 | 853 | |
|
838 | 854 | self.__connect(puObjIN, thisPUObj) |
|
839 | 855 | |
|
840 | 856 | def run(self): |
|
841 | 857 | |
|
842 | 858 | # for readUnitConfObj in self.readUnitConfObjList: |
|
843 | 859 | # readUnitConfObj.run() |
|
844 | 860 | |
|
845 | 861 | print "*"*40 |
|
846 | 862 | print " Starting SIGNAL CHAIN PROCESSING " |
|
847 | 863 | print "*"*40 |
|
848 | 864 | |
|
849 | 865 | |
|
850 | 866 | keyList = self.procUnitConfObjDict.keys() |
|
851 | 867 | keyList.sort() |
|
852 | 868 | |
|
853 | 869 | while(True): |
|
854 | 870 | |
|
855 | 871 | finalSts = False |
|
856 | 872 | |
|
857 | 873 | for procKey in keyList: |
|
858 | 874 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
859 | 875 | |
|
860 | 876 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
861 | 877 | sts = procUnitConfObj.run() |
|
862 | 878 | finalSts = finalSts or sts |
|
863 | 879 | |
|
864 | 880 | #If every process unit finished so end process |
|
865 | 881 | if not(finalSts): |
|
866 | 882 | print "Every process unit have finished" |
|
867 | 883 | break |
|
868 | 884 | |
|
869 | 885 | if self.control['pause']: |
|
870 |
print "P |
|
|
886 | print "Process suspended" | |
|
871 | 887 | |
|
872 | 888 | while True: |
|
873 | 889 | time.sleep(0.1) |
|
874 | 890 | |
|
875 | 891 | if not self.control['pause']: |
|
876 | 892 | break |
|
877 | 893 | |
|
878 | 894 | if self.control['stop']: |
|
879 | 895 | break |
|
896 | print "Process reinitialized" | |
|
880 | 897 | |
|
881 | 898 | if self.control['stop']: |
|
882 | 899 | print "Stopping process" |
|
883 | 900 | break |
|
884 | 901 | |
|
885 | 902 | #Closing every process |
|
886 | 903 | for procKey in keyList: |
|
887 | 904 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
888 | 905 | procUnitConfObj.close() |
|
889 | 906 | |
|
890 | 907 | print "Process stopped" |
|
891 | 908 | |
|
892 | 909 | def start(self, filename): |
|
893 | 910 | |
|
894 | 911 | self.writeXml(filename) |
|
895 | 912 | self.readXml(filename) |
|
896 | 913 | |
|
897 | 914 | self.createObjects() |
|
898 | 915 | self.connectObjects() |
|
899 | 916 | self.run() |
|
900 | 917 | |
|
901 | 918 | if __name__ == '__main__': |
|
902 | 919 | |
|
903 | 920 | desc = "Segundo Test" |
|
904 | 921 | filename = "schain.xml" |
|
905 | 922 | |
|
906 | 923 | controllerObj = Project() |
|
907 | 924 | |
|
908 | 925 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
909 | 926 | |
|
910 | 927 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
911 | 928 | path='data/rawdata/', |
|
912 | 929 | startDate='2011/01/01', |
|
913 | 930 | endDate='2012/12/31', |
|
914 | 931 | startTime='00:00:00', |
|
915 | 932 | endTime='23:59:59', |
|
916 | 933 | online=1, |
|
917 | 934 | walk=1) |
|
918 | 935 | |
|
919 | 936 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') |
|
920 | 937 | |
|
921 | 938 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
922 | 939 | |
|
923 | 940 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
924 | 941 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
925 | 942 | |
|
926 | 943 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
927 | 944 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
928 | 945 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
929 | 946 | |
|
930 | 947 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
931 | 948 | opObj12.addParameter(name='n', value='10', format='int') |
|
932 | 949 | |
|
933 | 950 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
934 | 951 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
935 | 952 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
936 | 953 | |
|
937 | 954 | |
|
938 | 955 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
939 | 956 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
940 | 957 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
941 | 958 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
942 | 959 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
943 | 960 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
944 | 961 | |
|
945 | 962 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') |
|
946 | 963 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
947 | 964 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
948 | 965 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
949 | 966 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
950 | 967 | |
|
951 | 968 | |
|
952 | 969 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) |
|
953 | 970 | # |
|
954 | 971 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') |
|
955 | 972 | # opObj12.addParameter(name='n', value='2', format='int') |
|
956 | 973 | # opObj12.addParameter(name='overlapping', value='1', format='int') |
|
957 | 974 | # |
|
958 | 975 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) |
|
959 | 976 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') |
|
960 | 977 | # |
|
961 | 978 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') |
|
962 | 979 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
963 | 980 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') |
|
964 | 981 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
965 | 982 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
966 | 983 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
967 | 984 | |
|
968 | 985 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') |
|
969 | 986 | # opObj11.addParameter(name='idfigure', value='10', format='int') |
|
970 | 987 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') |
|
971 | 988 | ## opObj11.addParameter(name='xmin', value='21', format='float') |
|
972 | 989 | ## opObj11.addParameter(name='xmax', value='22', format='float') |
|
973 | 990 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
974 | 991 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
975 | 992 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
976 | 993 | # opObj11.addParameter(name='timerange', value=str(60), format='int') |
|
977 | 994 | |
|
978 | 995 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
979 | 996 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') |
|
980 | 997 | # |
|
981 | 998 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
982 | 999 | # opObj12.addParameter(name='n', value='2', format='int') |
|
983 | 1000 | # |
|
984 | 1001 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
985 | 1002 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
986 | 1003 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
987 | 1004 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
988 | 1005 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
989 | 1006 | # |
|
990 | 1007 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
991 | 1008 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') |
|
992 | 1009 | # |
|
993 | 1010 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
994 | 1011 | # opObj12.addParameter(name='n', value='2', format='int') |
|
995 | 1012 | # |
|
996 | 1013 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
997 | 1014 | # opObj11.addParameter(name='idfigure', value='3', format='int') |
|
998 | 1015 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
999 | 1016 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1000 | 1017 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1001 | 1018 | |
|
1002 | 1019 | |
|
1003 | 1020 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') |
|
1004 | 1021 | # opObj12.addParameter(name='ncode', value='2', format='int') |
|
1005 | 1022 | # opObj12.addParameter(name='nbauds', value='8', format='int') |
|
1006 | 1023 | # opObj12.addParameter(name='code0', value='001110011', format='int') |
|
1007 | 1024 | # opObj12.addParameter(name='code1', value='001110011', format='int') |
|
1008 | 1025 | |
|
1009 | 1026 | |
|
1010 | 1027 | |
|
1011 | 1028 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) |
|
1012 | 1029 | # |
|
1013 | 1030 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') |
|
1014 | 1031 | # opObj21.addParameter(name='n', value='2', format='int') |
|
1015 | 1032 | # |
|
1016 | 1033 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') |
|
1017 | 1034 | # opObj11.addParameter(name='idfigure', value='4', format='int') |
|
1018 | 1035 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') |
|
1019 | 1036 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1020 | 1037 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1021 | 1038 | |
|
1022 | 1039 | print "Escribiendo el archivo XML" |
|
1023 | 1040 | |
|
1024 | 1041 | controllerObj.writeXml(filename) |
|
1025 | 1042 | |
|
1026 | 1043 | print "Leyendo el archivo XML" |
|
1027 | 1044 | controllerObj.readXml(filename) |
|
1028 | 1045 | #controllerObj.printattr() |
|
1029 | 1046 | |
|
1030 | 1047 | controllerObj.createObjects() |
|
1031 | 1048 | controllerObj.connectObjects() |
|
1032 | 1049 | controllerObj.run() |
|
1033 | 1050 | |
|
1034 | 1051 | No newline at end of file |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,100 +1,100 | |||
|
1 | 1 | import threading |
|
2 | 2 | import Queue |
|
3 | import pickle | |
|
4 | import numpy, os, sys | |
|
3 | from time import sleep | |
|
5 | 4 | |
|
6 | 5 | from schainpy.controller import Project |
|
7 | 6 | from command import * |
|
8 | 7 | |
|
9 | 8 | class ControllerThread(threading.Thread): |
|
10 | 9 | def __init__(self, filename, data_q=None): |
|
11 | 10 | super(ControllerThread, self).__init__() |
|
12 | 11 | self.filename = filename |
|
13 | 12 | self.data_q = data_q |
|
14 | 13 | self.control = {'stop':False,'pause':False} |
|
15 | 14 | |
|
16 | 15 | def stop(self): |
|
17 | 16 | self.control['stop'] = True |
|
18 | 17 | |
|
19 | 18 | def pause(self): |
|
20 | 19 | self.control['pause'] = not(self.control['pause']) |
|
21 | 20 | |
|
22 | 21 | def run(self): |
|
23 | 22 | self.control['stop'] = False |
|
24 | 23 | self.control['pause'] = False |
|
25 | 24 | self.controllerObj = Project(self.control, self.data_q) |
|
26 | 25 | self.controllerObj.readXml(self.filename) |
|
27 | 26 | self.controllerObj.createObjects() |
|
28 | 27 | self.controllerObj.connectObjects() |
|
29 | 28 | self.controllerObj.run() |
|
30 | 29 | |
|
31 | 30 | class CommCtrlProcessThread(threading.Thread): |
|
32 | 31 | """ Implements the threading.Thread interface (start, join, etc.) and |
|
33 | 32 | can be controlled via the cmd_q Queue attribute. Replies are placed in |
|
34 | 33 | the reply_q Queue attribute. |
|
35 | 34 | """ |
|
36 | 35 | def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()): |
|
37 | 36 | super(CommCtrlProcessThread, self).__init__() |
|
38 | 37 | self.cmd_q = cmd_q |
|
39 | 38 | # self.reply_q = reply_q |
|
40 | 39 | |
|
41 | 40 | # self.print_q = Queue.Queue() |
|
42 | 41 | # self.data_q = Queue.Queue() |
|
43 | 42 | |
|
44 | 43 | |
|
45 | 44 | self.alive = threading.Event() |
|
46 | 45 | self.setDaemon(True) |
|
47 | 46 | self.alive.set() |
|
48 | 47 | self.socket = None |
|
49 | 48 | |
|
50 | 49 | self.socketIO = None |
|
51 | 50 | self.mySocket = None |
|
52 | 51 | |
|
53 | 52 | |
|
54 | 53 | self.handlers = { |
|
55 | 54 | ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD, |
|
56 | 55 | ProcessCommand.MESSAGE: self._handle_ioMESSAGE, |
|
57 | 56 | ProcessCommand.DATA: self._handle_ioDATA, |
|
58 | 57 | ProcessCommand.STOP: self._handle_ioSTOP, |
|
59 | 58 | ProcessCommand.PAUSE: self._handle_ioPAUSE |
|
60 | 59 | } |
|
61 | 60 | |
|
62 | 61 | def run(self): |
|
63 | 62 | |
|
64 | 63 | while self.alive.isSet(): |
|
65 | 64 | try: |
|
66 | 65 | cmd = self.cmd_q.get(True, 0.1) |
|
67 | 66 | self.handlers[cmd.type](cmd) |
|
68 | 67 | except Queue.Empty as e: |
|
68 | sleep(0.1) | |
|
69 | 69 | continue |
|
70 | 70 | |
|
71 | 71 | |
|
72 | 72 | def _handle_ioPROCESSTHREAD(self, cmd): |
|
73 | 73 | filename = cmd.data |
|
74 | 74 | self.controllerObj = ControllerThread(filename=filename) |
|
75 | 75 | self.controllerObj.start() |
|
76 | 76 | |
|
77 | 77 | def _handle_ioPAUSE(self, cmd): |
|
78 | 78 | self.controllerObj.pause() |
|
79 | 79 | |
|
80 | 80 | def _handle_ioSTOP(self, cmd): |
|
81 | 81 | self.controllerObj.stop() |
|
82 | 82 | |
|
83 | 83 | def _handle_ioDATA(self, cmd): |
|
84 | 84 | self.reply_q.put(self._success_reply_data(data=cmd.data)) |
|
85 | 85 | |
|
86 | 86 | def _handle_ioMESSAGE(self, cmd): |
|
87 | 87 | self.reply_q.put(self._success_reply_message(data=cmd.data)) |
|
88 | 88 | |
|
89 | 89 | def _success_reply_data(self, data=None): |
|
90 | 90 | return ClientReply(ClientReply.DATA, data) |
|
91 | 91 | |
|
92 | 92 | def _success_reply_message(self, data=None): |
|
93 | 93 | return ClientReply(ClientReply.MESSAGE, data) |
|
94 | 94 | |
|
95 | 95 | def join(self, timeout=None): |
|
96 | 96 | self.alive.clear() |
|
97 | 97 | threading.Thread.join(self, timeout) |
|
98 | 98 | |
|
99 | 99 | |
|
100 | 100 | No newline at end of file |
This diff has been collapsed as it changes many lines, (1298 lines changed) Show them Hide them | |||
@@ -1,1537 +1,311 | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/alex/ui/MainWindow_21_02_13_v49.ui' |
|
4 | 4 | # |
|
5 | 5 | # Created: Mon Mar 24 13:28:36 2014 |
|
6 | 6 | # by: PyQt4 UI code generator 4.10 |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
|
9 | 9 | |
|
10 | 10 | from PyQt4 import QtCore, QtGui |
|
11 | 11 | from windows import * |
|
12 | 12 | |
|
13 | 13 | try: |
|
14 | 14 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
15 | 15 | except AttributeError: |
|
16 | 16 | def _fromUtf8(s): |
|
17 | 17 | return s |
|
18 | 18 | |
|
19 | 19 | try: |
|
20 | 20 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
21 | 21 | def _translate(context, text, disambig): |
|
22 | 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
23 | 23 | except AttributeError: |
|
24 | 24 | def _translate(context, text, disambig): |
|
25 | 25 | return QtGui.QApplication.translate(context, text, disambig) |
|
26 | 26 | |
|
27 | 27 | import os |
|
28 | 28 | from schainpy.gui.figures import tools |
|
29 | 29 | |
|
30 | 30 | FIGURES_PATH = tools.get_path() |
|
31 | 31 | |
|
32 |
class Ui_ |
|
|
32 | class Ui_EnvWindow(object): | |
|
33 | paused = False | |
|
33 | 34 | |
|
34 | def setupUi(self, MainWindow): | |
|
35 | def restorePauseIcon(self): | |
|
35 | 36 | |
|
36 | MainWindow.setObjectName(_fromUtf8("MainWindow")) | |
|
37 | MainWindow.resize(1203, 711) | |
|
38 | ||
|
39 | self.centralWidget = QtGui.QWidget(MainWindow) | |
|
40 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) | |
|
41 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) | |
|
42 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) | |
|
43 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) | |
|
44 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) | |
|
45 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) | |
|
46 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) | |
|
47 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) | |
|
48 | self.splitter = QtGui.QSplitter(self.splitter_2) | |
|
49 | self.splitter.setOrientation(QtCore.Qt.Vertical) | |
|
50 | self.splitter.setObjectName(_fromUtf8("splitter")) | |
|
51 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) | |
|
52 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) | |
|
53 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) | |
|
54 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) | |
|
55 | ||
|
56 | ||
|
57 | self.tabProject = QtGui.QWidget() | |
|
58 | self.tabProject.setObjectName(_fromUtf8("tabProject")) | |
|
59 | self.gridLayout_15 = QtGui.QGridLayout(self.tabProject) | |
|
60 | self.gridLayout_15.setObjectName(_fromUtf8("gridLayout_15")) | |
|
61 | self.frame = QtGui.QFrame(self.tabProject) | |
|
62 | self.frame.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
63 | self.frame.setFrameShadow(QtGui.QFrame.Raised) | |
|
64 | self.frame.setObjectName(_fromUtf8("frame")) | |
|
65 | self.gridLayout_2 = QtGui.QGridLayout(self.frame) | |
|
66 | self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) | |
|
67 | ||
|
68 | self.label = QtGui.QLabel(self.frame) | |
|
69 | self.label.setObjectName(_fromUtf8("label")) | |
|
70 | self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) | |
|
71 | self.proName = QtGui.QLineEdit(self.frame) | |
|
72 | self.proName.setObjectName(_fromUtf8("proName")) | |
|
73 | self.gridLayout_2.addWidget(self.proName, 0, 1, 1, 8) | |
|
74 | self.label_11 = QtGui.QLabel(self.frame) | |
|
75 | self.label_11.setObjectName(_fromUtf8("label_11")) | |
|
76 | self.gridLayout_2.addWidget(self.label_11, 1, 0, 1, 1) | |
|
77 | self.proComDataType = QtGui.QComboBox(self.frame) | |
|
78 | self.proComDataType.setObjectName(_fromUtf8("proComDataType")) | |
|
79 | self.proComDataType.addItem(_fromUtf8("")) | |
|
80 | self.proComDataType.addItem(_fromUtf8("")) | |
|
81 | self.proComDataType.addItem(_fromUtf8("")) | |
|
82 | self.gridLayout_2.addWidget(self.proComDataType, 1, 1, 1, 5) | |
|
83 | self.proDataType = QtGui.QLineEdit(self.frame) | |
|
84 | self.proDataType.setObjectName(_fromUtf8("proDataType")) | |
|
85 | self.gridLayout_2.addWidget(self.proDataType, 1, 6, 1, 3) | |
|
86 | self.label_15 = QtGui.QLabel(self.frame) | |
|
87 | self.label_15.setObjectName(_fromUtf8("label_15")) | |
|
88 | self.gridLayout_2.addWidget(self.label_15, 2, 0, 1, 1) | |
|
89 | self.proToolPath = QtGui.QToolButton(self.frame) | |
|
90 | self.proToolPath.setObjectName(_fromUtf8("proToolPath")) | |
|
91 | self.gridLayout_2.addWidget(self.proToolPath, 2, 1, 1, 1) | |
|
92 | self.proDataPath = QtGui.QLineEdit(self.frame) | |
|
93 | self.proDataPath.setObjectName(_fromUtf8("proDataPath")) | |
|
94 | self.gridLayout_2.addWidget(self.proDataPath, 2, 2, 1, 7) | |
|
95 | self.label_23 = QtGui.QLabel(self.frame) | |
|
96 | self.label_23.setObjectName(_fromUtf8("label_23")) | |
|
97 | self.gridLayout_2.addWidget(self.label_23, 3, 0, 1, 1) | |
|
98 | self.proComReadMode = QtGui.QComboBox(self.frame) | |
|
99 | self.proComReadMode.setObjectName(_fromUtf8("proComReadMode")) | |
|
100 | self.proComReadMode.addItem(_fromUtf8("")) | |
|
101 | self.proComReadMode.addItem(_fromUtf8("")) | |
|
102 | self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 2) | |
|
103 | self.label_33 = QtGui.QLabel(self.frame) | |
|
104 | self.label_33.setObjectName(_fromUtf8("label_33")) | |
|
105 | self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 2) | |
|
106 | self.proDelay = QtGui.QLineEdit(self.frame) | |
|
107 | self.proDelay.setObjectName(_fromUtf8("proDelay")) | |
|
108 | self.gridLayout_2.addWidget(self.proDelay, 3, 8, 1, 1) | |
|
109 | self.label_32 = QtGui.QLabel(self.frame) | |
|
110 | self.label_32.setObjectName(_fromUtf8("label_32")) | |
|
111 | self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1) | |
|
112 | self.proComWalk = QtGui.QComboBox(self.frame) | |
|
113 | self.proComWalk.setObjectName(_fromUtf8("proComWalk")) | |
|
114 | self.proComWalk.addItem(_fromUtf8("")) | |
|
115 | self.proComWalk.addItem(_fromUtf8("")) | |
|
116 | self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 8) | |
|
117 | self.proLoadButton = QtGui.QPushButton(self.frame) | |
|
118 | self.proLoadButton.setObjectName(_fromUtf8("proLoadButton")) | |
|
119 | self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9) | |
|
120 | self.label_10 = QtGui.QLabel(self.frame) | |
|
121 | self.label_10.setObjectName(_fromUtf8("label_10")) | |
|
122 | self.gridLayout_2.addWidget(self.label_10, 3, 3, 1, 1) | |
|
123 | self.proSet = QtGui.QLineEdit(self.frame) | |
|
124 | self.proSet.setObjectName(_fromUtf8("proSet")) | |
|
125 | self.gridLayout_2.addWidget(self.proSet, 3, 4, 1, 1) | |
|
126 | self.gridLayout_15.addWidget(self.frame, 0, 0, 1, 1) | |
|
127 | self.frame_2 = QtGui.QFrame(self.tabProject) | |
|
128 | self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
129 | self.frame_2.setFrameShadow(QtGui.QFrame.Raised) | |
|
130 | self.frame_2.setObjectName(_fromUtf8("frame_2")) | |
|
131 | self.gridLayout_10 = QtGui.QGridLayout(self.frame_2) | |
|
132 | self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) | |
|
133 | self.label_27 = QtGui.QLabel(self.frame_2) | |
|
134 | self.label_27.setObjectName(_fromUtf8("label_27")) | |
|
135 | self.gridLayout_10.addWidget(self.label_27, 0, 0, 1, 1) | |
|
136 | self.proComStartDate = QtGui.QComboBox(self.frame_2) | |
|
137 | self.proComStartDate.setObjectName(_fromUtf8("proComStartDate")) | |
|
138 | self.gridLayout_10.addWidget(self.proComStartDate, 0, 1, 1, 1) | |
|
139 | self.label_28 = QtGui.QLabel(self.frame_2) | |
|
140 | self.label_28.setObjectName(_fromUtf8("label_28")) | |
|
141 | self.gridLayout_10.addWidget(self.label_28, 1, 0, 1, 1) | |
|
142 | self.proComEndDate = QtGui.QComboBox(self.frame_2) | |
|
143 | self.proComEndDate.setObjectName(_fromUtf8("proComEndDate")) | |
|
144 | self.gridLayout_10.addWidget(self.proComEndDate, 1, 1, 1, 1) | |
|
145 | self.label_2 = QtGui.QLabel(self.frame_2) | |
|
146 | self.label_2.setObjectName(_fromUtf8("label_2")) | |
|
147 | self.gridLayout_10.addWidget(self.label_2, 2, 0, 1, 1) | |
|
148 | self.proStartTime = QtGui.QTimeEdit(self.frame_2) | |
|
149 | self.proStartTime.setObjectName(_fromUtf8("proStartTime")) | |
|
150 | self.gridLayout_10.addWidget(self.proStartTime, 2, 1, 1, 1) | |
|
151 | self.label_3 = QtGui.QLabel(self.frame_2) | |
|
152 | self.label_3.setObjectName(_fromUtf8("label_3")) | |
|
153 | self.gridLayout_10.addWidget(self.label_3, 3, 0, 1, 1) | |
|
154 | self.proEndTime = QtGui.QTimeEdit(self.frame_2) | |
|
155 | self.proEndTime.setObjectName(_fromUtf8("proEndTime")) | |
|
156 | self.gridLayout_10.addWidget(self.proEndTime, 3, 1, 1, 1) | |
|
157 | self.label_30 = QtGui.QLabel(self.frame_2) | |
|
158 | self.label_30.setObjectName(_fromUtf8("label_30")) | |
|
159 | self.gridLayout_10.addWidget(self.label_30, 4, 0, 1, 1) | |
|
160 | self.proDescription = QtGui.QTextEdit(self.frame_2) | |
|
161 | self.proDescription.setObjectName(_fromUtf8("proDescription")) | |
|
162 | self.gridLayout_10.addWidget(self.proDescription, 4, 1, 1, 1) | |
|
163 | self.gridLayout_15.addWidget(self.frame_2, 1, 0, 1, 1) | |
|
164 | self.frame_3 = QtGui.QFrame(self.tabProject) | |
|
165 | self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
166 | self.frame_3.setFrameShadow(QtGui.QFrame.Raised) | |
|
167 | self.frame_3.setObjectName(_fromUtf8("frame_3")) | |
|
168 | self.gridLayout_14 = QtGui.QGridLayout(self.frame_3) | |
|
169 | self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14")) | |
|
170 | self.proOk = QtGui.QPushButton(self.frame_3) | |
|
171 | self.proOk.setObjectName(_fromUtf8("proOk")) | |
|
172 | self.gridLayout_14.addWidget(self.proOk, 0, 0, 1, 1) | |
|
173 | self.proClear = QtGui.QPushButton(self.frame_3) | |
|
174 | self.proClear.setObjectName(_fromUtf8("proClear")) | |
|
175 | self.gridLayout_14.addWidget(self.proClear, 0, 1, 1, 1) | |
|
176 | self.gridLayout_15.addWidget(self.frame_3, 2, 0, 1, 1) | |
|
177 | self.tabWidgetProject.addTab(self.tabProject, _fromUtf8("")) | |
|
178 | self.tabVoltage = QtGui.QWidget() | |
|
179 | self.tabVoltage.setObjectName(_fromUtf8("tabVoltage")) | |
|
180 | self.gridLayout_3 = QtGui.QGridLayout(self.tabVoltage) | |
|
181 | self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) | |
|
182 | self.frame_4 = QtGui.QFrame(self.tabVoltage) | |
|
183 | self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
184 | self.frame_4.setFrameShadow(QtGui.QFrame.Raised) | |
|
185 | self.frame_4.setObjectName(_fromUtf8("frame_4")) | |
|
186 | self.gridLayout_17 = QtGui.QGridLayout(self.frame_4) | |
|
187 | self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) | |
|
188 | self.volOpOk = QtGui.QPushButton(self.frame_4) | |
|
189 | self.volOpOk.setObjectName(_fromUtf8("volOpOk")) | |
|
190 | self.gridLayout_17.addWidget(self.volOpOk, 0, 0, 1, 1) | |
|
191 | self.volGraphClear = QtGui.QPushButton(self.frame_4) | |
|
192 | self.volGraphClear.setObjectName(_fromUtf8("volGraphClear")) | |
|
193 | self.gridLayout_17.addWidget(self.volGraphClear, 0, 1, 1, 1) | |
|
194 | self.gridLayout_3.addWidget(self.frame_4, 1, 1, 1, 1) | |
|
195 | self.tabWidgetVoltage = QtGui.QTabWidget(self.tabVoltage) | |
|
196 | self.tabWidgetVoltage.setObjectName(_fromUtf8("tabWidgetVoltage")) | |
|
197 | self.tabopVoltage = QtGui.QWidget() | |
|
198 | self.tabopVoltage.setObjectName(_fromUtf8("tabopVoltage")) | |
|
199 | self.gridLayout = QtGui.QGridLayout(self.tabopVoltage) | |
|
200 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) | |
|
201 | self.volOpHeights = QtGui.QLineEdit(self.tabopVoltage) | |
|
202 | self.volOpHeights.setObjectName(_fromUtf8("volOpHeights")) | |
|
203 | self.gridLayout.addWidget(self.volOpHeights, 4, 4, 1, 1) | |
|
204 | self.volOpComHeights = QtGui.QComboBox(self.tabopVoltage) | |
|
205 | self.volOpComHeights.setObjectName(_fromUtf8("volOpComHeights")) | |
|
206 | self.volOpComHeights.addItem(_fromUtf8("")) | |
|
207 | self.volOpComHeights.addItem(_fromUtf8("")) | |
|
208 | self.gridLayout.addWidget(self.volOpComHeights, 4, 0, 1, 3) | |
|
209 | self.volOpComChannels = QtGui.QComboBox(self.tabopVoltage) | |
|
210 | self.volOpComChannels.setObjectName(_fromUtf8("volOpComChannels")) | |
|
211 | self.volOpComChannels.addItem(_fromUtf8("")) | |
|
212 | self.volOpComChannels.addItem(_fromUtf8("")) | |
|
213 | self.gridLayout.addWidget(self.volOpComChannels, 2, 0, 1, 3) | |
|
214 | self.volOpCebProfile = QtGui.QCheckBox(self.tabopVoltage) | |
|
215 | self.volOpCebProfile.setObjectName(_fromUtf8("volOpCebProfile")) | |
|
216 | self.gridLayout.addWidget(self.volOpCebProfile, 6, 0, 1, 3) | |
|
217 | self.volOpComProfile = QtGui.QComboBox(self.tabopVoltage) | |
|
218 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) | |
|
219 | self.volOpComProfile.addItem(_fromUtf8("")) | |
|
220 | self.volOpComProfile.addItem(_fromUtf8("")) | |
|
221 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) | |
|
222 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) | |
|
223 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) | |
|
224 | self.gridLayout.addWidget(self.volOpCebDecodification, 8, 0, 1, 3) | |
|
225 | self.volOpCebCohInt = QtGui.QCheckBox(self.tabopVoltage) | |
|
226 | self.volOpCebCohInt.setObjectName(_fromUtf8("volOpCebCohInt")) | |
|
227 | self.gridLayout.addWidget(self.volOpCebCohInt, 11, 0, 1, 3) | |
|
228 | self.volOpProfile = QtGui.QLineEdit(self.tabopVoltage) | |
|
229 | self.volOpProfile.setObjectName(_fromUtf8("volOpProfile")) | |
|
230 | self.gridLayout.addWidget(self.volOpProfile, 7, 4, 1, 1) | |
|
231 | self.volOpFilter = QtGui.QLineEdit(self.tabopVoltage) | |
|
232 | self.volOpFilter.setObjectName(_fromUtf8("volOpFilter")) | |
|
233 | self.gridLayout.addWidget(self.volOpFilter, 5, 4, 1, 1) | |
|
234 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
235 | self.gridLayout.addItem(spacerItem, 6, 4, 1, 1) | |
|
236 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
237 | self.gridLayout.addItem(spacerItem1, 8, 4, 1, 1) | |
|
238 | spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
239 | self.gridLayout.addItem(spacerItem2, 3, 4, 1, 1) | |
|
240 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) | |
|
241 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) | |
|
242 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) | |
|
243 | self.label_4 = QtGui.QLabel(self.tabopVoltage) | |
|
244 | self.label_4.setObjectName(_fromUtf8("label_4")) | |
|
245 | self.gridLayout.addWidget(self.label_4, 9, 2, 1, 1) | |
|
246 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) | |
|
247 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) | |
|
248 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) | |
|
249 | self.volOpCebHeights = QtGui.QCheckBox(self.tabopVoltage) | |
|
250 | self.volOpCebHeights.setObjectName(_fromUtf8("volOpCebHeights")) | |
|
251 | self.gridLayout.addWidget(self.volOpCebHeights, 3, 0, 1, 3) | |
|
252 | self.volOpCebFilter = QtGui.QCheckBox(self.tabopVoltage) | |
|
253 | self.volOpCebFilter.setObjectName(_fromUtf8("volOpCebFilter")) | |
|
254 | self.gridLayout.addWidget(self.volOpCebFilter, 5, 0, 1, 3) | |
|
255 | self.volOpRadarfrequency = QtGui.QLineEdit(self.tabopVoltage) | |
|
256 | self.volOpRadarfrequency.setObjectName(_fromUtf8("volOpRadarfrequency")) | |
|
257 | self.gridLayout.addWidget(self.volOpRadarfrequency, 0, 4, 1, 1) | |
|
258 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) | |
|
259 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) | |
|
260 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) | |
|
261 | self.label_5 = QtGui.QLabel(self.tabopVoltage) | |
|
262 | self.label_5.setObjectName(_fromUtf8("label_5")) | |
|
263 | self.gridLayout.addWidget(self.label_5, 10, 2, 1, 1) | |
|
264 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
265 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) | |
|
266 | self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage) | |
|
267 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) | |
|
268 | self.gridLayout.addWidget(self.volOpCohInt, 11, 4, 1, 1) | |
|
269 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) | |
|
270 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) | |
|
271 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
272 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
273 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
274 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
275 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
276 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
277 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
278 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
279 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
280 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
281 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
282 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
283 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
284 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) | |
|
285 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) | |
|
286 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) | |
|
287 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
288 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
289 | self.gridLayout.addWidget(self.volOpComMode, 10, 4, 1, 1) | |
|
290 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) | |
|
291 | self.tabgraphVoltage = QtGui.QWidget() | |
|
292 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) | |
|
293 | self.gridLayout_6 = QtGui.QGridLayout(self.tabgraphVoltage) | |
|
294 | self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) | |
|
295 | spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
296 | self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) | |
|
297 | self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
298 | self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) | |
|
299 | self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) | |
|
300 | self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
301 | self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) | |
|
302 | self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) | |
|
303 | self.volGraphToolPath = QtGui.QToolButton(self.tabgraphVoltage) | |
|
304 | self.volGraphToolPath.setObjectName(_fromUtf8("volGraphToolPath")) | |
|
305 | self.gridLayout_6.addWidget(self.volGraphToolPath, 1, 5, 1, 2) | |
|
306 | self.volGraphPath = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
307 | self.volGraphPath.setObjectName(_fromUtf8("volGraphPath")) | |
|
308 | self.gridLayout_6.addWidget(self.volGraphPath, 1, 1, 1, 4) | |
|
309 | self.label_14 = QtGui.QLabel(self.tabgraphVoltage) | |
|
310 | self.label_14.setObjectName(_fromUtf8("label_14")) | |
|
311 | self.gridLayout_6.addWidget(self.label_14, 6, 0, 1, 1) | |
|
312 | spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
313 | self.gridLayout_6.addItem(spacerItem5, 3, 3, 1, 1) | |
|
314 | self.label_8 = QtGui.QLabel(self.tabgraphVoltage) | |
|
315 | self.label_8.setObjectName(_fromUtf8("label_8")) | |
|
316 | self.gridLayout_6.addWidget(self.label_8, 8, 0, 1, 1) | |
|
317 | self.label_49 = QtGui.QLabel(self.tabgraphVoltage) | |
|
318 | self.label_49.setObjectName(_fromUtf8("label_49")) | |
|
319 | self.gridLayout_6.addWidget(self.label_49, 4, 3, 1, 1) | |
|
320 | self.label_51 = QtGui.QLabel(self.tabgraphVoltage) | |
|
321 | self.label_51.setObjectName(_fromUtf8("label_51")) | |
|
322 | self.gridLayout_6.addWidget(self.label_51, 9, 0, 1, 1) | |
|
323 | self.volGraphCebshow = QtGui.QCheckBox(self.tabgraphVoltage) | |
|
324 | self.volGraphCebshow.setText(_fromUtf8("")) | |
|
325 | self.volGraphCebshow.setObjectName(_fromUtf8("volGraphCebshow")) | |
|
326 | self.gridLayout_6.addWidget(self.volGraphCebshow, 6, 3, 1, 1) | |
|
327 | self.label_12 = QtGui.QLabel(self.tabgraphVoltage) | |
|
328 | self.label_12.setObjectName(_fromUtf8("label_12")) | |
|
329 | self.gridLayout_6.addWidget(self.label_12, 1, 0, 1, 1) | |
|
330 | self.label_13 = QtGui.QLabel(self.tabgraphVoltage) | |
|
331 | self.label_13.setObjectName(_fromUtf8("label_13")) | |
|
332 | self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) | |
|
333 | self.label_52 = QtGui.QLabel(self.tabgraphVoltage) | |
|
334 | self.label_52.setObjectName(_fromUtf8("label_52")) | |
|
335 | self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) | |
|
336 | spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
337 | self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) | |
|
338 | spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
339 | self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) | |
|
340 | self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
341 | self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) | |
|
342 | self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) | |
|
343 | self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
344 | self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) | |
|
345 | self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) | |
|
346 | self.label_50 = QtGui.QLabel(self.tabgraphVoltage) | |
|
347 | self.label_50.setObjectName(_fromUtf8("label_50")) | |
|
348 | self.gridLayout_6.addWidget(self.label_50, 4, 4, 1, 1) | |
|
349 | self.volGraphCebSave = QtGui.QCheckBox(self.tabgraphVoltage) | |
|
350 | self.volGraphCebSave.setText(_fromUtf8("")) | |
|
351 | self.volGraphCebSave.setObjectName(_fromUtf8("volGraphCebSave")) | |
|
352 | self.gridLayout_6.addWidget(self.volGraphCebSave, 6, 4, 1, 1) | |
|
353 | self.tabWidgetVoltage.addTab(self.tabgraphVoltage, _fromUtf8("")) | |
|
354 | self.taboutputVoltage = QtGui.QWidget() | |
|
355 | self.taboutputVoltage.setObjectName(_fromUtf8("taboutputVoltage")) | |
|
356 | self.gridLayout_12 = QtGui.QGridLayout(self.taboutputVoltage) | |
|
357 | self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) | |
|
358 | self.label_36 = QtGui.QLabel(self.taboutputVoltage) | |
|
359 | self.label_36.setObjectName(_fromUtf8("label_36")) | |
|
360 | self.gridLayout_12.addWidget(self.label_36, 0, 0, 1, 1) | |
|
361 | self.label_37 = QtGui.QLabel(self.taboutputVoltage) | |
|
362 | self.label_37.setObjectName(_fromUtf8("label_37")) | |
|
363 | self.gridLayout_12.addWidget(self.label_37, 1, 0, 1, 1) | |
|
364 | self.volOutputPath = QtGui.QLineEdit(self.taboutputVoltage) | |
|
365 | self.volOutputPath.setObjectName(_fromUtf8("volOutputPath")) | |
|
366 | self.gridLayout_12.addWidget(self.volOutputPath, 1, 2, 1, 1) | |
|
367 | self.volOutputToolPath = QtGui.QToolButton(self.taboutputVoltage) | |
|
368 | self.volOutputToolPath.setObjectName(_fromUtf8("volOutputToolPath")) | |
|
369 | self.gridLayout_12.addWidget(self.volOutputToolPath, 1, 3, 1, 1) | |
|
370 | self.volOutputComData = QtGui.QComboBox(self.taboutputVoltage) | |
|
371 | self.volOutputComData.setObjectName(_fromUtf8("volOutputComData")) | |
|
372 | self.volOutputComData.addItem(_fromUtf8("")) | |
|
373 | self.gridLayout_12.addWidget(self.volOutputComData, 0, 2, 1, 2) | |
|
374 | spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
375 | self.gridLayout_12.addItem(spacerItem8, 5, 2, 1, 1) | |
|
376 | self.volOutputblocksperfile = QtGui.QLineEdit(self.taboutputVoltage) | |
|
377 | self.volOutputblocksperfile.setObjectName(_fromUtf8("volOutputblocksperfile")) | |
|
378 | self.gridLayout_12.addWidget(self.volOutputblocksperfile, 3, 2, 1, 1) | |
|
379 | self.label_7 = QtGui.QLabel(self.taboutputVoltage) | |
|
380 | self.label_7.setObjectName(_fromUtf8("label_7")) | |
|
381 | self.gridLayout_12.addWidget(self.label_7, 3, 0, 1, 1) | |
|
382 | self.label_35 = QtGui.QLabel(self.taboutputVoltage) | |
|
383 | self.label_35.setObjectName(_fromUtf8("label_35")) | |
|
384 | self.gridLayout_12.addWidget(self.label_35, 4, 0, 1, 1) | |
|
385 | self.volOutputprofilesperblock = QtGui.QLineEdit(self.taboutputVoltage) | |
|
386 | self.volOutputprofilesperblock.setObjectName(_fromUtf8("volOutputprofilesperblock")) | |
|
387 | self.gridLayout_12.addWidget(self.volOutputprofilesperblock, 4, 2, 1, 1) | |
|
388 | self.tabWidgetVoltage.addTab(self.taboutputVoltage, _fromUtf8("")) | |
|
389 | self.gridLayout_3.addWidget(self.tabWidgetVoltage, 0, 1, 1, 1) | |
|
390 | self.tabWidgetProject.addTab(self.tabVoltage, _fromUtf8("")) | |
|
391 | self.tabSpectra = QtGui.QWidget() | |
|
392 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) | |
|
393 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) | |
|
394 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) | |
|
395 | self.frame_5 = QtGui.QFrame(self.tabSpectra) | |
|
396 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
397 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) | |
|
398 | self.frame_5.setObjectName(_fromUtf8("frame_5")) | |
|
399 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) | |
|
400 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) | |
|
401 | self.specOpOk = QtGui.QPushButton(self.frame_5) | |
|
402 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) | |
|
403 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) | |
|
404 | self.specGraphClear = QtGui.QPushButton(self.frame_5) | |
|
405 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) | |
|
406 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) | |
|
407 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) | |
|
408 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) | |
|
409 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) | |
|
410 | self.tabopSpectra = QtGui.QWidget() | |
|
411 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) | |
|
412 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) | |
|
413 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) | |
|
414 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) | |
|
415 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) | |
|
416 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2) | |
|
417 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) | |
|
418 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) | |
|
419 | self.specOpComChannel.addItem(_fromUtf8("")) | |
|
420 | self.specOpComChannel.addItem(_fromUtf8("")) | |
|
421 | self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2) | |
|
422 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) | |
|
423 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) | |
|
424 | self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2) | |
|
425 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) | |
|
426 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) | |
|
427 | self.specOpComHeights.addItem(_fromUtf8("")) | |
|
428 | self.specOpComHeights.addItem(_fromUtf8("")) | |
|
429 | self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2) | |
|
430 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) | |
|
431 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) | |
|
432 | self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2) | |
|
433 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) | |
|
434 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) | |
|
435 | self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2) | |
|
436 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) | |
|
437 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) | |
|
438 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2) | |
|
439 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) | |
|
440 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) | |
|
441 | self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1) | |
|
442 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) | |
|
443 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) | |
|
444 | self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1) | |
|
445 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) | |
|
446 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) | |
|
447 | self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2) | |
|
448 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) | |
|
449 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) | |
|
450 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2) | |
|
451 | self.label_31 = QtGui.QLabel(self.tabopSpectra) | |
|
452 | self.label_31.setObjectName(_fromUtf8("label_31")) | |
|
453 | self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2) | |
|
454 | self.label_26 = QtGui.QLabel(self.tabopSpectra) | |
|
455 | self.label_26.setObjectName(_fromUtf8("label_26")) | |
|
456 | self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2) | |
|
457 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) | |
|
458 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) | |
|
459 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1) | |
|
460 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) | |
|
461 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) | |
|
462 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
|
463 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
|
464 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2) | |
|
465 | spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
466 | self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) | |
|
467 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) | |
|
468 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) | |
|
469 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2) | |
|
470 | spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
471 | self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) | |
|
472 | spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
473 | self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) | |
|
474 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) | |
|
475 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) | |
|
476 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) | |
|
477 | spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
478 | self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) | |
|
479 | self.label_21 = QtGui.QLabel(self.tabopSpectra) | |
|
480 | self.label_21.setObjectName(_fromUtf8("label_21")) | |
|
481 | self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) | |
|
482 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) | |
|
483 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) | |
|
484 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2) | |
|
485 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) | |
|
486 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) | |
|
487 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) | |
|
488 | spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
489 | self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) | |
|
490 | self.label_70 = QtGui.QLabel(self.tabopSpectra) | |
|
491 | self.label_70.setObjectName(_fromUtf8("label_70")) | |
|
492 | self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) | |
|
493 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) | |
|
494 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) | |
|
495 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1) | |
|
496 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) | |
|
497 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) | |
|
498 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2) | |
|
499 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) | |
|
500 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) | |
|
501 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
|
502 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
|
503 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2) | |
|
504 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) | |
|
505 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) | |
|
506 | self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) | |
|
507 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) | |
|
508 | self.tabgraphSpectra = QtGui.QWidget() | |
|
509 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) | |
|
510 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) | |
|
511 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) | |
|
512 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) | |
|
513 | self.label_44.setObjectName(_fromUtf8("label_44")) | |
|
514 | self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) | |
|
515 | spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
516 | self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) | |
|
517 | self.label_20 = QtGui.QLabel(self.tabgraphSpectra) | |
|
518 | self.label_20.setObjectName(_fromUtf8("label_20")) | |
|
519 | self.gridLayout_9.addWidget(self.label_20, 21, 0, 1, 1) | |
|
520 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
521 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) | |
|
522 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) | |
|
523 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 4, 1, 1) | |
|
524 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
525 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) | |
|
526 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, 20, 1, 1, 7) | |
|
527 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
528 | self.specGraphSaveSpectra.setText(_fromUtf8("")) | |
|
529 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) | |
|
530 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 4, 1, 1) | |
|
531 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
532 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) | |
|
533 | self.gridLayout_9.addWidget(self.specGgraphChannelList, 15, 1, 1, 7) | |
|
534 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) | |
|
535 | self.label_25.setObjectName(_fromUtf8("label_25")) | |
|
536 | self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) | |
|
537 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
538 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) | |
|
539 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, 21, 1, 1, 7) | |
|
540 | spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
541 | self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) | |
|
542 | spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
543 | self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) | |
|
544 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) | |
|
545 | self.label_42.setObjectName(_fromUtf8("label_42")) | |
|
546 | self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) | |
|
547 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) | |
|
548 | self.label_16.setObjectName(_fromUtf8("label_16")) | |
|
549 | self.gridLayout_9.addWidget(self.label_16, 18, 0, 1, 1) | |
|
550 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) | |
|
551 | self.label_17.setObjectName(_fromUtf8("label_17")) | |
|
552 | self.gridLayout_9.addWidget(self.label_17, 19, 0, 1, 1) | |
|
553 | self.label_18 = QtGui.QLabel(self.tabgraphSpectra) | |
|
554 | self.label_18.setObjectName(_fromUtf8("label_18")) | |
|
555 | self.gridLayout_9.addWidget(self.label_18, 20, 0, 1, 1) | |
|
556 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
557 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) | |
|
558 | self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 1, 1, 7) | |
|
559 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
560 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) | |
|
561 | self.gridLayout_9.addWidget(self.specGgraphHeight, 18, 1, 1, 7) | |
|
562 | spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
563 | self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) | |
|
564 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) | |
|
565 | self.label_24.setObjectName(_fromUtf8("label_24")) | |
|
566 | self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) | |
|
567 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
568 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) | |
|
569 | self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) | |
|
570 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
571 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) | |
|
572 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, 19, 1, 1, 7) | |
|
573 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) | |
|
574 | self.label_46.setObjectName(_fromUtf8("label_46")) | |
|
575 | self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) | |
|
576 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) | |
|
577 | self.label_22.setObjectName(_fromUtf8("label_22")) | |
|
578 | self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) | |
|
579 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
580 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) | |
|
581 | self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) | |
|
582 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) | |
|
583 | self.label_41.setObjectName(_fromUtf8("label_41")) | |
|
584 | self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) | |
|
585 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) | |
|
586 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) | |
|
587 | self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) | |
|
588 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) | |
|
589 | self.label_6.setObjectName(_fromUtf8("label_6")) | |
|
590 | self.gridLayout_9.addWidget(self.label_6, 15, 0, 1, 1) | |
|
591 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) | |
|
592 | self.label_40.setObjectName(_fromUtf8("label_40")) | |
|
593 | self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) | |
|
594 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
595 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) | |
|
596 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) | |
|
597 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 2, 1, 1) | |
|
598 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
599 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) | |
|
600 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) | |
|
601 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 2, 1, 1) | |
|
602 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
603 | self.specGraphCebRTIplot.setText(_fromUtf8("")) | |
|
604 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) | |
|
605 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 2, 1, 1) | |
|
606 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
607 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) | |
|
608 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) | |
|
609 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 2, 1, 1) | |
|
610 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
611 | self.specGraphPowerprofile.setText(_fromUtf8("")) | |
|
612 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) | |
|
613 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 2, 1, 1) | |
|
614 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
615 | self.specGraphSaveCross.setText(_fromUtf8("")) | |
|
616 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) | |
|
617 | self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 4, 1, 1) | |
|
618 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
619 | self.specGraphftpSpectra.setText(_fromUtf8("")) | |
|
620 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) | |
|
621 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 6, 1, 1) | |
|
622 | spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
623 | self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) | |
|
624 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
625 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) | |
|
626 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) | |
|
627 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 4, 1, 1) | |
|
628 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
629 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) | |
|
630 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) | |
|
631 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 4, 1, 1) | |
|
632 | spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
633 | self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) | |
|
634 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
635 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) | |
|
636 | self.gridLayout_9.addWidget(self.specGgraphftpratio, 23, 1, 1, 7) | |
|
637 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) | |
|
638 | self.label_43.setObjectName(_fromUtf8("label_43")) | |
|
639 | self.gridLayout_9.addWidget(self.label_43, 3, 2, 2, 1) | |
|
640 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
641 | self.specGraphftpCross.setText(_fromUtf8("")) | |
|
642 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) | |
|
643 | self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 6, 1, 1) | |
|
644 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) | |
|
645 | self.label_29.setObjectName(_fromUtf8("label_29")) | |
|
646 | self.gridLayout_9.addWidget(self.label_29, 23, 0, 1, 1) | |
|
647 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) | |
|
648 | self.label_47.setObjectName(_fromUtf8("label_47")) | |
|
649 | self.gridLayout_9.addWidget(self.label_47, 3, 4, 2, 1) | |
|
650 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
651 | self.specGraphftpRTIplot.setText(_fromUtf8("")) | |
|
652 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) | |
|
653 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 6, 1, 1) | |
|
654 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
655 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) | |
|
656 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) | |
|
657 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 6, 1, 1) | |
|
658 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
659 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) | |
|
660 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) | |
|
661 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 6, 1, 1) | |
|
662 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) | |
|
663 | self.label_19.setObjectName(_fromUtf8("label_19")) | |
|
664 | self.gridLayout_9.addWidget(self.label_19, 3, 6, 2, 2) | |
|
665 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
666 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) | |
|
667 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) | |
|
668 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 4, 1, 1) | |
|
669 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) | |
|
670 | self.label_45.setObjectName(_fromUtf8("label_45")) | |
|
671 | self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) | |
|
672 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
673 | self.specGraphftpRTInoise.setText(_fromUtf8("")) | |
|
674 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) | |
|
675 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 6, 1, 1) | |
|
676 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
677 | self.specGraphCebRTInoise.setText(_fromUtf8("")) | |
|
678 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) | |
|
679 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 2, 1, 1) | |
|
680 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) | |
|
681 | self.label_48.setObjectName(_fromUtf8("label_48")) | |
|
682 | self.gridLayout_9.addWidget(self.label_48, 22, 0, 1, 1) | |
|
683 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
684 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) | |
|
685 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, 22, 1, 1, 7) | |
|
686 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) | |
|
687 | self.taboutputSpectra = QtGui.QWidget() | |
|
688 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) | |
|
689 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) | |
|
690 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) | |
|
691 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) | |
|
692 | self.label_39.setObjectName(_fromUtf8("label_39")) | |
|
693 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) | |
|
694 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) | |
|
695 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) | |
|
696 | self.specOutputComData.addItem(_fromUtf8("")) | |
|
697 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) | |
|
698 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) | |
|
699 | self.label_34.setObjectName(_fromUtf8("label_34")) | |
|
700 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) | |
|
701 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) | |
|
702 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) | |
|
703 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) | |
|
704 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
705 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) | |
|
706 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) | |
|
707 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) | |
|
708 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) | |
|
709 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) | |
|
710 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) | |
|
711 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) | |
|
712 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) | |
|
713 | self.label_9.setObjectName(_fromUtf8("label_9")) | |
|
714 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) | |
|
715 | self.label_38 = QtGui.QLabel(self.taboutputSpectra) | |
|
716 | self.label_38.setObjectName(_fromUtf8("label_38")) | |
|
717 | self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) | |
|
718 | self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) | |
|
719 | self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) | |
|
720 | self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) | |
|
721 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) | |
|
722 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) | |
|
723 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) | |
|
724 | self.tabSpectraHeis = QtGui.QWidget() | |
|
725 | self.tabSpectraHeis.setObjectName(_fromUtf8("tabSpectraHeis")) | |
|
726 | self.gridLayout_23 = QtGui.QGridLayout(self.tabSpectraHeis) | |
|
727 | self.gridLayout_23.setObjectName(_fromUtf8("gridLayout_23")) | |
|
728 | self.frame_6 = QtGui.QFrame(self.tabSpectraHeis) | |
|
729 | self.frame_6.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
730 | self.frame_6.setFrameShadow(QtGui.QFrame.Raised) | |
|
731 | self.frame_6.setObjectName(_fromUtf8("frame_6")) | |
|
732 | self.gridLayout_22 = QtGui.QGridLayout(self.frame_6) | |
|
733 | self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) | |
|
734 | self.specHeisGraphClear = QtGui.QPushButton(self.frame_6) | |
|
735 | self.specHeisGraphClear.setObjectName(_fromUtf8("specHeisGraphClear")) | |
|
736 | self.gridLayout_22.addWidget(self.specHeisGraphClear, 0, 1, 1, 1) | |
|
737 | self.specHeisOpOk = QtGui.QPushButton(self.frame_6) | |
|
738 | self.specHeisOpOk.setObjectName(_fromUtf8("specHeisOpOk")) | |
|
739 | self.gridLayout_22.addWidget(self.specHeisOpOk, 0, 0, 1, 1) | |
|
740 | self.gridLayout_23.addWidget(self.frame_6, 1, 0, 1, 1) | |
|
741 | self.tabWidgetSpectraHeis = QtGui.QTabWidget(self.tabSpectraHeis) | |
|
742 | self.tabWidgetSpectraHeis.setObjectName(_fromUtf8("tabWidgetSpectraHeis")) | |
|
743 | self.tabopSpectraHeis = QtGui.QWidget() | |
|
744 | self.tabopSpectraHeis.setObjectName(_fromUtf8("tabopSpectraHeis")) | |
|
745 | self.gridLayout_21 = QtGui.QGridLayout(self.tabopSpectraHeis) | |
|
746 | self.gridLayout_21.setObjectName(_fromUtf8("gridLayout_21")) | |
|
747 | spacerItem21 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
748 | self.gridLayout_21.addItem(spacerItem21, 0, 1, 1, 1) | |
|
749 | self.specHeisOpCobIncInt = QtGui.QComboBox(self.tabopSpectraHeis) | |
|
750 | self.specHeisOpCobIncInt.setObjectName(_fromUtf8("specHeisOpCobIncInt")) | |
|
751 | self.specHeisOpCobIncInt.addItem(_fromUtf8("")) | |
|
752 | self.gridLayout_21.addWidget(self.specHeisOpCobIncInt, 1, 0, 1, 1) | |
|
753 | self.specHeisOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectraHeis) | |
|
754 | self.specHeisOpCebIncoherent.setObjectName(_fromUtf8("specHeisOpCebIncoherent")) | |
|
755 | self.gridLayout_21.addWidget(self.specHeisOpCebIncoherent, 0, 0, 1, 1) | |
|
756 | self.specHeisOpIncoherent = QtGui.QLineEdit(self.tabopSpectraHeis) | |
|
757 | self.specHeisOpIncoherent.setObjectName(_fromUtf8("specHeisOpIncoherent")) | |
|
758 | self.gridLayout_21.addWidget(self.specHeisOpIncoherent, 1, 1, 1, 1) | |
|
759 | spacerItem22 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
760 | self.gridLayout_21.addItem(spacerItem22, 2, 0, 1, 1) | |
|
761 | self.tabWidgetSpectraHeis.addTab(self.tabopSpectraHeis, _fromUtf8("")) | |
|
762 | self.tabgraphSpectraHeis = QtGui.QWidget() | |
|
763 | self.tabgraphSpectraHeis.setObjectName(_fromUtf8("tabgraphSpectraHeis")) | |
|
764 | self.gridLayout_20 = QtGui.QGridLayout(self.tabgraphSpectraHeis) | |
|
765 | self.gridLayout_20.setObjectName(_fromUtf8("gridLayout_20")) | |
|
766 | self.label_54 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
767 | self.label_54.setObjectName(_fromUtf8("label_54")) | |
|
768 | self.gridLayout_20.addWidget(self.label_54, 1, 0, 1, 1) | |
|
769 | self.specHeisGraphToolPath = QtGui.QToolButton(self.tabgraphSpectraHeis) | |
|
770 | self.specHeisGraphToolPath.setObjectName(_fromUtf8("specHeisGraphToolPath")) | |
|
771 | self.gridLayout_20.addWidget(self.specHeisGraphToolPath, 0, 6, 1, 1) | |
|
772 | self.specHeisGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
773 | self.specHeisGraphCebRTIplot.setText(_fromUtf8("")) | |
|
774 | self.specHeisGraphCebRTIplot.setObjectName(_fromUtf8("specHeisGraphCebRTIplot")) | |
|
775 | self.gridLayout_20.addWidget(self.specHeisGraphCebRTIplot, 4, 2, 1, 1) | |
|
776 | self.label_62 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
777 | self.label_62.setObjectName(_fromUtf8("label_62")) | |
|
778 | self.gridLayout_20.addWidget(self.label_62, 7, 0, 1, 1) | |
|
779 | self.label_63 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
780 | self.label_63.setObjectName(_fromUtf8("label_63")) | |
|
781 | self.gridLayout_20.addWidget(self.label_63, 8, 0, 1, 1) | |
|
782 | self.label_64 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
783 | self.label_64.setObjectName(_fromUtf8("label_64")) | |
|
784 | self.gridLayout_20.addWidget(self.label_64, 9, 0, 1, 1) | |
|
785 | self.label_65 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
786 | self.label_65.setObjectName(_fromUtf8("label_65")) | |
|
787 | self.gridLayout_20.addWidget(self.label_65, 10, 0, 1, 1) | |
|
788 | spacerItem23 = QtGui.QSpacerItem(134, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
789 | self.gridLayout_20.addItem(spacerItem23, 11, 0, 1, 2) | |
|
790 | self.specHeisGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
791 | self.specHeisGgraphftpratio.setObjectName(_fromUtf8("specHeisGgraphftpratio")) | |
|
792 | self.gridLayout_20.addWidget(self.specHeisGgraphftpratio, 10, 1, 1, 6) | |
|
793 | self.specHeisGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
794 | self.specHeisGraphftpRTIplot.setText(_fromUtf8("")) | |
|
795 | self.specHeisGraphftpRTIplot.setObjectName(_fromUtf8("specHeisGraphftpRTIplot")) | |
|
796 | self.gridLayout_20.addWidget(self.specHeisGraphftpRTIplot, 4, 6, 1, 1) | |
|
797 | self.specHeisGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
798 | self.specHeisGgraphTminTmax.setObjectName(_fromUtf8("specHeisGgraphTminTmax")) | |
|
799 | self.gridLayout_20.addWidget(self.specHeisGgraphTminTmax, 8, 1, 1, 6) | |
|
800 | self.label_60 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
801 | self.label_60.setObjectName(_fromUtf8("label_60")) | |
|
802 | self.gridLayout_20.addWidget(self.label_60, 5, 0, 1, 1) | |
|
803 | self.label_61 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
804 | self.label_61.setObjectName(_fromUtf8("label_61")) | |
|
805 | self.gridLayout_20.addWidget(self.label_61, 6, 0, 1, 1) | |
|
806 | self.specHeisGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
807 | self.specHeisGraphPrefix.setObjectName(_fromUtf8("specHeisGraphPrefix")) | |
|
808 | self.gridLayout_20.addWidget(self.specHeisGraphPrefix, 1, 1, 1, 6) | |
|
809 | self.label_56 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
810 | self.label_56.setObjectName(_fromUtf8("label_56")) | |
|
811 | self.gridLayout_20.addWidget(self.label_56, 2, 4, 1, 1) | |
|
812 | self.label_57 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
813 | self.label_57.setObjectName(_fromUtf8("label_57")) | |
|
814 | self.gridLayout_20.addWidget(self.label_57, 2, 6, 1, 1) | |
|
815 | self.label_58 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
816 | self.label_58.setObjectName(_fromUtf8("label_58")) | |
|
817 | self.gridLayout_20.addWidget(self.label_58, 3, 0, 1, 1) | |
|
818 | self.specHeisGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
819 | self.specHeisGraphCebSpectraplot.setText(_fromUtf8("")) | |
|
820 | self.specHeisGraphCebSpectraplot.setObjectName(_fromUtf8("specHeisGraphCebSpectraplot")) | |
|
821 | self.gridLayout_20.addWidget(self.specHeisGraphCebSpectraplot, 3, 2, 1, 1) | |
|
822 | self.specHeisGgraphYminYmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
823 | self.specHeisGgraphYminYmax.setObjectName(_fromUtf8("specHeisGgraphYminYmax")) | |
|
824 | self.gridLayout_20.addWidget(self.specHeisGgraphYminYmax, 7, 1, 1, 6) | |
|
825 | self.label_53 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
826 | self.label_53.setObjectName(_fromUtf8("label_53")) | |
|
827 | self.gridLayout_20.addWidget(self.label_53, 0, 0, 1, 1) | |
|
828 | self.label_55 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
829 | self.label_55.setObjectName(_fromUtf8("label_55")) | |
|
830 | self.gridLayout_20.addWidget(self.label_55, 2, 2, 1, 1) | |
|
831 | self.specHeisGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
832 | self.specHeisGraphSaveRTIplot.setText(_fromUtf8("")) | |
|
833 | self.specHeisGraphSaveRTIplot.setObjectName(_fromUtf8("specHeisGraphSaveRTIplot")) | |
|
834 | self.gridLayout_20.addWidget(self.specHeisGraphSaveRTIplot, 4, 4, 1, 1) | |
|
835 | spacerItem24 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
836 | self.gridLayout_20.addItem(spacerItem24, 2, 3, 1, 1) | |
|
837 | self.specHeisGgraphXminXmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
838 | self.specHeisGgraphXminXmax.setObjectName(_fromUtf8("specHeisGgraphXminXmax")) | |
|
839 | self.gridLayout_20.addWidget(self.specHeisGgraphXminXmax, 6, 1, 1, 6) | |
|
840 | self.specHeisGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
841 | self.specHeisGgraphChannelList.setObjectName(_fromUtf8("specHeisGgraphChannelList")) | |
|
842 | self.gridLayout_20.addWidget(self.specHeisGgraphChannelList, 5, 1, 1, 6) | |
|
843 | self.specHeisGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
844 | self.specHeisGgraphTimeRange.setObjectName(_fromUtf8("specHeisGgraphTimeRange")) | |
|
845 | self.gridLayout_20.addWidget(self.specHeisGgraphTimeRange, 9, 1, 1, 6) | |
|
846 | spacerItem25 = QtGui.QSpacerItem(106, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
847 | self.gridLayout_20.addItem(spacerItem25, 11, 3, 1, 3) | |
|
848 | self.specHeisGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
849 | self.specHeisGraphSaveSpectra.setText(_fromUtf8("")) | |
|
850 | self.specHeisGraphSaveSpectra.setObjectName(_fromUtf8("specHeisGraphSaveSpectra")) | |
|
851 | self.gridLayout_20.addWidget(self.specHeisGraphSaveSpectra, 3, 4, 1, 1) | |
|
852 | self.specHeisGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
853 | self.specHeisGraphftpSpectra.setText(_fromUtf8("")) | |
|
854 | self.specHeisGraphftpSpectra.setObjectName(_fromUtf8("specHeisGraphftpSpectra")) | |
|
855 | self.gridLayout_20.addWidget(self.specHeisGraphftpSpectra, 3, 6, 1, 1) | |
|
856 | self.label_59 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
857 | self.label_59.setObjectName(_fromUtf8("label_59")) | |
|
858 | self.gridLayout_20.addWidget(self.label_59, 4, 0, 1, 1) | |
|
859 | spacerItem26 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
860 | self.gridLayout_20.addItem(spacerItem26, 2, 5, 1, 1) | |
|
861 | self.specHeisGraphPath = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
862 | self.specHeisGraphPath.setObjectName(_fromUtf8("specHeisGraphPath")) | |
|
863 | self.gridLayout_20.addWidget(self.specHeisGraphPath, 0, 1, 1, 5) | |
|
864 | self.tabWidgetSpectraHeis.addTab(self.tabgraphSpectraHeis, _fromUtf8("")) | |
|
865 | self.taboutputSpectraHeis = QtGui.QWidget() | |
|
866 | self.taboutputSpectraHeis.setObjectName(_fromUtf8("taboutputSpectraHeis")) | |
|
867 | self.gridLayout_19 = QtGui.QGridLayout(self.taboutputSpectraHeis) | |
|
868 | self.gridLayout_19.setObjectName(_fromUtf8("gridLayout_19")) | |
|
869 | self.label_67 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
870 | self.label_67.setObjectName(_fromUtf8("label_67")) | |
|
871 | self.gridLayout_19.addWidget(self.label_67, 1, 0, 1, 1) | |
|
872 | self.label_68 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
873 | self.label_68.setObjectName(_fromUtf8("label_68")) | |
|
874 | self.gridLayout_19.addWidget(self.label_68, 2, 0, 1, 2) | |
|
875 | self.label_66 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
876 | self.label_66.setObjectName(_fromUtf8("label_66")) | |
|
877 | self.gridLayout_19.addWidget(self.label_66, 0, 0, 1, 1) | |
|
878 | spacerItem27 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
879 | self.gridLayout_19.addItem(spacerItem27, 4, 0, 1, 1) | |
|
880 | self.specHeisOutputToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) | |
|
881 | self.specHeisOutputToolPath.setObjectName(_fromUtf8("specHeisOutputToolPath")) | |
|
882 | self.gridLayout_19.addWidget(self.specHeisOutputToolPath, 1, 4, 1, 1) | |
|
883 | self.specHeisOutputPath = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
884 | self.specHeisOutputPath.setObjectName(_fromUtf8("specHeisOutputPath")) | |
|
885 | self.gridLayout_19.addWidget(self.specHeisOutputPath, 1, 3, 1, 1) | |
|
886 | self.specHeisOutputComdata = QtGui.QComboBox(self.taboutputSpectraHeis) | |
|
887 | self.specHeisOutputComdata.setObjectName(_fromUtf8("specHeisOutputComdata")) | |
|
888 | self.specHeisOutputComdata.addItem(_fromUtf8("")) | |
|
889 | self.gridLayout_19.addWidget(self.specHeisOutputComdata, 0, 3, 1, 2) | |
|
890 | self.label_69 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
891 | self.label_69.setObjectName(_fromUtf8("label_69")) | |
|
892 | self.gridLayout_19.addWidget(self.label_69, 3, 0, 1, 2) | |
|
893 | self.specHeisOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
894 | self.specHeisOutputblocksperfile.setObjectName(_fromUtf8("specHeisOutputblocksperfile")) | |
|
895 | self.gridLayout_19.addWidget(self.specHeisOutputblocksperfile, 2, 3, 1, 1) | |
|
896 | self.specHeisOutputMetada = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
897 | self.specHeisOutputMetada.setObjectName(_fromUtf8("specHeisOutputMetada")) | |
|
898 | self.gridLayout_19.addWidget(self.specHeisOutputMetada, 3, 3, 1, 1) | |
|
899 | self.specHeisOutputMetadaToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) | |
|
900 | self.specHeisOutputMetadaToolPath.setObjectName(_fromUtf8("specHeisOutputMetadaToolPath")) | |
|
901 | self.gridLayout_19.addWidget(self.specHeisOutputMetadaToolPath, 3, 4, 1, 1) | |
|
902 | self.tabWidgetSpectraHeis.addTab(self.taboutputSpectraHeis, _fromUtf8("")) | |
|
903 | self.gridLayout_23.addWidget(self.tabWidgetSpectraHeis, 0, 0, 1, 1) | |
|
904 | self.tabWidgetProject.addTab(self.tabSpectraHeis, _fromUtf8("")) | |
|
905 | self.tabCorrelation = QtGui.QWidget() | |
|
906 | self.tabCorrelation.setObjectName(_fromUtf8("tabCorrelation")) | |
|
907 | self.gridLayout_13 = QtGui.QGridLayout(self.tabCorrelation) | |
|
908 | self.gridLayout_13.setObjectName(_fromUtf8("gridLayout_13")) | |
|
909 | self.tabWidget_2 = QtGui.QTabWidget(self.tabCorrelation) | |
|
910 | self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2")) | |
|
911 | self.tabopCorrelation = QtGui.QWidget() | |
|
912 | self.tabopCorrelation.setObjectName(_fromUtf8("tabopCorrelation")) | |
|
913 | self.tabWidget_2.addTab(self.tabopCorrelation, _fromUtf8("")) | |
|
914 | self.tabopCorrelation1 = QtGui.QWidget() | |
|
915 | self.tabopCorrelation1.setObjectName(_fromUtf8("tabopCorrelation1")) | |
|
916 | self.tabWidget_2.addTab(self.tabopCorrelation1, _fromUtf8("")) | |
|
917 | self.gridLayout_13.addWidget(self.tabWidget_2, 0, 0, 1, 1) | |
|
918 | self.tabWidgetProject.addTab(self.tabCorrelation, _fromUtf8("")) | |
|
919 | ||
|
920 | ||
|
921 | self.tabConsole = QtGui.QTabWidget(self.splitter) | |
|
922 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) | |
|
923 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) | |
|
924 | self.tab_5 = QtGui.QWidget() | |
|
925 | self.tab_5.setObjectName(_fromUtf8("tab_5")) | |
|
926 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) | |
|
927 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) | |
|
928 | self.console = QtGui.QTextEdit(self.tab_5) | |
|
929 | self.console.setObjectName(_fromUtf8("console")) | |
|
930 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) | |
|
931 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) | |
|
932 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) | |
|
933 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) | |
|
934 | self.tabProjectProperty = QtGui.QWidget() | |
|
935 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) | |
|
936 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) | |
|
937 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) | |
|
938 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) | |
|
939 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) | |
|
940 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) | |
|
941 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) | |
|
942 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) | |
|
943 | MainWindow.setCentralWidget(self.centralWidget) | |
|
944 | self.toolBar = QtGui.QToolBar(MainWindow) | |
|
945 | self.toolBar.setObjectName(_fromUtf8("toolBar")) | |
|
946 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) | |
|
947 | self.menuBar = QtGui.QMenuBar(MainWindow) | |
|
948 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) | |
|
949 | self.menuBar.setObjectName(_fromUtf8("menuBar")) | |
|
950 | self.menuProject = QtGui.QMenu(self.menuBar) | |
|
951 | self.menuProject.setObjectName(_fromUtf8("menuProject")) | |
|
952 | self.menuRun = QtGui.QMenu(self.menuBar) | |
|
953 | self.menuRun.setObjectName(_fromUtf8("menuRun")) | |
|
954 | self.menuOptions = QtGui.QMenu(self.menuBar) | |
|
955 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) | |
|
956 | self.menuHelp = QtGui.QMenu(self.menuBar) | |
|
957 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) | |
|
958 | MainWindow.setMenuBar(self.menuBar) | |
|
959 | self.actionOpen = QtGui.QAction(MainWindow) | |
|
960 | ||
|
961 | iconOpen = QtGui.QIcon() | |
|
962 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
963 | ||
|
964 | iconCreate = QtGui.QIcon() | |
|
965 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
966 | ||
|
967 | iconSave = QtGui.QIcon() | |
|
968 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
969 | ||
|
970 | iconStart = QtGui.QIcon() | |
|
971 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
972 | ||
|
973 | iconStop = QtGui.QIcon() | |
|
974 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
975 | ||
|
976 | iconPause = QtGui.QIcon() | |
|
977 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
978 | ||
|
979 | iconAddPU = QtGui.QIcon() | |
|
980 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
981 | ||
|
982 | self.actionOpen.setIcon(iconOpen) | |
|
983 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) | |
|
984 | self.actionCreate = QtGui.QAction(MainWindow) | |
|
985 | self.actionCreate.setIcon(iconCreate) | |
|
986 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) | |
|
987 | self.actionSave = QtGui.QAction(MainWindow) | |
|
988 | self.actionSave.setIcon(iconSave) | |
|
989 | self.actionSave.setObjectName(_fromUtf8("actionSave")) | |
|
990 | self.actionClose = QtGui.QAction(MainWindow) | |
|
991 | self.actionClose.setObjectName(_fromUtf8("actionClose")) | |
|
992 | self.actionStart = QtGui.QAction(MainWindow) | |
|
993 | self.actionStart.setIcon(iconStart) | |
|
994 | self.actionStart.setObjectName(_fromUtf8("actionStart")) | |
|
995 | self.actionPause = QtGui.QAction(MainWindow) | |
|
996 | self.actionPause.setIcon(iconPause) | |
|
997 | self.actionPause.setObjectName(_fromUtf8("actionPause")) | |
|
998 | self.actionStop = QtGui.QAction(MainWindow) | |
|
999 | self.actionStop.setIcon(iconStop) | |
|
1000 | self.actionStop.setObjectName(_fromUtf8("actionStop")) | |
|
1001 | self.actionAbout = QtGui.QAction(MainWindow) | |
|
1002 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) | |
|
1003 | self.actionOpenToolbar = QtGui.QAction(MainWindow) | |
|
1004 | self.actionOpenToolbar.setIcon(iconOpen) | |
|
1005 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) | |
|
1006 | self.actionCreateToolbar = QtGui.QAction(MainWindow) | |
|
1007 | self.actionCreateToolbar.setIcon(iconCreate) | |
|
1008 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) | |
|
1009 | self.actionSaveToolbar = QtGui.QAction(MainWindow) | |
|
1010 | self.actionSaveToolbar.setIcon(iconSave) | |
|
1011 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) | |
|
1012 | self.actionStarToolbar = QtGui.QAction(MainWindow) | |
|
1013 | self.actionStarToolbar.setIcon(iconStart) | |
|
1014 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) | |
|
1015 | self.actionStopToolbar = QtGui.QAction(MainWindow) | |
|
1016 | self.actionStopToolbar.setIcon(iconStop) | |
|
1017 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) | |
|
1018 | self.actionPauseToolbar = QtGui.QAction(MainWindow) | |
|
1019 | self.actionPause.setIcon(iconPause) | |
|
1020 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1021 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) | |
|
1022 | self.actionAddPU = QtGui.QAction(MainWindow) | |
|
1023 | self.actionAddPU.setIcon(iconAddPU) | |
|
1024 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) | |
|
1025 | self.actionFTP = QtGui.QAction(MainWindow) | |
|
1026 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) | |
|
1027 | self.toolBar.addAction(self.actionOpenToolbar) | |
|
1028 | self.toolBar.addSeparator() | |
|
1029 | self.toolBar.addAction(self.actionCreateToolbar) | |
|
1030 | self.toolBar.addSeparator() | |
|
1031 | self.toolBar.addAction(self.actionAddPU) | |
|
1032 | self.toolBar.addSeparator() | |
|
1033 | self.toolBar.addAction(self.actionSaveToolbar) | |
|
1034 | self.toolBar.addSeparator() | |
|
1035 | self.toolBar.addAction(self.actionStarToolbar) | |
|
1036 | self.toolBar.addSeparator() | |
|
1037 | self.toolBar.addAction(self.actionPauseToolbar) | |
|
1038 | self.toolBar.addSeparator() | |
|
1039 | self.toolBar.addAction(self.actionStopToolbar) | |
|
1040 | self.toolBar.addSeparator() | |
|
1041 | self.a=1 | |
|
1042 | self.actionPauseToolbar.triggered.connect(self.changeIcon) | |
|
1043 | ||
|
1044 | ||
|
1045 | self.menuProject.addAction(self.actionOpen) | |
|
1046 | self.menuProject.addAction(self.actionCreate) | |
|
1047 | self.menuProject.addAction(self.actionSave) | |
|
1048 | self.menuProject.addAction(self.actionClose) | |
|
1049 | self.menuRun.addAction(self.actionStart) | |
|
1050 | self.menuRun.addAction(self.actionPause) | |
|
1051 | self.menuRun.addAction(self.actionStop) | |
|
1052 | self.menuOptions.addAction(self.actionFTP) | |
|
1053 | self.menuHelp.addAction(self.actionAbout) | |
|
1054 | self.menuBar.addAction(self.menuProject.menuAction()) | |
|
1055 | self.menuBar.addAction(self.menuRun.menuAction()) | |
|
1056 | self.menuBar.addAction(self.menuOptions.menuAction()) | |
|
1057 | self.menuBar.addAction(self.menuHelp.menuAction()) | |
|
1058 | ||
|
1059 | self.retranslateUi(MainWindow) | |
|
1060 | self.tabWidgetProject.setCurrentIndex(0) | |
|
1061 | self.tabWidgetVoltage.setCurrentIndex(0) | |
|
1062 | self.tabWidgetSpectra.setCurrentIndex(0) | |
|
1063 | self.tabWidgetSpectraHeis.setCurrentIndex(0) | |
|
1064 | self.tabWidget_2.setCurrentIndex(0) | |
|
1065 | self.tabConsole.setCurrentIndex(0) | |
|
1066 | self.tabWidget.setCurrentIndex(0) | |
|
1067 | QtCore.QMetaObject.connectSlotsByName(MainWindow) | |
|
1068 | ||
|
1069 | def changeIcon(self): | |
|
1070 | ||
|
1071 | if self.a==1: | |
|
1072 | iconPauseRed = QtGui.QIcon() | |
|
1073 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
1074 | self.actionPauseToolbar.setIcon(iconPauseRed) | |
|
1075 | self.a+=1 | |
|
1076 | return 0 | |
|
1077 | if self.a==2: | |
|
1078 | iconPause = QtGui.QIcon() | |
|
1079 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
1080 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1081 | self.a-=1 | |
|
1082 | return 0 | |
|
37 | iconPause = QtGui.QIcon() | |
|
38 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
39 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1083 | 40 | |
|
1084 | def retranslateUi(self, MainWindow): | |
|
41 | self.paused = False | |
|
42 | ||
|
43 | def changePauseIcon(self): | |
|
1085 | 44 | |
|
1086 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) | |
|
1087 | self.label.setText(_translate("MainWindow", "Project Name :", None)) | |
|
1088 | self.label_11.setText(_translate("MainWindow", "DataType :", None)) | |
|
1089 | self.proComDataType.setItemText(0, _translate("MainWindow", "Voltage", None)) | |
|
1090 | self.proComDataType.setItemText(1, _translate("MainWindow", "Spectra", None)) | |
|
1091 | self.proComDataType.setItemText(2, _translate("MainWindow", "Fits", None)) | |
|
1092 | self.label_15.setText(_translate("MainWindow", "DataPath :", None)) | |
|
1093 | self.proToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1094 | self.label_23.setText(_translate("MainWindow", "Read Mode:", None)) | |
|
1095 | self.proComReadMode.setItemText(0, _translate("MainWindow", "Offline", None)) | |
|
1096 | self.proComReadMode.setItemText(1, _translate("MainWindow", "Online", None)) | |
|
1097 | self.label_33.setText(_translate("MainWindow", "Delay:", None)) | |
|
1098 | self.label_32.setText(_translate("MainWindow", "Walk :", None)) | |
|
1099 | self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None)) | |
|
1100 | self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None)) | |
|
1101 | self.proLoadButton.setText(_translate("MainWindow", "Load", None)) | |
|
1102 | self.label_10.setText(_translate("MainWindow", "Set:", None)) | |
|
1103 | self.label_27.setText(_translate("MainWindow", "Star Date:", None)) | |
|
1104 | self.label_28.setText(_translate("MainWindow", "End Date:", None)) | |
|
1105 | self.label_2.setText(_translate("MainWindow", "Start Time:", None)) | |
|
1106 | self.label_3.setText(_translate("MainWindow", "End Time:", None)) | |
|
1107 | self.label_30.setText(_translate("MainWindow", "Description:", None)) | |
|
1108 | self.proOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1109 | self.proClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1110 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabProject), _translate("MainWindow", "Project", None)) | |
|
1111 | self.volOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1112 | self.volGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1113 | self.volOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1114 | self.volOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1115 | self.volOpComChannels.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1116 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1117 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) | |
|
1118 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) | |
|
1119 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range List", None)) | |
|
1120 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) | |
|
1121 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) | |
|
1122 | self.label_4.setText(_translate("MainWindow", "Code:", None)) | |
|
1123 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) | |
|
1124 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
|
1125 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) | |
|
1126 | self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) | |
|
1127 | self.label_5.setText(_translate("MainWindow", "Mode:", None)) | |
|
1128 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Barker 3", None)) | |
|
1129 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 4", None)) | |
|
1130 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 5", None)) | |
|
1131 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 7", None)) | |
|
1132 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 11", None)) | |
|
1133 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 13", None)) | |
|
1134 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 3 + Comp.", None)) | |
|
1135 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 4 + Comp.", None)) | |
|
1136 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 5 + Comp.", None)) | |
|
1137 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 7 + Comp.", None)) | |
|
1138 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 11+ Comp.", None)) | |
|
1139 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 13+ Comp.", None)) | |
|
1140 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Default", None)) | |
|
1141 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) | |
|
1142 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Freq 1", None)) | |
|
1143 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) | |
|
1144 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1145 | self.label_14.setText(_translate("MainWindow", "Scope", None)) | |
|
1146 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) | |
|
1147 | self.label_49.setText(_translate("MainWindow", "Show", None)) | |
|
1148 | self.label_51.setText(_translate("MainWindow", "Freq/Vel", None)) | |
|
1149 | self.label_12.setText(_translate("MainWindow", "Path :", None)) | |
|
1150 | self.label_13.setText(_translate("MainWindow", "Prefix:", None)) | |
|
1151 | self.label_52.setText(_translate("MainWindow", "Height range", None)) | |
|
1152 | self.label_50.setText(_translate("MainWindow", "Save", None)) | |
|
1153 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) | |
|
1154 | self.label_36.setText(_translate("MainWindow", "Type:", None)) | |
|
1155 | self.label_37.setText(_translate("MainWindow", "Path:", None)) | |
|
1156 | self.volOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1157 | self.volOutputComData.setItemText(0, _translate("MainWindow", ".rawdata", None)) | |
|
1158 | self.label_7.setText(_translate("MainWindow", "Blocks per File : ", None)) | |
|
1159 | self.label_35.setText(_translate("MainWindow", "Profiles per Block: ", None)) | |
|
1160 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.taboutputVoltage), _translate("MainWindow", "Output", None)) | |
|
1161 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabVoltage), _translate("MainWindow", "Voltage", None)) | |
|
1162 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1163 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1164 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None)) | |
|
1165 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1166 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1167 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1168 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1169 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None)) | |
|
1170 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
|
1171 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None)) | |
|
1172 | self.label_31.setText(_translate("MainWindow", "x-y pairs", None)) | |
|
1173 | self.label_26.setText(_translate("MainWindow", "nFFTPoints", None)) | |
|
1174 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None)) | |
|
1175 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
|
1176 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None)) | |
|
1177 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) | |
|
1178 | self.label_21.setText(_translate("MainWindow", "Profiles", None)) | |
|
1179 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None)) | |
|
1180 | self.label_70.setText(_translate("MainWindow", "IppFactor", None)) | |
|
1181 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None)) | |
|
1182 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) | |
|
1183 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) | |
|
1184 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) | |
|
1185 | self.label_44.setText(_translate("MainWindow", "Coherence Map", None)) | |
|
1186 | self.label_20.setText(_translate("MainWindow", "Tmin, Tmax:", None)) | |
|
1187 | self.label_25.setText(_translate("MainWindow", "Prefix", None)) | |
|
1188 | self.label_42.setText(_translate("MainWindow", "RTI Plot", None)) | |
|
1189 | self.label_16.setText(_translate("MainWindow", "Height range", None)) | |
|
1190 | self.label_17.setText(_translate("MainWindow", "dB range", None)) | |
|
1191 | self.label_18.setText(_translate("MainWindow", "Magnitud ", None)) | |
|
1192 | self.label_24.setText(_translate("MainWindow", "Path", None)) | |
|
1193 | self.label_46.setText(_translate("MainWindow", "Power Profile", None)) | |
|
1194 | self.label_22.setText(_translate("MainWindow", "Freq/Vel:", None)) | |
|
1195 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None)) | |
|
1196 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1197 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) | |
|
1198 | self.label_40.setText(_translate("MainWindow", "Spectra Plot", None)) | |
|
1199 | self.label_43.setText(_translate("MainWindow", "Show", None)) | |
|
1200 | self.label_29.setText(_translate("MainWindow", "Wr Period:", None)) | |
|
1201 | self.label_47.setText(_translate("MainWindow", "Save", None)) | |
|
1202 | self.label_19.setText(_translate("MainWindow", "ftp", None)) | |
|
1203 | self.label_45.setText(_translate("MainWindow", "Noise", None)) | |
|
1204 | self.label_48.setText(_translate("MainWindow", "Time Range:", None)) | |
|
1205 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) | |
|
1206 | self.label_39.setText(_translate("MainWindow", "Type:", None)) | |
|
1207 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) | |
|
1208 | self.label_34.setText(_translate("MainWindow", "Path:", None)) | |
|
1209 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1210 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) | |
|
1211 | self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) | |
|
1212 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) | |
|
1213 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) | |
|
1214 | self.specHeisGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1215 | self.specHeisOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1216 | self.specHeisOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
|
1217 | self.specHeisOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Intergration", None)) | |
|
1218 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabopSpectraHeis), _translate("MainWindow", "Operation", None)) | |
|
1219 | self.label_54.setText(_translate("MainWindow", "Prefix", None)) | |
|
1220 | self.specHeisGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1221 | self.label_62.setText(_translate("MainWindow", "ymin - ymax", None)) | |
|
1222 | self.label_63.setText(_translate("MainWindow", "Tmin - Tmax:", None)) | |
|
1223 | self.label_64.setText(_translate("MainWindow", "Time Range:", None)) | |
|
1224 | self.label_65.setText(_translate("MainWindow", "Wr Period", None)) | |
|
1225 | self.label_60.setText(_translate("MainWindow", "Channel List:", None)) | |
|
1226 | self.label_61.setText(_translate("MainWindow", "xmin - xmax", None)) | |
|
1227 | self.label_56.setText(_translate("MainWindow", "Save", None)) | |
|
1228 | self.label_57.setText(_translate("MainWindow", "ftp", None)) | |
|
1229 | self.label_58.setText(_translate("MainWindow", "Spectra Plot", None)) | |
|
1230 | self.label_53.setText(_translate("MainWindow", "Path", None)) | |
|
1231 | self.label_55.setText(_translate("MainWindow", "Show", None)) | |
|
1232 | self.label_59.setText(_translate("MainWindow", "RTI PLot", None)) | |
|
1233 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabgraphSpectraHeis), _translate("MainWindow", "Graphics", None)) | |
|
1234 | self.label_67.setText(_translate("MainWindow", "Path:", None)) | |
|
1235 | self.label_68.setText(_translate("MainWindow", "Blocks per File:", None)) | |
|
1236 | self.label_66.setText(_translate("MainWindow", "Type:", None)) | |
|
1237 | self.specHeisOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1238 | self.specHeisOutputComdata.setItemText(0, _translate("MainWindow", ".fits", None)) | |
|
1239 | self.label_69.setText(_translate("MainWindow", "Metada", None)) | |
|
1240 | self.specHeisOutputMetadaToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1241 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.taboutputSpectraHeis), _translate("MainWindow", "Output", None)) | |
|
1242 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectraHeis), _translate("MainWindow", "SpectraHeis", None)) | |
|
1243 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation), _translate("MainWindow", "Operation", None)) | |
|
1244 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation1), _translate("MainWindow", "Graphics", None)) | |
|
1245 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabCorrelation), _translate("MainWindow", "Correlation", None)) | |
|
1246 | ||
|
1247 | ||
|
1248 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) | |
|
1249 | ||
|
1250 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) | |
|
1251 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) | |
|
1252 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) | |
|
1253 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) | |
|
1254 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) | |
|
1255 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) | |
|
1256 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) | |
|
1257 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) | |
|
1258 | self.actionSave.setText(_translate("MainWindow", "Save", None)) | |
|
1259 | self.actionClose.setText(_translate("MainWindow", "Close", None)) | |
|
1260 | self.actionStart.setText(_translate("MainWindow", "Start", None)) | |
|
1261 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) | |
|
1262 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) | |
|
1263 | self.actionAbout.setText(_translate("MainWindow", "About", None)) | |
|
1264 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) | |
|
1265 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open Project", None)) | |
|
1266 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) | |
|
1267 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create αΉroject", None)) | |
|
1268 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) | |
|
1269 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save Project", None)) | |
|
1270 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) | |
|
1271 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) | |
|
1272 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) | |
|
1273 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) | |
|
1274 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) | |
|
1275 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) | |
|
1276 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) | |
|
1277 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) | |
|
1278 | ||
|
1279 | ||
|
1280 | class Ui_EnvWindow(object): | |
|
1281 | ||
|
1282 | def changeIcon(self): | |
|
1283 | ||
|
1284 | if self.a==1: | |
|
45 | if self.paused == False: | |
|
1285 | 46 | iconPauseRed = QtGui.QIcon() |
|
1286 | 47 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1287 | 48 | self.actionPauseToolbar.setIcon(iconPauseRed) |
|
1288 |
self. |
|
|
49 | self.paused = True | |
|
1289 | 50 | return 0 |
|
1290 | if self.a==2: | |
|
51 | ||
|
52 | if self.paused: | |
|
1291 | 53 | iconPause = QtGui.QIcon() |
|
1292 | 54 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1293 | 55 | self.actionPauseToolbar.setIcon(iconPause) |
|
1294 |
self. |
|
|
56 | self.paused = False | |
|
1295 | 57 | return 0 |
|
1296 | 58 | |
|
1297 | 59 | def setupUi(self, MainWindow): |
|
1298 | 60 | |
|
1299 | 61 | MainWindow.setObjectName(_fromUtf8("MainWindow")) |
|
1300 | 62 | MainWindow.resize(1203, 711) |
|
1301 | 63 | |
|
1302 | 64 | self.centralWidget = QtGui.QWidget(MainWindow) |
|
1303 | 65 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) |
|
1304 | 66 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) |
|
1305 | 67 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) |
|
1306 | 68 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) |
|
1307 | 69 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) |
|
1308 | 70 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) |
|
1309 | 71 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) |
|
1310 | 72 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) |
|
1311 | 73 | self.splitter = QtGui.QSplitter(self.splitter_2) |
|
1312 | 74 | self.splitter.setOrientation(QtCore.Qt.Vertical) |
|
1313 | 75 | self.splitter.setObjectName(_fromUtf8("splitter")) |
|
1314 | 76 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) |
|
1315 | 77 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) |
|
1316 | 78 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
|
1317 | 79 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) |
|
1318 | 80 | |
|
1319 | 81 | self.tabConsole = QtGui.QTabWidget(self.splitter) |
|
1320 | 82 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) |
|
1321 | 83 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) |
|
1322 | 84 | self.tab_5 = QtGui.QWidget() |
|
1323 | 85 | self.tab_5.setObjectName(_fromUtf8("tab_5")) |
|
1324 | 86 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) |
|
1325 | 87 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) |
|
1326 | 88 | self.console = QtGui.QTextEdit(self.tab_5) |
|
1327 | 89 | self.console.setObjectName(_fromUtf8("console")) |
|
1328 | 90 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) |
|
1329 | 91 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) |
|
1330 | 92 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) |
|
1331 | 93 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) |
|
1332 | 94 | self.tabProjectProperty = QtGui.QWidget() |
|
1333 | 95 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) |
|
1334 | 96 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) |
|
1335 | 97 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) |
|
1336 | 98 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) |
|
1337 | 99 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) |
|
1338 | 100 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) |
|
1339 | 101 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) |
|
1340 | 102 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) |
|
1341 | 103 | |
|
1342 | 104 | MainWindow.setCentralWidget(self.centralWidget) |
|
1343 | 105 | self.toolBar = QtGui.QToolBar(MainWindow) |
|
1344 | 106 | self.toolBar.setObjectName(_fromUtf8("toolBar")) |
|
1345 | 107 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
1346 | 108 | |
|
1347 | 109 | self.menuBar = QtGui.QMenuBar(MainWindow) |
|
1348 | 110 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) |
|
1349 | 111 | self.menuBar.setObjectName(_fromUtf8("menuBar")) |
|
1350 | 112 | self.menuProject = QtGui.QMenu(self.menuBar) |
|
1351 | 113 | self.menuProject.setObjectName(_fromUtf8("menuProject")) |
|
1352 | 114 | self.menuRun = QtGui.QMenu(self.menuBar) |
|
1353 | 115 | self.menuRun.setObjectName(_fromUtf8("menuRun")) |
|
1354 | 116 | self.menuOptions = QtGui.QMenu(self.menuBar) |
|
1355 | 117 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) |
|
1356 | 118 | self.menuHelp = QtGui.QMenu(self.menuBar) |
|
1357 | 119 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) |
|
1358 | 120 | MainWindow.setMenuBar(self.menuBar) |
|
1359 | 121 | |
|
1360 | 122 | iconOpen = QtGui.QIcon() |
|
1361 | 123 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1362 | 124 | iconCreate = QtGui.QIcon() |
|
1363 | 125 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1364 | 126 | iconSave = QtGui.QIcon() |
|
1365 | 127 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1366 | 128 | iconStart = QtGui.QIcon() |
|
1367 | 129 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1368 | 130 | iconStop = QtGui.QIcon() |
|
1369 | 131 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1370 | 132 | iconPause = QtGui.QIcon() |
|
1371 | 133 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1372 | 134 | iconAddPU = QtGui.QIcon() |
|
1373 | 135 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1374 | 136 | |
|
1375 | 137 | self.actionOpen = QtGui.QAction(MainWindow) |
|
1376 | 138 | self.actionOpen.setIcon(iconOpen) |
|
1377 | 139 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) |
|
1378 | 140 | self.actionCreate = QtGui.QAction(MainWindow) |
|
1379 | 141 | self.actionCreate.setIcon(iconCreate) |
|
1380 | 142 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) |
|
1381 | 143 | self.actionSave = QtGui.QAction(MainWindow) |
|
1382 | 144 | self.actionSave.setIcon(iconSave) |
|
1383 | 145 | self.actionSave.setObjectName(_fromUtf8("actionSave")) |
|
1384 | 146 | self.actionClose = QtGui.QAction(MainWindow) |
|
1385 | 147 | self.actionClose.setObjectName(_fromUtf8("actionClose")) |
|
1386 | 148 | self.actionStart = QtGui.QAction(MainWindow) |
|
1387 | 149 | self.actionStart.setIcon(iconStart) |
|
1388 | 150 | self.actionStart.setObjectName(_fromUtf8("actionStart")) |
|
1389 | 151 | self.actionPause = QtGui.QAction(MainWindow) |
|
1390 | 152 | self.actionPause.setIcon(iconPause) |
|
1391 | 153 | self.actionPause.setObjectName(_fromUtf8("actionPause")) |
|
1392 | 154 | self.actionStop = QtGui.QAction(MainWindow) |
|
1393 | 155 | self.actionStop.setIcon(iconStop) |
|
1394 | 156 | self.actionStop.setObjectName(_fromUtf8("actionStop")) |
|
1395 | 157 | self.actionAbout = QtGui.QAction(MainWindow) |
|
1396 | 158 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) |
|
1397 | 159 | self.actionOpenToolbar = QtGui.QAction(MainWindow) |
|
1398 | 160 | self.actionOpenToolbar.setIcon(iconOpen) |
|
1399 | 161 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) |
|
1400 | 162 | self.actionCreateToolbar = QtGui.QAction(MainWindow) |
|
1401 | 163 | self.actionCreateToolbar.setIcon(iconCreate) |
|
1402 | 164 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) |
|
1403 | 165 | self.actionSaveToolbar = QtGui.QAction(MainWindow) |
|
1404 | 166 | self.actionSaveToolbar.setIcon(iconSave) |
|
1405 | 167 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) |
|
1406 | 168 | self.actionStarToolbar = QtGui.QAction(MainWindow) |
|
1407 | 169 | self.actionStarToolbar.setIcon(iconStart) |
|
1408 | 170 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) |
|
1409 | 171 | self.actionStopToolbar = QtGui.QAction(MainWindow) |
|
1410 | 172 | self.actionStopToolbar.setIcon(iconStop) |
|
1411 | 173 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) |
|
1412 | 174 | self.actionPauseToolbar = QtGui.QAction(MainWindow) |
|
1413 | 175 | self.actionPause.setIcon(iconPause) |
|
1414 | 176 | self.actionPauseToolbar.setIcon(iconPause) |
|
1415 | 177 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) |
|
1416 | 178 | self.actionAddPU = QtGui.QAction(MainWindow) |
|
1417 | 179 | self.actionAddPU.setIcon(iconAddPU) |
|
1418 | 180 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) |
|
1419 | 181 | self.actionFTP = QtGui.QAction(MainWindow) |
|
1420 | 182 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) |
|
1421 | 183 | self.toolBar.addAction(self.actionOpenToolbar) |
|
1422 | 184 | self.toolBar.addSeparator() |
|
1423 | 185 | self.toolBar.addAction(self.actionCreateToolbar) |
|
1424 | 186 | self.toolBar.addSeparator() |
|
1425 | 187 | self.toolBar.addAction(self.actionAddPU) |
|
1426 | 188 | self.toolBar.addSeparator() |
|
1427 | 189 | self.toolBar.addAction(self.actionSaveToolbar) |
|
1428 | 190 | self.toolBar.addSeparator() |
|
1429 | 191 | self.toolBar.addAction(self.actionStarToolbar) |
|
1430 | 192 | self.toolBar.addSeparator() |
|
1431 | 193 | self.toolBar.addAction(self.actionPauseToolbar) |
|
1432 | 194 | self.toolBar.addSeparator() |
|
1433 | 195 | self.toolBar.addAction(self.actionStopToolbar) |
|
1434 | 196 | self.toolBar.addSeparator() |
|
1435 |
|
|
|
1436 | self.actionPauseToolbar.triggered.connect(self.changeIcon) | |
|
197 | ||
|
198 | self.paused=False | |
|
199 | self.actionPause.triggered.connect(self.changePauseIcon) | |
|
200 | self.actionPauseToolbar.triggered.connect(self.changePauseIcon) | |
|
1437 | 201 | |
|
1438 | 202 | self.menuProject.addAction(self.actionOpen) |
|
1439 | 203 | self.menuProject.addAction(self.actionCreate) |
|
1440 | 204 | self.menuProject.addAction(self.actionSave) |
|
1441 | 205 | self.menuProject.addAction(self.actionClose) |
|
1442 | 206 | self.menuRun.addAction(self.actionStart) |
|
1443 | 207 | self.menuRun.addAction(self.actionPause) |
|
1444 | 208 | self.menuRun.addAction(self.actionStop) |
|
1445 | 209 | self.menuOptions.addAction(self.actionFTP) |
|
1446 | 210 | self.menuHelp.addAction(self.actionAbout) |
|
1447 | 211 | self.menuBar.addAction(self.menuProject.menuAction()) |
|
1448 | 212 | self.menuBar.addAction(self.menuRun.menuAction()) |
|
1449 | 213 | self.menuBar.addAction(self.menuOptions.menuAction()) |
|
1450 | 214 | self.menuBar.addAction(self.menuHelp.menuAction()) |
|
1451 | 215 | |
|
1452 | 216 | self.tabConsole.setCurrentIndex(0) |
|
1453 | 217 | self.tabWidget.setCurrentIndex(0) |
|
1454 | 218 | |
|
1455 | 219 | def retranslateUi(self, MainWindow): |
|
1456 | 220 | |
|
1457 | 221 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) |
|
1458 | 222 | |
|
1459 | 223 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) |
|
1460 | 224 | |
|
1461 | 225 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) |
|
1462 | 226 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) |
|
1463 | 227 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) |
|
1464 | 228 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) |
|
1465 | 229 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) |
|
1466 | 230 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) |
|
1467 | 231 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) |
|
1468 | 232 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) |
|
1469 | 233 | self.actionSave.setText(_translate("MainWindow", "Save", None)) |
|
1470 | 234 | self.actionClose.setText(_translate("MainWindow", "Close", None)) |
|
1471 | 235 | self.actionStart.setText(_translate("MainWindow", "Start", None)) |
|
1472 | 236 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) |
|
1473 | 237 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) |
|
1474 | 238 | self.actionAbout.setText(_translate("MainWindow", "About", None)) |
|
1475 | 239 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) |
|
1476 |
self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open |
|
|
240 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open a project", None)) | |
|
1477 | 241 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) |
|
1478 |
self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create |
|
|
242 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create a new project", None)) | |
|
1479 | 243 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) |
|
1480 |
self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save |
|
|
244 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save a project", None)) | |
|
1481 | 245 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) |
|
1482 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) | |
|
246 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start process", None)) | |
|
1483 | 247 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) |
|
1484 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) | |
|
248 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop process", None)) | |
|
1485 | 249 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) |
|
1486 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) | |
|
250 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause process", None)) | |
|
1487 | 251 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) |
|
1488 | 252 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) |
|
1489 |
|
|
|
253 | ||
|
254 | def closeEvent(self, event): | |
|
255 | ||
|
256 | reply = QtGui.QMessageBox.question(self, 'Message', | |
|
257 | "Are you sure to quit?", QtGui.QMessageBox.Yes | | |
|
258 | QtGui.QMessageBox.No, QtGui.QMessageBox.No) | |
|
259 | if reply == QtGui.QMessageBox.Yes: | |
|
260 | event.accept() | |
|
261 | else: | |
|
262 | event.ignore() | |
|
263 | ||
|
1490 | 264 | class Ui_BasicWindow(Ui_EnvWindow, Ui_ProjectTab, Ui_VoltageTab, Ui_SpectraTab, Ui_SpectraHeisTab, Ui_CorrelationTab): |
|
1491 | 265 | |
|
1492 | 266 | def setupUi(self, MainWindow): |
|
1493 | 267 | |
|
1494 | 268 | Ui_EnvWindow.setupUi(self, MainWindow) |
|
1495 | 269 | |
|
1496 | 270 | Ui_ProjectTab.setupUi(self) |
|
1497 | 271 | Ui_VoltageTab.setupUi(self) |
|
1498 | 272 | Ui_SpectraTab.setupUi(self) |
|
1499 | 273 | Ui_SpectraHeisTab.setupUi(self) |
|
1500 | 274 | Ui_CorrelationTab.setupUi(self) |
|
1501 | 275 | |
|
1502 | 276 | self.retranslateUi(MainWindow) |
|
1503 | 277 | |
|
1504 | 278 | QtCore.QMetaObject.connectSlotsByName(MainWindow) |
|
1505 | 279 | |
|
1506 | 280 | def retranslateUi(self, MainWindow): |
|
1507 | 281 | |
|
1508 | 282 | Ui_EnvWindow.retranslateUi(self, MainWindow) |
|
1509 | 283 | |
|
1510 | 284 | Ui_ProjectTab.retranslateUi(self) |
|
1511 | 285 | Ui_VoltageTab.retranslateUi(self) |
|
1512 | 286 | Ui_SpectraTab.retranslateUi(self) |
|
1513 | 287 | Ui_SpectraHeisTab.retranslateUi(self) |
|
1514 | 288 | Ui_CorrelationTab.retranslateUi(self) |
|
1515 | 289 | |
|
1516 | 290 | |
|
1517 |
class Ui_AdvancedWindow(Ui_ |
|
|
291 | class Ui_AdvancedWindow(Ui_EnvWindow): | |
|
1518 | 292 | |
|
1519 | 293 | def setupUi(self, AdvancedWindow): |
|
1520 | 294 | |
|
1521 | 295 | Ui_MainWindow.setupUi(self, AdvancedWindow) |
|
1522 | 296 | |
|
1523 | 297 | def retranslateUi(self, AdvancedWindow): |
|
1524 | 298 | |
|
1525 | 299 | Ui_MainWindow.retranslateUi(self, AdvancedWindow) |
|
1526 | 300 | |
|
1527 | 301 | |
|
1528 | 302 | |
|
1529 | 303 | if __name__ == "__main__": |
|
1530 | 304 | import sys |
|
1531 | 305 | app = QtGui.QApplication(sys.argv) |
|
1532 | 306 | MainWindow = QtGui.QMainWindow() |
|
1533 | 307 | ui = Ui_BasicWindow() |
|
1534 | 308 | ui.setupUi(MainWindow) |
|
1535 | 309 | MainWindow.show() |
|
1536 | 310 | sys.exit(app.exec_()) |
|
1537 | 311 |
@@ -1,936 +1,938 | |||
|
1 | 1 | import numpy |
|
2 | 2 | import math |
|
3 | 3 | |
|
4 | 4 | from jroproc_base import ProcessingUnit, Operation |
|
5 | 5 | from schainpy.model.data.jrodata import Spectra |
|
6 | 6 | from schainpy.model.data.jrodata import hildebrand_sekhon |
|
7 | 7 | |
|
8 | 8 | class SpectraProc(ProcessingUnit): |
|
9 | 9 | |
|
10 | 10 | def __init__(self): |
|
11 | 11 | |
|
12 | 12 | ProcessingUnit.__init__(self) |
|
13 | 13 | |
|
14 | 14 | self.buffer = None |
|
15 | 15 | self.firstdatatime = None |
|
16 | 16 | self.profIndex = 0 |
|
17 | 17 | self.dataOut = Spectra() |
|
18 | 18 | self.id_min = None |
|
19 | 19 | self.id_max = None |
|
20 | 20 | |
|
21 | 21 | def __updateObjFromInput(self): |
|
22 | 22 | |
|
23 | 23 | self.dataOut.timeZone = self.dataIn.timeZone |
|
24 | 24 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
25 | 25 | self.dataOut.errorCount = self.dataIn.errorCount |
|
26 | 26 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
27 | 27 | |
|
28 | 28 | self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy() |
|
29 | 29 | self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy() |
|
30 | 30 | self.dataOut.channelList = self.dataIn.channelList |
|
31 | 31 | self.dataOut.heightList = self.dataIn.heightList |
|
32 | 32 | self.dataOut.dtype = numpy.dtype([('real','<f4'),('imag','<f4')]) |
|
33 | 33 | # self.dataOut.nHeights = self.dataIn.nHeights |
|
34 | 34 | # self.dataOut.nChannels = self.dataIn.nChannels |
|
35 | 35 | self.dataOut.nBaud = self.dataIn.nBaud |
|
36 | 36 | self.dataOut.nCode = self.dataIn.nCode |
|
37 | 37 | self.dataOut.code = self.dataIn.code |
|
38 | 38 | self.dataOut.nProfiles = self.dataOut.nFFTPoints |
|
39 | 39 | # self.dataOut.channelIndexList = self.dataIn.channelIndexList |
|
40 | 40 | self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock |
|
41 | 41 | self.dataOut.utctime = self.firstdatatime |
|
42 | 42 | self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada |
|
43 | 43 | self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip |
|
44 | 44 | # self.dataOut.flagShiftFFT = self.dataIn.flagShiftFFT |
|
45 | 45 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
46 | 46 | self.dataOut.nIncohInt = 1 |
|
47 | 47 | # self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
48 | 48 | self.dataOut.windowOfFilter = self.dataIn.windowOfFilter |
|
49 | 49 | |
|
50 | 50 | # self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt |
|
51 | 51 | self.dataOut.frequency = self.dataIn.frequency |
|
52 | 52 | self.dataOut.realtime = self.dataIn.realtime |
|
53 | 53 | |
|
54 | 54 | self.dataOut.azimuth = self.dataIn.azimuth |
|
55 | 55 | self.dataOut.zenith = self.dataIn.zenith |
|
56 | 56 | |
|
57 | 57 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
58 | 58 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
59 | 59 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
60 | 60 | |
|
61 | 61 | def __getFft(self): |
|
62 | 62 | """ |
|
63 | 63 | Convierte valores de Voltaje a Spectra |
|
64 | 64 | |
|
65 | 65 | Affected: |
|
66 | 66 | self.dataOut.data_spc |
|
67 | 67 | self.dataOut.data_cspc |
|
68 | 68 | self.dataOut.data_dc |
|
69 | 69 | self.dataOut.heightList |
|
70 | 70 | self.profIndex |
|
71 | 71 | self.buffer |
|
72 | 72 | self.dataOut.flagNoData |
|
73 | 73 | """ |
|
74 | 74 | fft_volt = numpy.fft.fft(self.buffer,n=self.dataOut.nFFTPoints,axis=1) |
|
75 | 75 | fft_volt = fft_volt.astype(numpy.dtype('complex')) |
|
76 | 76 | dc = fft_volt[:,0,:] |
|
77 | 77 | |
|
78 | 78 | #calculo de self-spectra |
|
79 | 79 | fft_volt = numpy.fft.fftshift(fft_volt,axes=(1,)) |
|
80 | 80 | spc = fft_volt * numpy.conjugate(fft_volt) |
|
81 | 81 | spc = spc.real |
|
82 | 82 | |
|
83 | 83 | blocksize = 0 |
|
84 | 84 | blocksize += dc.size |
|
85 | 85 | blocksize += spc.size |
|
86 | 86 | |
|
87 | 87 | cspc = None |
|
88 | 88 | pairIndex = 0 |
|
89 | 89 | if self.dataOut.pairsList != None: |
|
90 | 90 | #calculo de cross-spectra |
|
91 | 91 | cspc = numpy.zeros((self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex') |
|
92 | 92 | for pair in self.dataOut.pairsList: |
|
93 | 93 | cspc[pairIndex,:,:] = fft_volt[pair[0],:,:] * numpy.conjugate(fft_volt[pair[1],:,:]) |
|
94 | 94 | pairIndex += 1 |
|
95 | 95 | blocksize += cspc.size |
|
96 | 96 | |
|
97 | 97 | self.dataOut.data_spc = spc |
|
98 | 98 | self.dataOut.data_cspc = cspc |
|
99 | 99 | self.dataOut.data_dc = dc |
|
100 | 100 | self.dataOut.blockSize = blocksize |
|
101 | 101 | self.dataOut.flagShiftFFT = False |
|
102 | 102 | |
|
103 | 103 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None): |
|
104 | 104 | |
|
105 | 105 | self.dataOut.flagNoData = True |
|
106 | 106 | |
|
107 | 107 | if self.dataIn.type == "Spectra": |
|
108 | 108 | self.dataOut.copy(self.dataIn) |
|
109 | 109 | return True |
|
110 | 110 | |
|
111 | 111 | if self.dataIn.type == "Voltage": |
|
112 | 112 | |
|
113 | 113 | if nFFTPoints == None: |
|
114 | 114 | raise ValueError, "This SpectraProc.run() need nFFTPoints input variable" |
|
115 | 115 | |
|
116 | 116 | if nProfiles == None: |
|
117 | 117 | nProfiles = nFFTPoints |
|
118 | 118 | # raise ValueError, "This SpectraProc.run() need nProfiles input variable" |
|
119 | 119 | |
|
120 | 120 | |
|
121 | 121 | if ippFactor == None: |
|
122 | 122 | ippFactor = 1 |
|
123 | 123 | self.dataOut.ippFactor = ippFactor |
|
124 | 124 | |
|
125 | 125 | self.dataOut.nFFTPoints = nFFTPoints |
|
126 | 126 | self.dataOut.pairsList = pairsList |
|
127 | 127 | |
|
128 | 128 | if self.buffer == None: |
|
129 | 129 | self.buffer = numpy.zeros((self.dataIn.nChannels, |
|
130 | 130 | nProfiles, |
|
131 | 131 | self.dataIn.nHeights), |
|
132 | 132 | dtype='complex') |
|
133 | 133 | self.id_min = 0 |
|
134 | 134 | self.id_max = self.dataIn.data.shape[1] |
|
135 | 135 | |
|
136 | 136 | if len(self.dataIn.data.shape) == 2: |
|
137 | 137 | self.buffer[:,self.profIndex,:] = self.dataIn.data.copy() |
|
138 | 138 | self.profIndex += 1 |
|
139 | 139 | else: |
|
140 | 140 | if self.dataIn.data.shape[1] == nProfiles: |
|
141 | 141 | self.buffer = self.dataIn.data.copy() |
|
142 | 142 | self.profIndex = nProfiles |
|
143 | 143 | elif self.dataIn.data.shape[1] < nProfiles: |
|
144 | 144 | self.buffer[:,self.id_min:self.id_max,:] = self.dataIn.data |
|
145 | 145 | self.profIndex += self.dataIn.data.shape[1] |
|
146 | 146 | self.id_min += self.dataIn.data.shape[1] |
|
147 | 147 | self.id_max += self.dataIn.data.shape[1] |
|
148 | 148 | else: |
|
149 | 149 | raise ValueError, "The type object %s has %d profiles, it should be equal to %d profiles"%(self.dataIn.type,self.dataIn.data.shape[1],nProfiles) |
|
150 | 150 | self.dataOut.flagNoData = True |
|
151 | 151 | return 0 |
|
152 | 152 | |
|
153 | 153 | |
|
154 | 154 | if self.firstdatatime == None: |
|
155 | 155 | self.firstdatatime = self.dataIn.utctime |
|
156 | 156 | |
|
157 | 157 | if self.profIndex == nProfiles: |
|
158 | 158 | self.__updateObjFromInput() |
|
159 | 159 | self.__getFft() |
|
160 | 160 | |
|
161 | 161 | self.dataOut.flagNoData = False |
|
162 | 162 | |
|
163 | 163 | self.buffer = None |
|
164 | 164 | self.firstdatatime = None |
|
165 | 165 | self.profIndex = 0 |
|
166 | 166 | |
|
167 | 167 | return True |
|
168 | 168 | |
|
169 | 169 | raise ValueError, "The type object %s is not valid"%(self.dataIn.type) |
|
170 | 170 | |
|
171 | 171 | def selectChannels(self, channelList): |
|
172 | 172 | |
|
173 | 173 | channelIndexList = [] |
|
174 | 174 | |
|
175 | 175 | for channel in channelList: |
|
176 | if channel not in self.dataOut.channelList: | |
|
177 | continue | |
|
176 | 178 | index = self.dataOut.channelList.index(channel) |
|
177 | 179 | channelIndexList.append(index) |
|
178 | 180 | |
|
179 | 181 | self.selectChannelsByIndex(channelIndexList) |
|
180 | 182 | |
|
181 | 183 | def selectChannelsByIndex(self, channelIndexList): |
|
182 | 184 | """ |
|
183 | 185 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
184 | 186 | |
|
185 | 187 | Input: |
|
186 | 188 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
187 | 189 | |
|
188 | 190 | Affected: |
|
189 | 191 | self.dataOut.data_spc |
|
190 | 192 | self.dataOut.channelIndexList |
|
191 | 193 | self.dataOut.nChannels |
|
192 | 194 | |
|
193 | 195 | Return: |
|
194 | 196 | None |
|
195 | 197 | """ |
|
196 | 198 | |
|
197 | 199 | for channelIndex in channelIndexList: |
|
198 | 200 | if channelIndex not in self.dataOut.channelIndexList: |
|
199 | 201 | print channelIndexList |
|
200 | 202 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
201 | 203 | |
|
202 | 204 | # nChannels = len(channelIndexList) |
|
203 | 205 | |
|
204 | 206 | data_spc = self.dataOut.data_spc[channelIndexList,:] |
|
205 | 207 | |
|
206 | 208 | self.dataOut.data_spc = data_spc |
|
207 | 209 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
208 | 210 | # self.dataOut.nChannels = nChannels |
|
209 | 211 | |
|
210 | 212 | return 1 |
|
211 | 213 | |
|
212 | 214 | def selectHeights(self, minHei, maxHei): |
|
213 | 215 | """ |
|
214 | 216 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
215 | 217 | minHei <= height <= maxHei |
|
216 | 218 | |
|
217 | 219 | Input: |
|
218 | 220 | minHei : valor minimo de altura a considerar |
|
219 | 221 | maxHei : valor maximo de altura a considerar |
|
220 | 222 | |
|
221 | 223 | Affected: |
|
222 | 224 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
223 | 225 | |
|
224 | 226 | Return: |
|
225 | 227 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
226 | 228 | """ |
|
227 | 229 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
228 | 230 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
229 | 231 | |
|
230 | 232 | if (maxHei > self.dataOut.heightList[-1]): |
|
231 | 233 | maxHei = self.dataOut.heightList[-1] |
|
232 | 234 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
233 | 235 | |
|
234 | 236 | minIndex = 0 |
|
235 | 237 | maxIndex = 0 |
|
236 | 238 | heights = self.dataOut.heightList |
|
237 | 239 | |
|
238 | 240 | inda = numpy.where(heights >= minHei) |
|
239 | 241 | indb = numpy.where(heights <= maxHei) |
|
240 | 242 | |
|
241 | 243 | try: |
|
242 | 244 | minIndex = inda[0][0] |
|
243 | 245 | except: |
|
244 | 246 | minIndex = 0 |
|
245 | 247 | |
|
246 | 248 | try: |
|
247 | 249 | maxIndex = indb[0][-1] |
|
248 | 250 | except: |
|
249 | 251 | maxIndex = len(heights) |
|
250 | 252 | |
|
251 | 253 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
252 | 254 | |
|
253 | 255 | return 1 |
|
254 | 256 | |
|
255 | 257 | def getBeaconSignal(self, tauindex = 0, channelindex = 0, hei_ref=None): |
|
256 | 258 | newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) |
|
257 | 259 | |
|
258 | 260 | if hei_ref != None: |
|
259 | 261 | newheis = numpy.where(self.dataOut.heightList>hei_ref) |
|
260 | 262 | |
|
261 | 263 | minIndex = min(newheis[0]) |
|
262 | 264 | maxIndex = max(newheis[0]) |
|
263 | 265 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
264 | 266 | heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
265 | 267 | |
|
266 | 268 | # determina indices |
|
267 | 269 | nheis = int(self.dataOut.radarControllerHeaderObj.txB/(self.dataOut.heightList[1]-self.dataOut.heightList[0])) |
|
268 | 270 | avg_dB = 10*numpy.log10(numpy.sum(data_spc[channelindex,:,:],axis=0)) |
|
269 | 271 | beacon_dB = numpy.sort(avg_dB)[-nheis:] |
|
270 | 272 | beacon_heiIndexList = [] |
|
271 | 273 | for val in avg_dB.tolist(): |
|
272 | 274 | if val >= beacon_dB[0]: |
|
273 | 275 | beacon_heiIndexList.append(avg_dB.tolist().index(val)) |
|
274 | 276 | |
|
275 | 277 | #data_spc = data_spc[:,:,beacon_heiIndexList] |
|
276 | 278 | data_cspc = None |
|
277 | 279 | if self.dataOut.data_cspc != None: |
|
278 | 280 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
279 | 281 | #data_cspc = data_cspc[:,:,beacon_heiIndexList] |
|
280 | 282 | |
|
281 | 283 | data_dc = None |
|
282 | 284 | if self.dataOut.data_dc != None: |
|
283 | 285 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
284 | 286 | #data_dc = data_dc[:,beacon_heiIndexList] |
|
285 | 287 | |
|
286 | 288 | self.dataOut.data_spc = data_spc |
|
287 | 289 | self.dataOut.data_cspc = data_cspc |
|
288 | 290 | self.dataOut.data_dc = data_dc |
|
289 | 291 | self.dataOut.heightList = heightList |
|
290 | 292 | self.dataOut.beacon_heiIndexList = beacon_heiIndexList |
|
291 | 293 | |
|
292 | 294 | return 1 |
|
293 | 295 | |
|
294 | 296 | |
|
295 | 297 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
296 | 298 | """ |
|
297 | 299 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
298 | 300 | minIndex <= index <= maxIndex |
|
299 | 301 | |
|
300 | 302 | Input: |
|
301 | 303 | minIndex : valor de indice minimo de altura a considerar |
|
302 | 304 | maxIndex : valor de indice maximo de altura a considerar |
|
303 | 305 | |
|
304 | 306 | Affected: |
|
305 | 307 | self.dataOut.data_spc |
|
306 | 308 | self.dataOut.data_cspc |
|
307 | 309 | self.dataOut.data_dc |
|
308 | 310 | self.dataOut.heightList |
|
309 | 311 | |
|
310 | 312 | Return: |
|
311 | 313 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
312 | 314 | """ |
|
313 | 315 | |
|
314 | 316 | if (minIndex < 0) or (minIndex > maxIndex): |
|
315 | 317 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
316 | 318 | |
|
317 | 319 | if (maxIndex >= self.dataOut.nHeights): |
|
318 | 320 | maxIndex = self.dataOut.nHeights-1 |
|
319 | 321 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
320 | 322 | |
|
321 | 323 | # nHeights = maxIndex - minIndex + 1 |
|
322 | 324 | |
|
323 | 325 | #Spectra |
|
324 | 326 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
325 | 327 | |
|
326 | 328 | data_cspc = None |
|
327 | 329 | if self.dataOut.data_cspc != None: |
|
328 | 330 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
329 | 331 | |
|
330 | 332 | data_dc = None |
|
331 | 333 | if self.dataOut.data_dc != None: |
|
332 | 334 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
333 | 335 | |
|
334 | 336 | self.dataOut.data_spc = data_spc |
|
335 | 337 | self.dataOut.data_cspc = data_cspc |
|
336 | 338 | self.dataOut.data_dc = data_dc |
|
337 | 339 | |
|
338 | 340 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
339 | 341 | |
|
340 | 342 | return 1 |
|
341 | 343 | |
|
342 | 344 | def removeDC(self, mode = 2): |
|
343 | 345 | jspectra = self.dataOut.data_spc |
|
344 | 346 | jcspectra = self.dataOut.data_cspc |
|
345 | 347 | |
|
346 | 348 | |
|
347 | 349 | num_chan = jspectra.shape[0] |
|
348 | 350 | num_hei = jspectra.shape[2] |
|
349 | 351 | |
|
350 | 352 | if jcspectra != None: |
|
351 | 353 | jcspectraExist = True |
|
352 | 354 | num_pairs = jcspectra.shape[0] |
|
353 | 355 | else: jcspectraExist = False |
|
354 | 356 | |
|
355 | 357 | freq_dc = jspectra.shape[1]/2 |
|
356 | 358 | ind_vel = numpy.array([-2,-1,1,2]) + freq_dc |
|
357 | 359 | |
|
358 | 360 | if ind_vel[0]<0: |
|
359 | 361 | ind_vel[range(0,1)] = ind_vel[range(0,1)] + self.num_prof |
|
360 | 362 | |
|
361 | 363 | if mode == 1: |
|
362 | 364 | jspectra[:,freq_dc,:] = (jspectra[:,ind_vel[1],:] + jspectra[:,ind_vel[2],:])/2 #CORRECCION |
|
363 | 365 | |
|
364 | 366 | if jcspectraExist: |
|
365 | 367 | jcspectra[:,freq_dc,:] = (jcspectra[:,ind_vel[1],:] + jcspectra[:,ind_vel[2],:])/2 |
|
366 | 368 | |
|
367 | 369 | if mode == 2: |
|
368 | 370 | |
|
369 | 371 | vel = numpy.array([-2,-1,1,2]) |
|
370 | 372 | xx = numpy.zeros([4,4]) |
|
371 | 373 | |
|
372 | 374 | for fil in range(4): |
|
373 | 375 | xx[fil,:] = vel[fil]**numpy.asarray(range(4)) |
|
374 | 376 | |
|
375 | 377 | xx_inv = numpy.linalg.inv(xx) |
|
376 | 378 | xx_aux = xx_inv[0,:] |
|
377 | 379 | |
|
378 | 380 | for ich in range(num_chan): |
|
379 | 381 | yy = jspectra[ich,ind_vel,:] |
|
380 | 382 | jspectra[ich,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
381 | 383 | |
|
382 | 384 | junkid = jspectra[ich,freq_dc,:]<=0 |
|
383 | 385 | cjunkid = sum(junkid) |
|
384 | 386 | |
|
385 | 387 | if cjunkid.any(): |
|
386 | 388 | jspectra[ich,freq_dc,junkid.nonzero()] = (jspectra[ich,ind_vel[1],junkid] + jspectra[ich,ind_vel[2],junkid])/2 |
|
387 | 389 | |
|
388 | 390 | if jcspectraExist: |
|
389 | 391 | for ip in range(num_pairs): |
|
390 | 392 | yy = jcspectra[ip,ind_vel,:] |
|
391 | 393 | jcspectra[ip,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
392 | 394 | |
|
393 | 395 | |
|
394 | 396 | self.dataOut.data_spc = jspectra |
|
395 | 397 | self.dataOut.data_cspc = jcspectra |
|
396 | 398 | |
|
397 | 399 | return 1 |
|
398 | 400 | |
|
399 | 401 | def removeInterference(self, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None): |
|
400 | 402 | |
|
401 | 403 | jspectra = self.dataOut.data_spc |
|
402 | 404 | jcspectra = self.dataOut.data_cspc |
|
403 | 405 | jnoise = self.dataOut.getNoise() |
|
404 | 406 | num_incoh = self.dataOut.nIncohInt |
|
405 | 407 | |
|
406 | 408 | num_channel = jspectra.shape[0] |
|
407 | 409 | num_prof = jspectra.shape[1] |
|
408 | 410 | num_hei = jspectra.shape[2] |
|
409 | 411 | |
|
410 | 412 | #hei_interf |
|
411 | 413 | if hei_interf == None: |
|
412 | 414 | count_hei = num_hei/2 #Como es entero no importa |
|
413 | 415 | hei_interf = numpy.asmatrix(range(count_hei)) + num_hei - count_hei |
|
414 | 416 | hei_interf = numpy.asarray(hei_interf)[0] |
|
415 | 417 | #nhei_interf |
|
416 | 418 | if (nhei_interf == None): |
|
417 | 419 | nhei_interf = 5 |
|
418 | 420 | if (nhei_interf < 1): |
|
419 | 421 | nhei_interf = 1 |
|
420 | 422 | if (nhei_interf > count_hei): |
|
421 | 423 | nhei_interf = count_hei |
|
422 | 424 | if (offhei_interf == None): |
|
423 | 425 | offhei_interf = 0 |
|
424 | 426 | |
|
425 | 427 | ind_hei = range(num_hei) |
|
426 | 428 | # mask_prof = numpy.asarray(range(num_prof - 2)) + 1 |
|
427 | 429 | # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1 |
|
428 | 430 | mask_prof = numpy.asarray(range(num_prof)) |
|
429 | 431 | num_mask_prof = mask_prof.size |
|
430 | 432 | comp_mask_prof = [0, num_prof/2] |
|
431 | 433 | |
|
432 | 434 | |
|
433 | 435 | #noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal |
|
434 | 436 | if (jnoise.size < num_channel or numpy.isnan(jnoise).any()): |
|
435 | 437 | jnoise = numpy.nan |
|
436 | 438 | noise_exist = jnoise[0] < numpy.Inf |
|
437 | 439 | |
|
438 | 440 | #Subrutina de Remocion de la Interferencia |
|
439 | 441 | for ich in range(num_channel): |
|
440 | 442 | #Se ordena los espectros segun su potencia (menor a mayor) |
|
441 | 443 | power = jspectra[ich,mask_prof,:] |
|
442 | 444 | power = power[:,hei_interf] |
|
443 | 445 | power = power.sum(axis = 0) |
|
444 | 446 | psort = power.ravel().argsort() |
|
445 | 447 | |
|
446 | 448 | #Se estima la interferencia promedio en los Espectros de Potencia empleando |
|
447 | 449 | junkspc_interf = jspectra[ich,:,hei_interf[psort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
448 | 450 | |
|
449 | 451 | if noise_exist: |
|
450 | 452 | # tmp_noise = jnoise[ich] / num_prof |
|
451 | 453 | tmp_noise = jnoise[ich] |
|
452 | 454 | junkspc_interf = junkspc_interf - tmp_noise |
|
453 | 455 | #junkspc_interf[:,comp_mask_prof] = 0 |
|
454 | 456 | |
|
455 | 457 | jspc_interf = junkspc_interf.sum(axis = 0) / nhei_interf |
|
456 | 458 | jspc_interf = jspc_interf.transpose() |
|
457 | 459 | #Calculando el espectro de interferencia promedio |
|
458 | 460 | noiseid = numpy.where(jspc_interf <= tmp_noise/ math.sqrt(num_incoh)) |
|
459 | 461 | noiseid = noiseid[0] |
|
460 | 462 | cnoiseid = noiseid.size |
|
461 | 463 | interfid = numpy.where(jspc_interf > tmp_noise/ math.sqrt(num_incoh)) |
|
462 | 464 | interfid = interfid[0] |
|
463 | 465 | cinterfid = interfid.size |
|
464 | 466 | |
|
465 | 467 | if (cnoiseid > 0): jspc_interf[noiseid] = 0 |
|
466 | 468 | |
|
467 | 469 | #Expandiendo los perfiles a limpiar |
|
468 | 470 | if (cinterfid > 0): |
|
469 | 471 | new_interfid = (numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof)%num_prof |
|
470 | 472 | new_interfid = numpy.asarray(new_interfid) |
|
471 | 473 | new_interfid = {x for x in new_interfid} |
|
472 | 474 | new_interfid = numpy.array(list(new_interfid)) |
|
473 | 475 | new_cinterfid = new_interfid.size |
|
474 | 476 | else: new_cinterfid = 0 |
|
475 | 477 | |
|
476 | 478 | for ip in range(new_cinterfid): |
|
477 | 479 | ind = junkspc_interf[:,new_interfid[ip]].ravel().argsort() |
|
478 | 480 | jspc_interf[new_interfid[ip]] = junkspc_interf[ind[nhei_interf/2],new_interfid[ip]] |
|
479 | 481 | |
|
480 | 482 | |
|
481 | 483 | jspectra[ich,:,ind_hei] = jspectra[ich,:,ind_hei] - jspc_interf #Corregir indices |
|
482 | 484 | |
|
483 | 485 | #Removiendo la interferencia del punto de mayor interferencia |
|
484 | 486 | ListAux = jspc_interf[mask_prof].tolist() |
|
485 | 487 | maxid = ListAux.index(max(ListAux)) |
|
486 | 488 | |
|
487 | 489 | |
|
488 | 490 | if cinterfid > 0: |
|
489 | 491 | for ip in range(cinterfid*(interf == 2) - 1): |
|
490 | 492 | ind = (jspectra[ich,interfid[ip],:] < tmp_noise*(1 + 1/math.sqrt(num_incoh))).nonzero() |
|
491 | 493 | cind = len(ind) |
|
492 | 494 | |
|
493 | 495 | if (cind > 0): |
|
494 | 496 | jspectra[ich,interfid[ip],ind] = tmp_noise*(1 + (numpy.random.uniform(cind) - 0.5)/math.sqrt(num_incoh)) |
|
495 | 497 | |
|
496 | 498 | ind = numpy.array([-2,-1,1,2]) |
|
497 | 499 | xx = numpy.zeros([4,4]) |
|
498 | 500 | |
|
499 | 501 | for id1 in range(4): |
|
500 | 502 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
501 | 503 | |
|
502 | 504 | xx_inv = numpy.linalg.inv(xx) |
|
503 | 505 | xx = xx_inv[:,0] |
|
504 | 506 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
505 | 507 | yy = jspectra[ich,mask_prof[ind],:] |
|
506 | 508 | jspectra[ich,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
507 | 509 | |
|
508 | 510 | |
|
509 | 511 | indAux = (jspectra[ich,:,:] < tmp_noise*(1-1/math.sqrt(num_incoh))).nonzero() |
|
510 | 512 | jspectra[ich,indAux[0],indAux[1]] = tmp_noise * (1 - 1/math.sqrt(num_incoh)) |
|
511 | 513 | |
|
512 | 514 | #Remocion de Interferencia en el Cross Spectra |
|
513 | 515 | if jcspectra == None: return jspectra, jcspectra |
|
514 | 516 | num_pairs = jcspectra.size/(num_prof*num_hei) |
|
515 | 517 | jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei) |
|
516 | 518 | |
|
517 | 519 | for ip in range(num_pairs): |
|
518 | 520 | |
|
519 | 521 | #------------------------------------------- |
|
520 | 522 | |
|
521 | 523 | cspower = numpy.abs(jcspectra[ip,mask_prof,:]) |
|
522 | 524 | cspower = cspower[:,hei_interf] |
|
523 | 525 | cspower = cspower.sum(axis = 0) |
|
524 | 526 | |
|
525 | 527 | cspsort = cspower.ravel().argsort() |
|
526 | 528 | junkcspc_interf = jcspectra[ip,:,hei_interf[cspsort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
527 | 529 | junkcspc_interf = junkcspc_interf.transpose() |
|
528 | 530 | jcspc_interf = junkcspc_interf.sum(axis = 1)/nhei_interf |
|
529 | 531 | |
|
530 | 532 | ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort() |
|
531 | 533 | |
|
532 | 534 | median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
533 | 535 | median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
534 | 536 | junkcspc_interf[comp_mask_prof,:] = numpy.complex(median_real, median_imag) |
|
535 | 537 | |
|
536 | 538 | for iprof in range(num_prof): |
|
537 | 539 | ind = numpy.abs(junkcspc_interf[iprof,:]).ravel().argsort() |
|
538 | 540 | jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf/2]] |
|
539 | 541 | |
|
540 | 542 | #Removiendo la Interferencia |
|
541 | 543 | jcspectra[ip,:,ind_hei] = jcspectra[ip,:,ind_hei] - jcspc_interf |
|
542 | 544 | |
|
543 | 545 | ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist() |
|
544 | 546 | maxid = ListAux.index(max(ListAux)) |
|
545 | 547 | |
|
546 | 548 | ind = numpy.array([-2,-1,1,2]) |
|
547 | 549 | xx = numpy.zeros([4,4]) |
|
548 | 550 | |
|
549 | 551 | for id1 in range(4): |
|
550 | 552 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
551 | 553 | |
|
552 | 554 | xx_inv = numpy.linalg.inv(xx) |
|
553 | 555 | xx = xx_inv[:,0] |
|
554 | 556 | |
|
555 | 557 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
556 | 558 | yy = jcspectra[ip,mask_prof[ind],:] |
|
557 | 559 | jcspectra[ip,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
558 | 560 | |
|
559 | 561 | #Guardar Resultados |
|
560 | 562 | self.dataOut.data_spc = jspectra |
|
561 | 563 | self.dataOut.data_cspc = jcspectra |
|
562 | 564 | |
|
563 | 565 | return 1 |
|
564 | 566 | |
|
565 | 567 | def setRadarFrequency(self, frequency=None): |
|
566 | 568 | if frequency != None: |
|
567 | 569 | self.dataOut.frequency = frequency |
|
568 | 570 | |
|
569 | 571 | return 1 |
|
570 | 572 | |
|
571 | 573 | def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None): |
|
572 | 574 | #validacion de rango |
|
573 | 575 | if minHei == None: |
|
574 | 576 | minHei = self.dataOut.heightList[0] |
|
575 | 577 | |
|
576 | 578 | if maxHei == None: |
|
577 | 579 | maxHei = self.dataOut.heightList[-1] |
|
578 | 580 | |
|
579 | 581 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
580 | 582 | print 'minHei: %.2f is out of the heights range'%(minHei) |
|
581 | 583 | print 'minHei is setting to %.2f'%(self.dataOut.heightList[0]) |
|
582 | 584 | minHei = self.dataOut.heightList[0] |
|
583 | 585 | |
|
584 | 586 | if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei): |
|
585 | 587 | print 'maxHei: %.2f is out of the heights range'%(maxHei) |
|
586 | 588 | print 'maxHei is setting to %.2f'%(self.dataOut.heightList[-1]) |
|
587 | 589 | maxHei = self.dataOut.heightList[-1] |
|
588 | 590 | |
|
589 | 591 | # validacion de velocidades |
|
590 | 592 | velrange = self.dataOut.getVelRange(1) |
|
591 | 593 | |
|
592 | 594 | if minVel == None: |
|
593 | 595 | minVel = velrange[0] |
|
594 | 596 | |
|
595 | 597 | if maxVel == None: |
|
596 | 598 | maxVel = velrange[-1] |
|
597 | 599 | |
|
598 | 600 | if (minVel < velrange[0]) or (minVel > maxVel): |
|
599 | 601 | print 'minVel: %.2f is out of the velocity range'%(minVel) |
|
600 | 602 | print 'minVel is setting to %.2f'%(velrange[0]) |
|
601 | 603 | minVel = velrange[0] |
|
602 | 604 | |
|
603 | 605 | if (maxVel > velrange[-1]) or (maxVel < minVel): |
|
604 | 606 | print 'maxVel: %.2f is out of the velocity range'%(maxVel) |
|
605 | 607 | print 'maxVel is setting to %.2f'%(velrange[-1]) |
|
606 | 608 | maxVel = velrange[-1] |
|
607 | 609 | |
|
608 | 610 | # seleccion de indices para rango |
|
609 | 611 | minIndex = 0 |
|
610 | 612 | maxIndex = 0 |
|
611 | 613 | heights = self.dataOut.heightList |
|
612 | 614 | |
|
613 | 615 | inda = numpy.where(heights >= minHei) |
|
614 | 616 | indb = numpy.where(heights <= maxHei) |
|
615 | 617 | |
|
616 | 618 | try: |
|
617 | 619 | minIndex = inda[0][0] |
|
618 | 620 | except: |
|
619 | 621 | minIndex = 0 |
|
620 | 622 | |
|
621 | 623 | try: |
|
622 | 624 | maxIndex = indb[0][-1] |
|
623 | 625 | except: |
|
624 | 626 | maxIndex = len(heights) |
|
625 | 627 | |
|
626 | 628 | if (minIndex < 0) or (minIndex > maxIndex): |
|
627 | 629 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
628 | 630 | |
|
629 | 631 | if (maxIndex >= self.dataOut.nHeights): |
|
630 | 632 | maxIndex = self.dataOut.nHeights-1 |
|
631 | 633 | |
|
632 | 634 | # seleccion de indices para velocidades |
|
633 | 635 | indminvel = numpy.where(velrange >= minVel) |
|
634 | 636 | indmaxvel = numpy.where(velrange <= maxVel) |
|
635 | 637 | try: |
|
636 | 638 | minIndexVel = indminvel[0][0] |
|
637 | 639 | except: |
|
638 | 640 | minIndexVel = 0 |
|
639 | 641 | |
|
640 | 642 | try: |
|
641 | 643 | maxIndexVel = indmaxvel[0][-1] |
|
642 | 644 | except: |
|
643 | 645 | maxIndexVel = len(velrange) |
|
644 | 646 | |
|
645 | 647 | #seleccion del espectro |
|
646 | 648 | data_spc = self.dataOut.data_spc[:,minIndexVel:maxIndexVel+1,minIndex:maxIndex+1] |
|
647 | 649 | #estimacion de ruido |
|
648 | 650 | noise = numpy.zeros(self.dataOut.nChannels) |
|
649 | 651 | |
|
650 | 652 | for channel in range(self.dataOut.nChannels): |
|
651 | 653 | daux = data_spc[channel,:,:] |
|
652 | 654 | noise[channel] = hildebrand_sekhon(daux, self.dataOut.nIncohInt) |
|
653 | 655 | |
|
654 | 656 | self.dataOut.noise_estimation = noise.copy() |
|
655 | 657 | |
|
656 | 658 | return 1 |
|
657 | 659 | |
|
658 | 660 | class IncohInt(Operation): |
|
659 | 661 | |
|
660 | 662 | |
|
661 | 663 | __profIndex = 0 |
|
662 | 664 | __withOverapping = False |
|
663 | 665 | |
|
664 | 666 | __byTime = False |
|
665 | 667 | __initime = None |
|
666 | 668 | __lastdatatime = None |
|
667 | 669 | __integrationtime = None |
|
668 | 670 | |
|
669 | 671 | __buffer_spc = None |
|
670 | 672 | __buffer_cspc = None |
|
671 | 673 | __buffer_dc = None |
|
672 | 674 | |
|
673 | 675 | __dataReady = False |
|
674 | 676 | |
|
675 | 677 | __timeInterval = None |
|
676 | 678 | |
|
677 | 679 | n = None |
|
678 | 680 | |
|
679 | 681 | |
|
680 | 682 | |
|
681 | 683 | def __init__(self): |
|
682 | 684 | |
|
683 | 685 | Operation.__init__(self) |
|
684 | 686 | # self.isConfig = False |
|
685 | 687 | |
|
686 | 688 | def setup(self, n=None, timeInterval=None, overlapping=False): |
|
687 | 689 | """ |
|
688 | 690 | Set the parameters of the integration class. |
|
689 | 691 | |
|
690 | 692 | Inputs: |
|
691 | 693 | |
|
692 | 694 | n : Number of coherent integrations |
|
693 | 695 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
694 | 696 | overlapping : |
|
695 | 697 | |
|
696 | 698 | """ |
|
697 | 699 | |
|
698 | 700 | self.__initime = None |
|
699 | 701 | self.__lastdatatime = 0 |
|
700 | 702 | self.__buffer_spc = None |
|
701 | 703 | self.__buffer_cspc = None |
|
702 | 704 | self.__buffer_dc = None |
|
703 | 705 | self.__dataReady = False |
|
704 | 706 | |
|
705 | 707 | |
|
706 | 708 | if n == None and timeInterval == None: |
|
707 | 709 | raise ValueError, "n or timeInterval should be specified ..." |
|
708 | 710 | |
|
709 | 711 | if n != None: |
|
710 | 712 | self.n = n |
|
711 | 713 | self.__byTime = False |
|
712 | 714 | else: |
|
713 | 715 | self.__integrationtime = timeInterval #if (type(timeInterval)!=integer) -> change this line |
|
714 | 716 | self.n = 9999 |
|
715 | 717 | self.__byTime = True |
|
716 | 718 | |
|
717 | 719 | if overlapping: |
|
718 | 720 | self.__withOverapping = True |
|
719 | 721 | else: |
|
720 | 722 | self.__withOverapping = False |
|
721 | 723 | self.__buffer_spc = 0 |
|
722 | 724 | self.__buffer_cspc = 0 |
|
723 | 725 | self.__buffer_dc = 0 |
|
724 | 726 | |
|
725 | 727 | self.__profIndex = 0 |
|
726 | 728 | |
|
727 | 729 | def putData(self, data_spc, data_cspc, data_dc): |
|
728 | 730 | |
|
729 | 731 | """ |
|
730 | 732 | Add a profile to the __buffer_spc and increase in one the __profileIndex |
|
731 | 733 | |
|
732 | 734 | """ |
|
733 | 735 | |
|
734 | 736 | if not self.__withOverapping: |
|
735 | 737 | self.__buffer_spc += data_spc |
|
736 | 738 | |
|
737 | 739 | if data_cspc == None: |
|
738 | 740 | self.__buffer_cspc = None |
|
739 | 741 | else: |
|
740 | 742 | self.__buffer_cspc += data_cspc |
|
741 | 743 | |
|
742 | 744 | if data_dc == None: |
|
743 | 745 | self.__buffer_dc = None |
|
744 | 746 | else: |
|
745 | 747 | self.__buffer_dc += data_dc |
|
746 | 748 | |
|
747 | 749 | self.__profIndex += 1 |
|
748 | 750 | return |
|
749 | 751 | |
|
750 | 752 | #Overlapping data |
|
751 | 753 | nChannels, nFFTPoints, nHeis = data_spc.shape |
|
752 | 754 | data_spc = numpy.reshape(data_spc, (1, nChannels, nFFTPoints, nHeis)) |
|
753 | 755 | if data_cspc != None: |
|
754 | 756 | data_cspc = numpy.reshape(data_cspc, (1, -1, nFFTPoints, nHeis)) |
|
755 | 757 | if data_dc != None: |
|
756 | 758 | data_dc = numpy.reshape(data_dc, (1, -1, nHeis)) |
|
757 | 759 | |
|
758 | 760 | #If the buffer is empty then it takes the data value |
|
759 | 761 | if self.__buffer_spc == None: |
|
760 | 762 | self.__buffer_spc = data_spc |
|
761 | 763 | |
|
762 | 764 | if data_cspc == None: |
|
763 | 765 | self.__buffer_cspc = None |
|
764 | 766 | else: |
|
765 | 767 | self.__buffer_cspc += data_cspc |
|
766 | 768 | |
|
767 | 769 | if data_dc == None: |
|
768 | 770 | self.__buffer_dc = None |
|
769 | 771 | else: |
|
770 | 772 | self.__buffer_dc += data_dc |
|
771 | 773 | |
|
772 | 774 | self.__profIndex += 1 |
|
773 | 775 | return |
|
774 | 776 | |
|
775 | 777 | #If the buffer length is lower than n then stakcing the data value |
|
776 | 778 | if self.__profIndex < self.n: |
|
777 | 779 | self.__buffer_spc = numpy.vstack((self.__buffer_spc, data_spc)) |
|
778 | 780 | |
|
779 | 781 | if data_cspc != None: |
|
780 | 782 | self.__buffer_cspc = numpy.vstack((self.__buffer_cspc, data_cspc)) |
|
781 | 783 | |
|
782 | 784 | if data_dc != None: |
|
783 | 785 | self.__buffer_dc = numpy.vstack((self.__buffer_dc, data_dc)) |
|
784 | 786 | |
|
785 | 787 | self.__profIndex += 1 |
|
786 | 788 | return |
|
787 | 789 | |
|
788 | 790 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
789 | 791 | self.__buffer_spc = numpy.roll(self.__buffer_spc, -1, axis=0) |
|
790 | 792 | self.__buffer_spc[self.n-1] = data_spc |
|
791 | 793 | |
|
792 | 794 | if data_cspc != None: |
|
793 | 795 | self.__buffer_cspc = numpy.roll(self.__buffer_cspc, -1, axis=0) |
|
794 | 796 | self.__buffer_cspc[self.n-1] = data_cspc |
|
795 | 797 | |
|
796 | 798 | if data_dc != None: |
|
797 | 799 | self.__buffer_dc = numpy.roll(self.__buffer_dc, -1, axis=0) |
|
798 | 800 | self.__buffer_dc[self.n-1] = data_dc |
|
799 | 801 | |
|
800 | 802 | self.__profIndex = self.n |
|
801 | 803 | return |
|
802 | 804 | |
|
803 | 805 | |
|
804 | 806 | def pushData(self): |
|
805 | 807 | """ |
|
806 | 808 | Return the sum of the last profiles and the profiles used in the sum. |
|
807 | 809 | |
|
808 | 810 | Affected: |
|
809 | 811 | |
|
810 | 812 | self.__profileIndex |
|
811 | 813 | |
|
812 | 814 | """ |
|
813 | 815 | data_spc = None |
|
814 | 816 | data_cspc = None |
|
815 | 817 | data_dc = None |
|
816 | 818 | |
|
817 | 819 | if not self.__withOverapping: |
|
818 | 820 | data_spc = self.__buffer_spc |
|
819 | 821 | data_cspc = self.__buffer_cspc |
|
820 | 822 | data_dc = self.__buffer_dc |
|
821 | 823 | |
|
822 | 824 | n = self.__profIndex |
|
823 | 825 | |
|
824 | 826 | self.__buffer_spc = 0 |
|
825 | 827 | self.__buffer_cspc = 0 |
|
826 | 828 | self.__buffer_dc = 0 |
|
827 | 829 | self.__profIndex = 0 |
|
828 | 830 | |
|
829 | 831 | return data_spc, data_cspc, data_dc, n |
|
830 | 832 | |
|
831 | 833 | #Integration with Overlapping |
|
832 | 834 | data_spc = numpy.sum(self.__buffer_spc, axis=0) |
|
833 | 835 | |
|
834 | 836 | if self.__buffer_cspc != None: |
|
835 | 837 | data_cspc = numpy.sum(self.__buffer_cspc, axis=0) |
|
836 | 838 | |
|
837 | 839 | if self.__buffer_dc != None: |
|
838 | 840 | data_dc = numpy.sum(self.__buffer_dc, axis=0) |
|
839 | 841 | |
|
840 | 842 | n = self.__profIndex |
|
841 | 843 | |
|
842 | 844 | return data_spc, data_cspc, data_dc, n |
|
843 | 845 | |
|
844 | 846 | def byProfiles(self, *args): |
|
845 | 847 | |
|
846 | 848 | self.__dataReady = False |
|
847 | 849 | avgdata_spc = None |
|
848 | 850 | avgdata_cspc = None |
|
849 | 851 | avgdata_dc = None |
|
850 | 852 | # n = None |
|
851 | 853 | |
|
852 | 854 | self.putData(*args) |
|
853 | 855 | |
|
854 | 856 | if self.__profIndex == self.n: |
|
855 | 857 | |
|
856 | 858 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
857 | 859 | self.__dataReady = True |
|
858 | 860 | |
|
859 | 861 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
860 | 862 | |
|
861 | 863 | def byTime(self, datatime, *args): |
|
862 | 864 | |
|
863 | 865 | self.__dataReady = False |
|
864 | 866 | avgdata_spc = None |
|
865 | 867 | avgdata_cspc = None |
|
866 | 868 | avgdata_dc = None |
|
867 | 869 | n = None |
|
868 | 870 | |
|
869 | 871 | self.putData(*args) |
|
870 | 872 | |
|
871 | 873 | if (datatime - self.__initime) >= self.__integrationtime: |
|
872 | 874 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
873 | 875 | self.n = n |
|
874 | 876 | self.__dataReady = True |
|
875 | 877 | |
|
876 | 878 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
877 | 879 | |
|
878 | 880 | def integrate(self, datatime, *args): |
|
879 | 881 | |
|
880 | 882 | if self.__initime == None: |
|
881 | 883 | self.__initime = datatime |
|
882 | 884 | |
|
883 | 885 | if self.__byTime: |
|
884 | 886 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(datatime, *args) |
|
885 | 887 | else: |
|
886 | 888 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args) |
|
887 | 889 | |
|
888 | 890 | self.__lastdatatime = datatime |
|
889 | 891 | |
|
890 | 892 | if avgdata_spc == None: |
|
891 | 893 | return None, None, None, None |
|
892 | 894 | |
|
893 | 895 | avgdatatime = self.__initime |
|
894 | 896 | try: |
|
895 | 897 | self.__timeInterval = (self.__lastdatatime - self.__initime)/(self.n - 1) |
|
896 | 898 | except: |
|
897 | 899 | self.__timeInterval = self.__lastdatatime - self.__initime |
|
898 | 900 | |
|
899 | 901 | deltatime = datatime -self.__lastdatatime |
|
900 | 902 | |
|
901 | 903 | if not self.__withOverapping: |
|
902 | 904 | self.__initime = datatime |
|
903 | 905 | else: |
|
904 | 906 | self.__initime += deltatime |
|
905 | 907 | |
|
906 | 908 | return avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc |
|
907 | 909 | |
|
908 | 910 | def run(self, dataOut, n=None, timeInterval=None, overlapping=False): |
|
909 | 911 | |
|
910 | 912 | if n==1: |
|
911 | 913 | dataOut.flagNoData = False |
|
912 | 914 | return |
|
913 | 915 | |
|
914 | 916 | if not self.isConfig: |
|
915 | 917 | self.setup(n, timeInterval, overlapping) |
|
916 | 918 | self.isConfig = True |
|
917 | 919 | |
|
918 | 920 | avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime, |
|
919 | 921 | dataOut.data_spc, |
|
920 | 922 | dataOut.data_cspc, |
|
921 | 923 | dataOut.data_dc) |
|
922 | 924 | |
|
923 | 925 | # dataOut.timeInterval *= n |
|
924 | 926 | dataOut.flagNoData = True |
|
925 | 927 | |
|
926 | 928 | if self.__dataReady: |
|
927 | 929 | |
|
928 | 930 | dataOut.data_spc = avgdata_spc |
|
929 | 931 | dataOut.data_cspc = avgdata_cspc |
|
930 | 932 | dataOut.data_dc = avgdata_dc |
|
931 | 933 | |
|
932 | 934 | dataOut.nIncohInt *= self.n |
|
933 | 935 | dataOut.utctime = avgdatatime |
|
934 | 936 | #dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt * dataOut.nIncohInt * dataOut.nFFTPoints |
|
935 | 937 | # dataOut.timeInterval = self.__timeInterval*self.n |
|
936 | 938 | dataOut.flagNoData = False |
@@ -1,1034 +1,1043 | |||
|
1 | 1 | import numpy |
|
2 | 2 | |
|
3 | 3 | from jroproc_base import ProcessingUnit, Operation |
|
4 | 4 | from schainpy.model.data.jrodata import Voltage |
|
5 | 5 | |
|
6 | 6 | class VoltageProc(ProcessingUnit): |
|
7 | 7 | |
|
8 | 8 | |
|
9 | 9 | def __init__(self): |
|
10 | 10 | |
|
11 | 11 | ProcessingUnit.__init__(self) |
|
12 | 12 | |
|
13 | 13 | # self.objectDict = {} |
|
14 | 14 | self.dataOut = Voltage() |
|
15 | 15 | self.flip = 1 |
|
16 | 16 | |
|
17 | 17 | def run(self): |
|
18 | 18 | if self.dataIn.type == 'AMISR': |
|
19 | 19 | self.__updateObjFromAmisrInput() |
|
20 | 20 | |
|
21 | 21 | if self.dataIn.type == 'Voltage': |
|
22 | 22 | self.dataOut.copy(self.dataIn) |
|
23 | 23 | |
|
24 | 24 | # self.dataOut.copy(self.dataIn) |
|
25 | 25 | |
|
26 | 26 | def __updateObjFromAmisrInput(self): |
|
27 | 27 | |
|
28 | 28 | self.dataOut.timeZone = self.dataIn.timeZone |
|
29 | 29 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
30 | 30 | self.dataOut.errorCount = self.dataIn.errorCount |
|
31 | 31 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
32 | 32 | |
|
33 | 33 | self.dataOut.flagNoData = self.dataIn.flagNoData |
|
34 | 34 | self.dataOut.data = self.dataIn.data |
|
35 | 35 | self.dataOut.utctime = self.dataIn.utctime |
|
36 | 36 | self.dataOut.channelList = self.dataIn.channelList |
|
37 | 37 | self.dataOut.timeInterval = self.dataIn.timeInterval |
|
38 | 38 | self.dataOut.heightList = self.dataIn.heightList |
|
39 | 39 | self.dataOut.nProfiles = self.dataIn.nProfiles |
|
40 | 40 | |
|
41 | 41 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
42 | 42 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
43 | 43 | self.dataOut.frequency = self.dataIn.frequency |
|
44 | 44 | |
|
45 | 45 | self.dataOut.azimuth = self.dataIn.azimuth |
|
46 | 46 | self.dataOut.zenith = self.dataIn.zenith |
|
47 | 47 | |
|
48 | 48 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
49 | 49 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
50 | 50 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
51 | 51 | # |
|
52 | 52 | # pass# |
|
53 | 53 | # |
|
54 | 54 | # def init(self): |
|
55 | 55 | # |
|
56 | 56 | # |
|
57 | 57 | # if self.dataIn.type == 'AMISR': |
|
58 | 58 | # self.__updateObjFromAmisrInput() |
|
59 | 59 | # |
|
60 | 60 | # if self.dataIn.type == 'Voltage': |
|
61 | 61 | # self.dataOut.copy(self.dataIn) |
|
62 | 62 | # # No necesita copiar en cada init() los atributos de dataIn |
|
63 | 63 | # # la copia deberia hacerse por cada nuevo bloque de datos |
|
64 | 64 | |
|
65 | 65 | def selectChannels(self, channelList): |
|
66 | 66 | |
|
67 | 67 | channelIndexList = [] |
|
68 | 68 | |
|
69 | 69 | for channel in channelList: |
|
70 | if channel not in self.dataOut.channelList: | |
|
71 | continue | |
|
72 | ||
|
70 | 73 | index = self.dataOut.channelList.index(channel) |
|
71 | 74 | channelIndexList.append(index) |
|
72 | 75 | |
|
73 | 76 | self.selectChannelsByIndex(channelIndexList) |
|
74 | 77 | |
|
75 | 78 | def selectChannelsByIndex(self, channelIndexList): |
|
76 | 79 | """ |
|
77 | 80 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
78 | 81 | |
|
79 | 82 | Input: |
|
80 | 83 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
81 | 84 | |
|
82 | 85 | Affected: |
|
83 | 86 | self.dataOut.data |
|
84 | 87 | self.dataOut.channelIndexList |
|
85 | 88 | self.dataOut.nChannels |
|
86 | 89 | self.dataOut.m_ProcessingHeader.totalSpectra |
|
87 | 90 | self.dataOut.systemHeaderObj.numChannels |
|
88 | 91 | self.dataOut.m_ProcessingHeader.blockSize |
|
89 | 92 | |
|
90 | 93 | Return: |
|
91 | 94 | None |
|
92 | 95 | """ |
|
93 | 96 | |
|
94 | 97 | for channelIndex in channelIndexList: |
|
95 | 98 | if channelIndex not in self.dataOut.channelIndexList: |
|
96 | 99 | print channelIndexList |
|
97 | 100 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
98 | 101 | |
|
99 | 102 | # nChannels = len(channelIndexList) |
|
100 | 103 | if self.dataOut.flagDataAsBlock: |
|
101 | 104 | """ |
|
102 | 105 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
103 | 106 | """ |
|
104 | 107 | data = self.dataOut.data[channelIndexList,:,:] |
|
105 | 108 | else: |
|
106 | 109 | data = self.dataOut.data[channelIndexList,:] |
|
107 | 110 | |
|
108 | 111 | self.dataOut.data = data |
|
109 | 112 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
110 | 113 | # self.dataOut.nChannels = nChannels |
|
111 | 114 | |
|
112 | 115 | return 1 |
|
113 | 116 | |
|
114 | 117 | def selectHeights(self, minHei=None, maxHei=None): |
|
115 | 118 | """ |
|
116 | 119 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
117 | 120 | minHei <= height <= maxHei |
|
118 | 121 | |
|
119 | 122 | Input: |
|
120 | 123 | minHei : valor minimo de altura a considerar |
|
121 | 124 | maxHei : valor maximo de altura a considerar |
|
122 | 125 | |
|
123 | 126 | Affected: |
|
124 | 127 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
125 | 128 | |
|
126 | 129 | Return: |
|
127 | 130 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
128 | 131 | """ |
|
129 | 132 | |
|
130 | 133 | if minHei == None: |
|
131 | 134 | minHei = self.dataOut.heightList[0] |
|
132 | 135 | |
|
133 | 136 | if maxHei == None: |
|
134 | 137 | maxHei = self.dataOut.heightList[-1] |
|
135 | 138 | |
|
136 | 139 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
137 | 140 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
138 | 141 | |
|
139 | 142 | |
|
140 | 143 | if (maxHei > self.dataOut.heightList[-1]): |
|
141 | 144 | maxHei = self.dataOut.heightList[-1] |
|
142 | 145 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
143 | 146 | |
|
144 | 147 | minIndex = 0 |
|
145 | 148 | maxIndex = 0 |
|
146 | 149 | heights = self.dataOut.heightList |
|
147 | 150 | |
|
148 | 151 | inda = numpy.where(heights >= minHei) |
|
149 | 152 | indb = numpy.where(heights <= maxHei) |
|
150 | 153 | |
|
151 | 154 | try: |
|
152 | 155 | minIndex = inda[0][0] |
|
153 | 156 | except: |
|
154 | 157 | minIndex = 0 |
|
155 | 158 | |
|
156 | 159 | try: |
|
157 | 160 | maxIndex = indb[0][-1] |
|
158 | 161 | except: |
|
159 | 162 | maxIndex = len(heights) |
|
160 | 163 | |
|
161 | 164 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
162 | 165 | |
|
163 | 166 | return 1 |
|
164 | 167 | |
|
165 | 168 | |
|
166 | 169 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
167 | 170 | """ |
|
168 | 171 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
169 | 172 | minIndex <= index <= maxIndex |
|
170 | 173 | |
|
171 | 174 | Input: |
|
172 | 175 | minIndex : valor de indice minimo de altura a considerar |
|
173 | 176 | maxIndex : valor de indice maximo de altura a considerar |
|
174 | 177 | |
|
175 | 178 | Affected: |
|
176 | 179 | self.dataOut.data |
|
177 | 180 | self.dataOut.heightList |
|
178 | 181 | |
|
179 | 182 | Return: |
|
180 | 183 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
181 | 184 | """ |
|
182 | 185 | |
|
183 | 186 | if (minIndex < 0) or (minIndex > maxIndex): |
|
184 | 187 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
185 | 188 | |
|
186 | 189 | if (maxIndex >= self.dataOut.nHeights): |
|
187 | 190 | maxIndex = self.dataOut.nHeights |
|
188 | 191 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
189 | 192 | |
|
190 | 193 | # nHeights = maxIndex - minIndex + 1 |
|
191 | 194 | |
|
192 | 195 | #voltage |
|
193 | 196 | if self.dataOut.flagDataAsBlock: |
|
194 | 197 | """ |
|
195 | 198 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
196 | 199 | """ |
|
197 | 200 | data = self.dataOut.data[:,minIndex:maxIndex,:] |
|
198 | 201 | else: |
|
199 | 202 | data = self.dataOut.data[:,minIndex:maxIndex] |
|
200 | 203 | |
|
201 | 204 | # firstHeight = self.dataOut.heightList[minIndex] |
|
202 | 205 | |
|
203 | 206 | self.dataOut.data = data |
|
204 | 207 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex] |
|
205 | 208 | |
|
206 | 209 | return 1 |
|
207 | 210 | |
|
208 | 211 | |
|
209 | 212 | def filterByHeights(self, window): |
|
210 | 213 | |
|
211 | 214 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
212 | 215 | |
|
213 | 216 | if window == None: |
|
214 | 217 | window = (self.dataOut.radarControllerHeaderObj.txA/self.dataOut.radarControllerHeaderObj.nBaud) / deltaHeight |
|
215 | 218 | |
|
216 | 219 | newdelta = deltaHeight * window |
|
217 | 220 | r = self.dataOut.nHeights % window |
|
218 | 221 | |
|
219 | 222 | if self.dataOut.flagDataAsBlock: |
|
220 | 223 | """ |
|
221 | 224 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
222 | 225 | """ |
|
223 | 226 | buffer = self.dataOut.data[:, :, 0:self.dataOut.nHeights-r] |
|
224 | 227 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nProfiles,self.dataOut.nHeights/window,window) |
|
225 | 228 | buffer = numpy.sum(buffer,3) |
|
226 | 229 | |
|
227 | 230 | else: |
|
228 | 231 | buffer = self.dataOut.data[:,0:self.dataOut.nHeights-r] |
|
229 | 232 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nHeights/window,window) |
|
230 | 233 | buffer = numpy.sum(buffer,2) |
|
231 | 234 | |
|
232 | 235 | self.dataOut.data = buffer.copy() |
|
233 | 236 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*(self.dataOut.nHeights-r)/window,newdelta) |
|
234 | 237 | self.dataOut.windowOfFilter = window |
|
235 | 238 | |
|
236 | 239 | def setH0(self, h0, deltaHeight = None): |
|
237 | 240 | |
|
238 | 241 | if not deltaHeight: |
|
239 | 242 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
240 | 243 | |
|
241 | 244 | nHeights = self.dataOut.nHeights |
|
242 | 245 | |
|
243 | 246 | newHeiRange = h0 + numpy.arange(nHeights)*deltaHeight |
|
244 | 247 | |
|
245 | 248 | self.dataOut.heightList = newHeiRange |
|
246 | 249 | |
|
247 | 250 | def deFlip(self, channelList = []): |
|
248 | 251 | |
|
249 | 252 | data = self.dataOut.data.copy() |
|
250 | 253 | |
|
251 | 254 | if self.dataOut.flagDataAsBlock: |
|
252 | 255 | flip = self.flip |
|
253 | 256 | profileList = range(self.dataOut.nProfiles) |
|
254 | 257 | |
|
255 | 258 | if channelList == []: |
|
256 | 259 | for thisProfile in profileList: |
|
257 | 260 | data[:,thisProfile,:] = data[:,thisProfile,:]*flip |
|
258 | 261 | flip *= -1.0 |
|
259 | 262 | else: |
|
260 | 263 | for thisChannel in channelList: |
|
264 | if thisChannel not in self.dataOut.channelList: | |
|
265 | continue | |
|
266 | ||
|
261 | 267 | for thisProfile in profileList: |
|
262 | 268 | data[thisChannel,thisProfile,:] = data[thisChannel,thisProfile,:]*flip |
|
263 | 269 | flip *= -1.0 |
|
264 | 270 | |
|
265 | 271 | self.flip = flip |
|
266 | 272 | |
|
267 | 273 | else: |
|
268 | 274 | if channelList == []: |
|
269 | 275 | data[:,:] = data[:,:]*self.flip |
|
270 | 276 | else: |
|
271 | 277 | for thisChannel in channelList: |
|
278 | if thisChannel not in self.dataOut.channelList: | |
|
279 | continue | |
|
280 | ||
|
272 | 281 | data[thisChannel,:] = data[thisChannel,:]*self.flip |
|
273 | 282 | |
|
274 | 283 | self.flip *= -1. |
|
275 | 284 | |
|
276 | 285 | self.dataOut.data = data |
|
277 | 286 | |
|
278 | 287 | def setRadarFrequency(self, frequency=None): |
|
279 | 288 | |
|
280 | 289 | if frequency != None: |
|
281 | 290 | self.dataOut.frequency = frequency |
|
282 | 291 | |
|
283 | 292 | return 1 |
|
284 | 293 | |
|
285 | 294 | class CohInt(Operation): |
|
286 | 295 | |
|
287 | 296 | isConfig = False |
|
288 | 297 | |
|
289 | 298 | __profIndex = 0 |
|
290 | 299 | __withOverapping = False |
|
291 | 300 | |
|
292 | 301 | __byTime = False |
|
293 | 302 | __initime = None |
|
294 | 303 | __lastdatatime = None |
|
295 | 304 | __integrationtime = None |
|
296 | 305 | |
|
297 | 306 | __buffer = None |
|
298 | 307 | |
|
299 | 308 | __dataReady = False |
|
300 | 309 | |
|
301 | 310 | n = None |
|
302 | 311 | |
|
303 | 312 | |
|
304 | 313 | def __init__(self): |
|
305 | 314 | |
|
306 | 315 | Operation.__init__(self) |
|
307 | 316 | |
|
308 | 317 | # self.isConfig = False |
|
309 | 318 | |
|
310 | 319 | def setup(self, n=None, timeInterval=None, overlapping=False, byblock=False): |
|
311 | 320 | """ |
|
312 | 321 | Set the parameters of the integration class. |
|
313 | 322 | |
|
314 | 323 | Inputs: |
|
315 | 324 | |
|
316 | 325 | n : Number of coherent integrations |
|
317 | 326 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
318 | 327 | overlapping : |
|
319 | 328 | |
|
320 | 329 | """ |
|
321 | 330 | |
|
322 | 331 | self.__initime = None |
|
323 | 332 | self.__lastdatatime = 0 |
|
324 | 333 | self.__buffer = None |
|
325 | 334 | self.__dataReady = False |
|
326 | 335 | self.byblock = byblock |
|
327 | 336 | |
|
328 | 337 | if n == None and timeInterval == None: |
|
329 | 338 | raise ValueError, "n or timeInterval should be specified ..." |
|
330 | 339 | |
|
331 | 340 | if n != None: |
|
332 | 341 | self.n = n |
|
333 | 342 | self.__byTime = False |
|
334 | 343 | else: |
|
335 | 344 | self.__integrationtime = timeInterval #* 60. #if (type(timeInterval)!=integer) -> change this line |
|
336 | 345 | self.n = 9999 |
|
337 | 346 | self.__byTime = True |
|
338 | 347 | |
|
339 | 348 | if overlapping: |
|
340 | 349 | self.__withOverapping = True |
|
341 | 350 | self.__buffer = None |
|
342 | 351 | else: |
|
343 | 352 | self.__withOverapping = False |
|
344 | 353 | self.__buffer = 0 |
|
345 | 354 | |
|
346 | 355 | self.__profIndex = 0 |
|
347 | 356 | |
|
348 | 357 | def putData(self, data): |
|
349 | 358 | |
|
350 | 359 | """ |
|
351 | 360 | Add a profile to the __buffer and increase in one the __profileIndex |
|
352 | 361 | |
|
353 | 362 | """ |
|
354 | 363 | |
|
355 | 364 | if not self.__withOverapping: |
|
356 | 365 | self.__buffer += data.copy() |
|
357 | 366 | self.__profIndex += 1 |
|
358 | 367 | return |
|
359 | 368 | |
|
360 | 369 | #Overlapping data |
|
361 | 370 | nChannels, nHeis = data.shape |
|
362 | 371 | data = numpy.reshape(data, (1, nChannels, nHeis)) |
|
363 | 372 | |
|
364 | 373 | #If the buffer is empty then it takes the data value |
|
365 | 374 | if self.__buffer == None: |
|
366 | 375 | self.__buffer = data |
|
367 | 376 | self.__profIndex += 1 |
|
368 | 377 | return |
|
369 | 378 | |
|
370 | 379 | #If the buffer length is lower than n then stakcing the data value |
|
371 | 380 | if self.__profIndex < self.n: |
|
372 | 381 | self.__buffer = numpy.vstack((self.__buffer, data)) |
|
373 | 382 | self.__profIndex += 1 |
|
374 | 383 | return |
|
375 | 384 | |
|
376 | 385 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
377 | 386 | self.__buffer = numpy.roll(self.__buffer, -1, axis=0) |
|
378 | 387 | self.__buffer[self.n-1] = data |
|
379 | 388 | self.__profIndex = self.n |
|
380 | 389 | return |
|
381 | 390 | |
|
382 | 391 | |
|
383 | 392 | def pushData(self): |
|
384 | 393 | """ |
|
385 | 394 | Return the sum of the last profiles and the profiles used in the sum. |
|
386 | 395 | |
|
387 | 396 | Affected: |
|
388 | 397 | |
|
389 | 398 | self.__profileIndex |
|
390 | 399 | |
|
391 | 400 | """ |
|
392 | 401 | |
|
393 | 402 | if not self.__withOverapping: |
|
394 | 403 | data = self.__buffer |
|
395 | 404 | n = self.__profIndex |
|
396 | 405 | |
|
397 | 406 | self.__buffer = 0 |
|
398 | 407 | self.__profIndex = 0 |
|
399 | 408 | |
|
400 | 409 | return data, n |
|
401 | 410 | |
|
402 | 411 | #Integration with Overlapping |
|
403 | 412 | data = numpy.sum(self.__buffer, axis=0) |
|
404 | 413 | n = self.__profIndex |
|
405 | 414 | |
|
406 | 415 | return data, n |
|
407 | 416 | |
|
408 | 417 | def byProfiles(self, data): |
|
409 | 418 | |
|
410 | 419 | self.__dataReady = False |
|
411 | 420 | avgdata = None |
|
412 | 421 | # n = None |
|
413 | 422 | |
|
414 | 423 | self.putData(data) |
|
415 | 424 | |
|
416 | 425 | if self.__profIndex == self.n: |
|
417 | 426 | |
|
418 | 427 | avgdata, n = self.pushData() |
|
419 | 428 | self.__dataReady = True |
|
420 | 429 | |
|
421 | 430 | return avgdata |
|
422 | 431 | |
|
423 | 432 | def byTime(self, data, datatime): |
|
424 | 433 | |
|
425 | 434 | self.__dataReady = False |
|
426 | 435 | avgdata = None |
|
427 | 436 | n = None |
|
428 | 437 | |
|
429 | 438 | self.putData(data) |
|
430 | 439 | |
|
431 | 440 | if (datatime - self.__initime) >= self.__integrationtime: |
|
432 | 441 | avgdata, n = self.pushData() |
|
433 | 442 | self.n = n |
|
434 | 443 | self.__dataReady = True |
|
435 | 444 | |
|
436 | 445 | return avgdata |
|
437 | 446 | |
|
438 | 447 | def integrate(self, data, datatime=None): |
|
439 | 448 | |
|
440 | 449 | if self.__initime == None: |
|
441 | 450 | self.__initime = datatime |
|
442 | 451 | |
|
443 | 452 | if self.__byTime: |
|
444 | 453 | avgdata = self.byTime(data, datatime) |
|
445 | 454 | else: |
|
446 | 455 | avgdata = self.byProfiles(data) |
|
447 | 456 | |
|
448 | 457 | |
|
449 | 458 | self.__lastdatatime = datatime |
|
450 | 459 | |
|
451 | 460 | if avgdata == None: |
|
452 | 461 | return None, None |
|
453 | 462 | |
|
454 | 463 | avgdatatime = self.__initime |
|
455 | 464 | |
|
456 | 465 | deltatime = datatime -self.__lastdatatime |
|
457 | 466 | |
|
458 | 467 | if not self.__withOverapping: |
|
459 | 468 | self.__initime = datatime |
|
460 | 469 | else: |
|
461 | 470 | self.__initime += deltatime |
|
462 | 471 | |
|
463 | 472 | return avgdata, avgdatatime |
|
464 | 473 | |
|
465 | 474 | def integrateByBlock(self, dataOut): |
|
466 | 475 | |
|
467 | 476 | times = int(dataOut.data.shape[1]/self.n) |
|
468 | 477 | avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=numpy.complex) |
|
469 | 478 | |
|
470 | 479 | id_min = 0 |
|
471 | 480 | id_max = self.n |
|
472 | 481 | |
|
473 | 482 | for i in range(times): |
|
474 | 483 | junk = dataOut.data[:,id_min:id_max,:] |
|
475 | 484 | avgdata[:,i,:] = junk.sum(axis=1) |
|
476 | 485 | id_min += self.n |
|
477 | 486 | id_max += self.n |
|
478 | 487 | |
|
479 | 488 | timeInterval = dataOut.ippSeconds*self.n |
|
480 | 489 | avgdatatime = (times - 1) * timeInterval + dataOut.utctime |
|
481 | 490 | self.__dataReady = True |
|
482 | 491 | return avgdata, avgdatatime |
|
483 | 492 | |
|
484 | 493 | def run(self, dataOut, **kwargs): |
|
485 | 494 | |
|
486 | 495 | if not self.isConfig: |
|
487 | 496 | self.setup(**kwargs) |
|
488 | 497 | self.isConfig = True |
|
489 | 498 | |
|
490 | 499 | if dataOut.flagDataAsBlock: |
|
491 | 500 | """ |
|
492 | 501 | Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
493 | 502 | """ |
|
494 | 503 | avgdata, avgdatatime = self.integrateByBlock(dataOut) |
|
495 | 504 | else: |
|
496 | 505 | avgdata, avgdatatime = self.integrate(dataOut.data, dataOut.utctime) |
|
497 | 506 | |
|
498 | 507 | # dataOut.timeInterval *= n |
|
499 | 508 | dataOut.flagNoData = True |
|
500 | 509 | |
|
501 | 510 | if self.__dataReady: |
|
502 | 511 | dataOut.data = avgdata |
|
503 | 512 | dataOut.nCohInt *= self.n |
|
504 | 513 | dataOut.utctime = avgdatatime |
|
505 | 514 | # dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt |
|
506 | 515 | dataOut.flagNoData = False |
|
507 | 516 | |
|
508 | 517 | class Decoder(Operation): |
|
509 | 518 | |
|
510 | 519 | isConfig = False |
|
511 | 520 | __profIndex = 0 |
|
512 | 521 | |
|
513 | 522 | code = None |
|
514 | 523 | |
|
515 | 524 | nCode = None |
|
516 | 525 | nBaud = None |
|
517 | 526 | |
|
518 | 527 | |
|
519 | 528 | def __init__(self): |
|
520 | 529 | |
|
521 | 530 | Operation.__init__(self) |
|
522 | 531 | |
|
523 | 532 | self.times = None |
|
524 | 533 | self.osamp = None |
|
525 | 534 | # self.__setValues = False |
|
526 | 535 | self.isConfig = False |
|
527 | 536 | |
|
528 | 537 | def setup(self, code, osamp, dataOut): |
|
529 | 538 | |
|
530 | 539 | self.__profIndex = 0 |
|
531 | 540 | |
|
532 | 541 | self.code = code |
|
533 | 542 | |
|
534 | 543 | self.nCode = len(code) |
|
535 | 544 | self.nBaud = len(code[0]) |
|
536 | 545 | |
|
537 | 546 | if (osamp != None) and (osamp >1): |
|
538 | 547 | self.osamp = osamp |
|
539 | 548 | self.code = numpy.repeat(code, repeats=self.osamp, axis=1) |
|
540 | 549 | self.nBaud = self.nBaud*self.osamp |
|
541 | 550 | |
|
542 | 551 | self.__nChannels = dataOut.nChannels |
|
543 | 552 | self.__nProfiles = dataOut.nProfiles |
|
544 | 553 | self.__nHeis = dataOut.nHeights |
|
545 | 554 | |
|
546 | 555 | if dataOut.flagDataAsBlock: |
|
547 | 556 | |
|
548 | 557 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
549 | 558 | |
|
550 | 559 | self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) |
|
551 | 560 | |
|
552 | 561 | else: |
|
553 | 562 | |
|
554 | 563 | __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) |
|
555 | 564 | |
|
556 | 565 | __codeBuffer[:,0:self.nBaud] = self.code |
|
557 | 566 | |
|
558 | 567 | self.fft_code = numpy.conj(numpy.fft.fft(__codeBuffer, axis=1)) |
|
559 | 568 | |
|
560 | 569 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
561 | 570 | |
|
562 | 571 | self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) |
|
563 | 572 | |
|
564 | 573 | def convolutionInFreq(self, data): |
|
565 | 574 | |
|
566 | 575 | fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
567 | 576 | |
|
568 | 577 | fft_data = numpy.fft.fft(data, axis=1) |
|
569 | 578 | |
|
570 | 579 | conv = fft_data*fft_code |
|
571 | 580 | |
|
572 | 581 | data = numpy.fft.ifft(conv,axis=1) |
|
573 | 582 | |
|
574 | 583 | datadec = data#[:,:] |
|
575 | 584 | |
|
576 | 585 | return datadec |
|
577 | 586 | |
|
578 | 587 | def convolutionInFreqOpt(self, data): |
|
579 | 588 | |
|
580 | 589 | raise NotImplementedError |
|
581 | 590 | |
|
582 | 591 | # fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
583 | 592 | # |
|
584 | 593 | # data = cfunctions.decoder(fft_code, data) |
|
585 | 594 | # |
|
586 | 595 | # datadec = data#[:,:] |
|
587 | 596 | # |
|
588 | 597 | # return datadec |
|
589 | 598 | |
|
590 | 599 | def convolutionInTime(self, data): |
|
591 | 600 | |
|
592 | 601 | code = self.code[self.__profIndex] |
|
593 | 602 | |
|
594 | 603 | for i in range(self.__nChannels): |
|
595 | 604 | self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='same') |
|
596 | 605 | |
|
597 | 606 | return self.datadecTime |
|
598 | 607 | |
|
599 | 608 | def convolutionByBlockInTime(self, data): |
|
600 | 609 | |
|
601 | 610 | repetitions = self.__nProfiles / self.nCode |
|
602 | 611 | |
|
603 | 612 | junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize)) |
|
604 | 613 | junk = junk.flatten() |
|
605 | 614 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) |
|
606 | 615 | |
|
607 | 616 | for i in range(self.__nChannels): |
|
608 | 617 | for j in range(self.__nProfiles): |
|
609 | 618 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='same') |
|
610 | 619 | |
|
611 | 620 | return self.datadecTime |
|
612 | 621 | |
|
613 | 622 | def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, times=None, osamp=None): |
|
614 | 623 | |
|
615 | 624 | if not self.isConfig: |
|
616 | 625 | |
|
617 | 626 | if code == None: |
|
618 | 627 | code = dataOut.code |
|
619 | 628 | else: |
|
620 | 629 | code = numpy.array(code).reshape(nCode,nBaud) |
|
621 | 630 | |
|
622 | 631 | self.setup(code, osamp, dataOut) |
|
623 | 632 | |
|
624 | 633 | self.isConfig = True |
|
625 | 634 | |
|
626 | 635 | if dataOut.flagDataAsBlock: |
|
627 | 636 | """ |
|
628 | 637 | Decoding when data have been read as block, |
|
629 | 638 | """ |
|
630 | 639 | datadec = self.convolutionByBlockInTime(dataOut.data) |
|
631 | 640 | |
|
632 | 641 | else: |
|
633 | 642 | """ |
|
634 | 643 | Decoding when data have been read profile by profile |
|
635 | 644 | """ |
|
636 | 645 | if mode == 0: |
|
637 | 646 | datadec = self.convolutionInTime(dataOut.data) |
|
638 | 647 | |
|
639 | 648 | if mode == 1: |
|
640 | 649 | datadec = self.convolutionInFreq(dataOut.data) |
|
641 | 650 | |
|
642 | 651 | if mode == 2: |
|
643 | 652 | datadec = self.convolutionInFreqOpt(dataOut.data) |
|
644 | 653 | |
|
645 | 654 | dataOut.code = self.code |
|
646 | 655 | dataOut.nCode = self.nCode |
|
647 | 656 | dataOut.nBaud = self.nBaud |
|
648 | 657 | dataOut.radarControllerHeaderObj.code = self.code |
|
649 | 658 | dataOut.radarControllerHeaderObj.nCode = self.nCode |
|
650 | 659 | dataOut.radarControllerHeaderObj.nBaud = self.nBaud |
|
651 | 660 | |
|
652 | 661 | dataOut.data = datadec |
|
653 | 662 | |
|
654 | 663 | dataOut.heightList = dataOut.heightList[0:self.ndatadec] |
|
655 | 664 | |
|
656 | 665 | dataOut.flagDecodeData = True #asumo q la data esta decodificada |
|
657 | 666 | |
|
658 | 667 | if self.__profIndex == self.nCode-1: |
|
659 | 668 | self.__profIndex = 0 |
|
660 | 669 | return 1 |
|
661 | 670 | |
|
662 | 671 | self.__profIndex += 1 |
|
663 | 672 | |
|
664 | 673 | return 1 |
|
665 | 674 | # dataOut.flagDeflipData = True #asumo q la data no esta sin flip |
|
666 | 675 | |
|
667 | 676 | |
|
668 | 677 | class ProfileConcat(Operation): |
|
669 | 678 | |
|
670 | 679 | isConfig = False |
|
671 | 680 | buffer = None |
|
672 | 681 | |
|
673 | 682 | def __init__(self): |
|
674 | 683 | |
|
675 | 684 | Operation.__init__(self) |
|
676 | 685 | self.profileIndex = 0 |
|
677 | 686 | |
|
678 | 687 | def reset(self): |
|
679 | 688 | self.buffer = numpy.zeros_like(self.buffer) |
|
680 | 689 | self.start_index = 0 |
|
681 | 690 | self.times = 1 |
|
682 | 691 | |
|
683 | 692 | def setup(self, data, m, n=1): |
|
684 | 693 | self.buffer = numpy.zeros((data.shape[0],data.shape[1]*m),dtype=type(data[0,0])) |
|
685 | 694 | self.nHeights = data.nHeights |
|
686 | 695 | self.start_index = 0 |
|
687 | 696 | self.times = 1 |
|
688 | 697 | |
|
689 | 698 | def concat(self, data): |
|
690 | 699 | |
|
691 | 700 | self.buffer[:,self.start_index:self.profiles*self.times] = data.copy() |
|
692 | 701 | self.start_index = self.start_index + self.nHeights |
|
693 | 702 | |
|
694 | 703 | def run(self, dataOut, m): |
|
695 | 704 | |
|
696 | 705 | dataOut.flagNoData = True |
|
697 | 706 | |
|
698 | 707 | if not self.isConfig: |
|
699 | 708 | self.setup(dataOut.data, m, 1) |
|
700 | 709 | self.isConfig = True |
|
701 | 710 | |
|
702 | 711 | if dataOut.flagDataAsBlock: |
|
703 | 712 | |
|
704 | 713 | raise ValueError, "ProfileConcat can only be used when voltage have been read profile by profile, getBlock = False" |
|
705 | 714 | |
|
706 | 715 | else: |
|
707 | 716 | self.concat(dataOut.data) |
|
708 | 717 | self.times += 1 |
|
709 | 718 | if self.times > m: |
|
710 | 719 | dataOut.data = self.buffer |
|
711 | 720 | self.reset() |
|
712 | 721 | dataOut.flagNoData = False |
|
713 | 722 | # se deben actualizar mas propiedades del header y del objeto dataOut, por ejemplo, las alturas |
|
714 | 723 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
715 | 724 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * m |
|
716 | 725 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
717 | 726 | dataOut.ippSeconds *= m |
|
718 | 727 | |
|
719 | 728 | class ProfileSelector(Operation): |
|
720 | 729 | |
|
721 | 730 | profileIndex = None |
|
722 | 731 | # Tamanho total de los perfiles |
|
723 | 732 | nProfiles = None |
|
724 | 733 | |
|
725 | 734 | def __init__(self): |
|
726 | 735 | |
|
727 | 736 | Operation.__init__(self) |
|
728 | 737 | self.profileIndex = 0 |
|
729 | 738 | |
|
730 | 739 | def incIndex(self): |
|
731 | 740 | |
|
732 | 741 | self.profileIndex += 1 |
|
733 | 742 | |
|
734 | 743 | if self.profileIndex >= self.nProfiles: |
|
735 | 744 | self.profileIndex = 0 |
|
736 | 745 | |
|
737 | 746 | def isThisProfileInRange(self, profileIndex, minIndex, maxIndex): |
|
738 | 747 | |
|
739 | 748 | if profileIndex < minIndex: |
|
740 | 749 | return False |
|
741 | 750 | |
|
742 | 751 | if profileIndex > maxIndex: |
|
743 | 752 | return False |
|
744 | 753 | |
|
745 | 754 | return True |
|
746 | 755 | |
|
747 | 756 | def isThisProfileInList(self, profileIndex, profileList): |
|
748 | 757 | |
|
749 | 758 | if profileIndex not in profileList: |
|
750 | 759 | return False |
|
751 | 760 | |
|
752 | 761 | return True |
|
753 | 762 | |
|
754 | 763 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None): |
|
755 | 764 | |
|
756 | 765 | """ |
|
757 | 766 | ProfileSelector: |
|
758 | 767 | |
|
759 | 768 | Inputs: |
|
760 | 769 | profileList : Index of profiles selected. Example: profileList = (0,1,2,7,8) |
|
761 | 770 | |
|
762 | 771 | profileRangeList : Minimum and maximum profile indexes. Example: profileRangeList = (4, 30) |
|
763 | 772 | |
|
764 | 773 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) |
|
765 | 774 | |
|
766 | 775 | """ |
|
767 | 776 | |
|
768 | 777 | dataOut.flagNoData = True |
|
769 | 778 | self.nProfiles = dataOut.nProfiles |
|
770 | 779 | |
|
771 | 780 | if dataOut.flagDataAsBlock: |
|
772 | 781 | """ |
|
773 | 782 | data dimension = [nChannels, nProfiles, nHeis] |
|
774 | 783 | """ |
|
775 | 784 | if profileList != None: |
|
776 | 785 | dataOut.data = dataOut.data[:,profileList,:] |
|
777 | 786 | dataOut.nProfiles = len(profileList) |
|
778 | 787 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
779 | 788 | else: |
|
780 | 789 | minIndex = profileRangeList[0] |
|
781 | 790 | maxIndex = profileRangeList[1] |
|
782 | 791 | |
|
783 | 792 | dataOut.data = dataOut.data[:,minIndex:maxIndex+1,:] |
|
784 | 793 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
785 | 794 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
786 | 795 | |
|
787 | 796 | dataOut.flagNoData = False |
|
788 | 797 | |
|
789 | 798 | return True |
|
790 | 799 | |
|
791 | 800 | else: |
|
792 | 801 | """ |
|
793 | 802 | data dimension = [nChannels, nHeis] |
|
794 | 803 | |
|
795 | 804 | """ |
|
796 | 805 | if profileList != None: |
|
797 | 806 | |
|
798 | 807 | dataOut.nProfiles = len(profileList) |
|
799 | 808 | |
|
800 | 809 | if self.isThisProfileInList(dataOut.profileIndex, profileList): |
|
801 | 810 | dataOut.flagNoData = False |
|
802 | 811 | dataOut.profileIndex = self.profileIndex |
|
803 | 812 | |
|
804 | 813 | self.incIndex() |
|
805 | 814 | return True |
|
806 | 815 | |
|
807 | 816 | |
|
808 | 817 | if profileRangeList != None: |
|
809 | 818 | |
|
810 | 819 | minIndex = profileRangeList[0] |
|
811 | 820 | maxIndex = profileRangeList[1] |
|
812 | 821 | |
|
813 | 822 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
814 | 823 | |
|
815 | 824 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
816 | 825 | dataOut.flagNoData = False |
|
817 | 826 | dataOut.profileIndex = self.profileIndex |
|
818 | 827 | |
|
819 | 828 | self.incIndex() |
|
820 | 829 | return True |
|
821 | 830 | |
|
822 | 831 | if rangeList != None: |
|
823 | 832 | |
|
824 | 833 | nProfiles = 0 |
|
825 | 834 | |
|
826 | 835 | for thisRange in rangeList: |
|
827 | 836 | minIndex = thisRange[0] |
|
828 | 837 | maxIndex = thisRange[1] |
|
829 | 838 | |
|
830 | 839 | nProfiles += maxIndex - minIndex + 1 |
|
831 | 840 | |
|
832 | 841 | dataOut.nProfiles = nProfiles |
|
833 | 842 | |
|
834 | 843 | for thisRange in rangeList: |
|
835 | 844 | |
|
836 | 845 | minIndex = thisRange[0] |
|
837 | 846 | maxIndex = thisRange[1] |
|
838 | 847 | |
|
839 | 848 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
840 | 849 | |
|
841 | 850 | # print "profileIndex = ", dataOut.profileIndex |
|
842 | 851 | |
|
843 | 852 | dataOut.flagNoData = False |
|
844 | 853 | dataOut.profileIndex = self.profileIndex |
|
845 | 854 | |
|
846 | 855 | self.incIndex() |
|
847 | 856 | break |
|
848 | 857 | return True |
|
849 | 858 | |
|
850 | 859 | |
|
851 | 860 | if beam != None: #beam is only for AMISR data |
|
852 | 861 | if self.isThisProfileInList(dataOut.profileIndex, dataOut.beamRangeDict[beam]): |
|
853 | 862 | dataOut.flagNoData = False |
|
854 | 863 | dataOut.profileIndex = self.profileIndex |
|
855 | 864 | |
|
856 | 865 | self.incIndex() |
|
857 | 866 | return 1 |
|
858 | 867 | |
|
859 | 868 | raise ValueError, "ProfileSelector needs profileList or profileRangeList" |
|
860 | 869 | |
|
861 | 870 | return 0 |
|
862 | 871 | |
|
863 | 872 | |
|
864 | 873 | |
|
865 | 874 | class Reshaper(Operation): |
|
866 | 875 | |
|
867 | 876 | def __init__(self): |
|
868 | 877 | |
|
869 | 878 | Operation.__init__(self) |
|
870 | 879 | self.updateNewHeights = True |
|
871 | 880 | |
|
872 | 881 | def run(self, dataOut, shape): |
|
873 | 882 | |
|
874 | 883 | if not dataOut.flagDataAsBlock: |
|
875 | 884 | raise ValueError, "Reshaper can only be used when voltage have been read as Block, getBlock = True" |
|
876 | 885 | |
|
877 | 886 | if len(shape) != 3: |
|
878 | 887 | raise ValueError, "shape len should be equal to 3, (nChannels, nProfiles, nHeis)" |
|
879 | 888 | |
|
880 | 889 | shape_tuple = tuple(shape) |
|
881 | 890 | dataOut.data = numpy.reshape(dataOut.data, shape_tuple) |
|
882 | 891 | dataOut.flagNoData = False |
|
883 | 892 | |
|
884 | 893 | if self.updateNewHeights: |
|
885 | 894 | |
|
886 | 895 | old_nheights = dataOut.nHeights |
|
887 | 896 | new_nheights = dataOut.data.shape[2] |
|
888 | 897 | factor = 1.0*new_nheights / old_nheights |
|
889 | 898 | |
|
890 | 899 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
891 | 900 | |
|
892 | 901 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor |
|
893 | 902 | |
|
894 | 903 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
895 | 904 | |
|
896 | 905 | dataOut.nProfiles = dataOut.data.shape[1] |
|
897 | 906 | |
|
898 | 907 | dataOut.ippSeconds *= factor |
|
899 | 908 | |
|
900 | 909 | import collections |
|
901 | 910 | from scipy.stats import mode |
|
902 | 911 | |
|
903 | 912 | class Synchronize(Operation): |
|
904 | 913 | |
|
905 | 914 | isConfig = False |
|
906 | 915 | __profIndex = 0 |
|
907 | 916 | |
|
908 | 917 | def __init__(self): |
|
909 | 918 | |
|
910 | 919 | Operation.__init__(self) |
|
911 | 920 | # self.isConfig = False |
|
912 | 921 | self.__powBuffer = None |
|
913 | 922 | self.__startIndex = 0 |
|
914 | 923 | self.__pulseFound = False |
|
915 | 924 | |
|
916 | 925 | def __findTxPulse(self, dataOut, channel=0, pulse_with = None): |
|
917 | 926 | |
|
918 | 927 | #Read data |
|
919 | 928 | |
|
920 | 929 | powerdB = dataOut.getPower(channel = channel) |
|
921 | 930 | noisedB = dataOut.getNoise(channel = channel)[0] |
|
922 | 931 | |
|
923 | 932 | self.__powBuffer.extend(powerdB.flatten()) |
|
924 | 933 | |
|
925 | 934 | dataArray = numpy.array(self.__powBuffer) |
|
926 | 935 | |
|
927 | 936 | filteredPower = numpy.correlate(dataArray, dataArray[0:self.__nSamples], "same") |
|
928 | 937 | |
|
929 | 938 | maxValue = numpy.nanmax(filteredPower) |
|
930 | 939 | |
|
931 | 940 | if maxValue < noisedB + 10: |
|
932 | 941 | #No se encuentra ningun pulso de transmision |
|
933 | 942 | return None |
|
934 | 943 | |
|
935 | 944 | maxValuesIndex = numpy.where(filteredPower > maxValue - 0.1*abs(maxValue))[0] |
|
936 | 945 | |
|
937 | 946 | if len(maxValuesIndex) < 2: |
|
938 | 947 | #Solo se encontro un solo pulso de transmision de un baudio, esperando por el siguiente TX |
|
939 | 948 | return None |
|
940 | 949 | |
|
941 | 950 | phasedMaxValuesIndex = maxValuesIndex - self.__nSamples |
|
942 | 951 | |
|
943 | 952 | #Seleccionar solo valores con un espaciamiento de nSamples |
|
944 | 953 | pulseIndex = numpy.intersect1d(maxValuesIndex, phasedMaxValuesIndex) |
|
945 | 954 | |
|
946 | 955 | if len(pulseIndex) < 2: |
|
947 | 956 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
948 | 957 | return None |
|
949 | 958 | |
|
950 | 959 | spacing = pulseIndex[1:] - pulseIndex[:-1] |
|
951 | 960 | |
|
952 | 961 | #remover senales que se distancien menos de 10 unidades o muestras |
|
953 | 962 | #(No deberian existir IPP menor a 10 unidades) |
|
954 | 963 | |
|
955 | 964 | realIndex = numpy.where(spacing > 10 )[0] |
|
956 | 965 | |
|
957 | 966 | if len(realIndex) < 2: |
|
958 | 967 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
959 | 968 | return None |
|
960 | 969 | |
|
961 | 970 | #Eliminar pulsos anchos (deja solo la diferencia entre IPPs) |
|
962 | 971 | realPulseIndex = pulseIndex[realIndex] |
|
963 | 972 | |
|
964 | 973 | period = mode(realPulseIndex[1:] - realPulseIndex[:-1])[0][0] |
|
965 | 974 | |
|
966 | 975 | print "IPP = %d samples" %period |
|
967 | 976 | |
|
968 | 977 | self.__newNSamples = dataOut.nHeights #int(period) |
|
969 | 978 | self.__startIndex = int(realPulseIndex[0]) |
|
970 | 979 | |
|
971 | 980 | return 1 |
|
972 | 981 | |
|
973 | 982 | |
|
974 | 983 | def setup(self, nSamples, nChannels, buffer_size = 4): |
|
975 | 984 | |
|
976 | 985 | self.__powBuffer = collections.deque(numpy.zeros( buffer_size*nSamples,dtype=numpy.float), |
|
977 | 986 | maxlen = buffer_size*nSamples) |
|
978 | 987 | |
|
979 | 988 | bufferList = [] |
|
980 | 989 | |
|
981 | 990 | for i in range(nChannels): |
|
982 | 991 | bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, |
|
983 | 992 | maxlen = buffer_size*nSamples) |
|
984 | 993 | |
|
985 | 994 | bufferList.append(bufferByChannel) |
|
986 | 995 | |
|
987 | 996 | self.__nSamples = nSamples |
|
988 | 997 | self.__nChannels = nChannels |
|
989 | 998 | self.__bufferList = bufferList |
|
990 | 999 | |
|
991 | 1000 | def run(self, dataOut, channel = 0): |
|
992 | 1001 | |
|
993 | 1002 | if not self.isConfig: |
|
994 | 1003 | nSamples = dataOut.nHeights |
|
995 | 1004 | nChannels = dataOut.nChannels |
|
996 | 1005 | self.setup(nSamples, nChannels) |
|
997 | 1006 | self.isConfig = True |
|
998 | 1007 | |
|
999 | 1008 | #Append new data to internal buffer |
|
1000 | 1009 | for thisChannel in range(self.__nChannels): |
|
1001 | 1010 | bufferByChannel = self.__bufferList[thisChannel] |
|
1002 | 1011 | bufferByChannel.extend(dataOut.data[thisChannel]) |
|
1003 | 1012 | |
|
1004 | 1013 | if self.__pulseFound: |
|
1005 | 1014 | self.__startIndex -= self.__nSamples |
|
1006 | 1015 | |
|
1007 | 1016 | #Finding Tx Pulse |
|
1008 | 1017 | if not self.__pulseFound: |
|
1009 | 1018 | indexFound = self.__findTxPulse(dataOut, channel) |
|
1010 | 1019 | |
|
1011 | 1020 | if indexFound == None: |
|
1012 | 1021 | dataOut.flagNoData = True |
|
1013 | 1022 | return |
|
1014 | 1023 | |
|
1015 | 1024 | self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) |
|
1016 | 1025 | self.__pulseFound = True |
|
1017 | 1026 | self.__startIndex = indexFound |
|
1018 | 1027 | |
|
1019 | 1028 | #If pulse was found ... |
|
1020 | 1029 | for thisChannel in range(self.__nChannels): |
|
1021 | 1030 | bufferByChannel = self.__bufferList[thisChannel] |
|
1022 | 1031 | #print self.__startIndex |
|
1023 | 1032 | x = numpy.array(bufferByChannel) |
|
1024 | 1033 | self.__arrayBuffer[thisChannel] = x[self.__startIndex:self.__startIndex+self.__newNSamples] |
|
1025 | 1034 | |
|
1026 | 1035 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
1027 | 1036 | dataOut.heightList = numpy.arange(self.__newNSamples)*deltaHeight |
|
1028 | 1037 | # dataOut.ippSeconds = (self.__newNSamples / deltaHeight)/1e6 |
|
1029 | 1038 | |
|
1030 | 1039 | dataOut.data = self.__arrayBuffer |
|
1031 | 1040 | |
|
1032 | 1041 | self.__startIndex += self.__newNSamples |
|
1033 | 1042 | |
|
1034 | 1043 | return No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now