@@ -0,0 +1,113 | |||
|
1 | import os, sys | |
|
2 | ||
|
3 | path = os.path.split(os.getcwd())[0] | |
|
4 | sys.path.append(path) | |
|
5 | ||
|
6 | from controller import * | |
|
7 | ||
|
8 | desc = "Meteor Experiment Test" | |
|
9 | filename = "meteor20130812.xml" | |
|
10 | ||
|
11 | controllerObj = Project() | |
|
12 | controllerObj.setup(id = '191', name='meteor_test01', description=desc) | |
|
13 | ||
|
14 | path = '/home/dsuarez/.gvfs/datos on 10.10.20.2/High_Power_Meteor' | |
|
15 | ||
|
16 | path = '/Volumes/FREE_DISK/meteor_data' | |
|
17 | ||
|
18 | path = '/Users/dsuarez/Movies/meteor' | |
|
19 | ||
|
20 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
|
21 | path=path, | |
|
22 | startDate='2013/08/01', | |
|
23 | endDate='2013/08/30', | |
|
24 | startTime='00:00:00', | |
|
25 | endTime='23:59:59', | |
|
26 | online=0, | |
|
27 | delay=5, | |
|
28 | walk=0) | |
|
29 | ||
|
30 | opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |
|
31 | ||
|
32 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
|
33 | ||
|
34 | opObj11 = procUnitConfObj0.addOperation(name='ProfileSelector', optype='other') | |
|
35 | opObj11.addParameter(name='profileList', | |
|
36 | value='1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, \ | |
|
37 | 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, \ | |
|
38 | 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, \ | |
|
39 | 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, \ | |
|
40 | 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, \ | |
|
41 | 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, \ | |
|
42 | 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, \ | |
|
43 | 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, \ | |
|
44 | 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, \ | |
|
45 | 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, \ | |
|
46 | 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, \ | |
|
47 | 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, \ | |
|
48 | 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, \ | |
|
49 | 301, 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, \ | |
|
50 | 323, 325, 327, 329, 331, 333, 335, 337, 339, 341, 343, \ | |
|
51 | 345, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, \ | |
|
52 | 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, 387, \ | |
|
53 | 389, 391, 393, 395, 397, 399, 401, 403, 405, 407, 409, \ | |
|
54 | 411, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, \ | |
|
55 | 433, 435, 437, 439, 441, 443, 445, 447, 449, 451, 453, \ | |
|
56 | 455, 457, 459, 461, 463, 465, 467, 469, 471, 473, 475, \ | |
|
57 | 477, 479, 481, 483, 485, 487, 489, 491, 493, 495, 497, \ | |
|
58 | 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, \ | |
|
59 | 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, \ | |
|
60 | 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, \ | |
|
61 | 565, 567, 569, 571, 573, 575, 577, 579, 581, 583, 585, \ | |
|
62 | 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, \ | |
|
63 | 609, 611, 613, 615, 617, 619, 621, 623, 625, 627, 629, \ | |
|
64 | 631, 633, 635, 637, 639, 641, 643, 645, 647, 649, 651, \ | |
|
65 | 653, 655, 657, 659, 661, 663, 665, 667, 669, 671, 673, \ | |
|
66 | 675, 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, \ | |
|
67 | 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 717, \ | |
|
68 | 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, \ | |
|
69 | 741, 743, 745, 747, 749, 751, 753, 755, 757, 759, 761, \ | |
|
70 | 763, 765, 767, 769, 771, 773, 775, 777, 779, 781, 783, \ | |
|
71 | 785, 787, 789, 791, 793, 795, 797, 799', format='intlist') | |
|
72 | ||
|
73 | # opObj11 = procUnitConfObj0.addOperation(name='filterByHeights') | |
|
74 | # opObj11.addParameter(name='window', value='3', format='int') | |
|
75 | ||
|
76 | opObj11 = procUnitConfObj0.addOperation(name='Decoder', optype='other') | |
|
77 | opObj11.addParameter(name='code', value='1,1,1,1,1,-1,-1,1,1,-1,1,-1,1', format='floatlist') | |
|
78 | opObj11.addParameter(name='nCode', value='1', format='int') | |
|
79 | opObj11.addParameter(name='nBaud', value='13', format='int') | |
|
80 | ||
|
81 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
|
82 | procUnitConfObj1.addParameter(name='nFFTPoints', value='64', format='int') | |
|
83 | ||
|
84 | opObj11 = procUnitConfObj1.addOperation(name='IncohInt', optype='other') | |
|
85 | opObj11.addParameter(name='n', value='5', format='int') | |
|
86 | ||
|
87 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') | |
|
88 | opObj11.addParameter(name='id', value='100', format='int') | |
|
89 | opObj11.addParameter(name='wintitle', value='MeteorSpectra', format='str') | |
|
90 | # opObj11.addParameter(name='save', value='1', format='int') | |
|
91 | # opObj11.addParameter(name='figpath', value='/Users/dsuarez/Pictures', format='str') | |
|
92 | # opObj11.addParameter(name='ftp', value='1', format='int') | |
|
93 | # opObj11.addParameter(name='res_imagwr', value='1', format='int') | |
|
94 | ||
|
95 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') | |
|
96 | # opObj11.addParameter(name='id', value='101', format='int') | |
|
97 | # opObj11.addParameter(name='wintitle', value='MeteorRTI', format='str') | |
|
98 | # opObj11.addParameter(name='xmin', value='0', format='float') | |
|
99 | # opObj11.addParameter(name='xmax', value='24', format='float') | |
|
100 | # opObj11.addParameter(name='save', value='1', format='int') | |
|
101 | # opObj11.addParameter(name='figpath', value='/Users/dsuarez/Pictures', format='str') | |
|
102 | # opObj11.addParameter(name='ftp', value='1', format='int') | |
|
103 | # opObj11.addParameter(name='res_imagwr', value='1', format='int') | |
|
104 | ||
|
105 | ||
|
106 | print "Escribiendo el archivo XML" | |
|
107 | controllerObj.writeXml(filename) | |
|
108 | print "Leyendo el archivo XML" | |
|
109 | controllerObj.readXml(filename) | |
|
110 | ||
|
111 | controllerObj.createObjects() | |
|
112 | controllerObj.connectObjects() | |
|
113 | controllerObj.run() |
@@ -86,10 +86,10 class Ftp(): | |||
|
86 | 86 | # print 'filename: %s - size: %d'%(f,self.ftp.size(f)) |
|
87 | 87 | |
|
88 | 88 | def parmsByDefault(self): |
|
89 | host = 'jro.igp.gob.pe' | |
|
90 |
username = ' |
|
|
91 |
passw = 'mst |
|
|
92 |
remotefolder = '/ |
|
|
89 | host = 'jro-app.igp.gob.pe' | |
|
90 | username = 'wmaster' | |
|
91 | passw = 'mst2010vhf' | |
|
92 | remotefolder = '/home/wmaster/graficos' | |
|
93 | 93 | |
|
94 | 94 | return host, username, passw, remotefolder |
|
95 | 95 |
@@ -34,7 +34,7 class Figure: | |||
|
34 | 34 | |
|
35 | 35 | path = '%s%03d' %(self.PREFIX, self.id) |
|
36 | 36 | filename = '%s_%s%s' %(self.PREFIX, name, ext) |
|
37 | ||
|
37 | filename = '%s%s' %(name, ext) | |
|
38 | 38 | return os.path.join(path, filename) |
|
39 | 39 | |
|
40 | 40 | def getAxesObjList(self): |
@@ -103,8 +103,8 def createPline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='' | |||
|
103 | 103 | xtickspos = numpy.array([float("%.1f"%i) for i in xtickspos]) |
|
104 | 104 | ax.set_xticks(xtickspos) |
|
105 | 105 | else: |
|
106 |
|
|
|
107 | xtickspos = numpy.arange(nxticks)*float(xmax-xmin)/float(nxticks) + int(xmin) | |
|
106 | xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin) | |
|
107 | # xtickspos = numpy.arange(nxticks)*float(xmax-xmin)/float(nxticks) + int(xmin) | |
|
108 | 108 | ax.set_xticks(xtickspos) |
|
109 | 109 | |
|
110 | 110 | for tick in ax.get_xticklabels(): |
@@ -315,6 +315,7 class RTIPlot(Figure): | |||
|
315 | 315 | if zmax == None: zmax = numpy.nanmax(avgdB)*0.9 |
|
316 | 316 | |
|
317 | 317 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
318 | self.name = '%4d%3d00010000000'%(thisDatetime.timetuple().tm_year,thisDatetime.timetuple().tm_yday) | |
|
318 | 319 | self.__isConfig = True |
|
319 | 320 | |
|
320 | 321 | |
@@ -348,8 +349,8 class RTIPlot(Figure): | |||
|
348 | 349 | fig_file = self.getFilename(name = self.name) |
|
349 | 350 | self.saveFigure(figpath, fig_file) |
|
350 | 351 | if ftp: |
|
351 | self.saveFigure(figpath, figfile) | |
|
352 | figfilename = os.path.join(figpath,figfile) | |
|
352 | # self.saveFigure(figpath, figfile) | |
|
353 | figfilename = os.path.join(figpath,fig_file) | |
|
353 | 354 | self.sendByFTP(figfilename) |
|
354 | 355 | |
|
355 | 356 | self.counter_imagwr = 0 |
@@ -375,6 +376,7 class SpectraPlot(Figure): | |||
|
375 | 376 | self.HEIGHT = 250 |
|
376 | 377 | self.WIDTHPROF = 120 |
|
377 | 378 | self.HEIGHTPROF = 0 |
|
379 | self.counter_imagwr = 0 | |
|
378 | 380 | |
|
379 | 381 | def getSubplots(self): |
|
380 | 382 | |
@@ -419,7 +421,7 class SpectraPlot(Figure): | |||
|
419 | 421 | |
|
420 | 422 | def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True', |
|
421 | 423 | xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, |
|
422 | save=False, figpath='./', figfile=None, show=True): | |
|
424 | save=False, figpath='./', figfile=None, show=True, ftp=False, res_imagwr=1): | |
|
423 | 425 | |
|
424 | 426 | """ |
|
425 | 427 | |
@@ -507,11 +509,29 class SpectraPlot(Figure): | |||
|
507 | 509 | self.draw() |
|
508 | 510 | |
|
509 | 511 | if save: |
|
510 | date = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
|
511 | if figfile == None: | |
|
512 | figfile = self.getFilename(name = date) | |
|
513 | 512 | |
|
514 | self.saveFigure(figpath, figfile) | |
|
513 | self.counter_imagwr += 1 | |
|
514 | if (self.counter_imagwr==res_imagwr): | |
|
515 | date = '%4d%3d00010000100'%(thisDatetime.timetuple().tm_year,thisDatetime.timetuple().tm_yday) | |
|
516 | ||
|
517 | fig_file = self.getFilename(name = date) | |
|
518 | self.saveFigure(figpath, fig_file) | |
|
519 | ||
|
520 | if ftp: | |
|
521 | # self.saveFigure(figpath, figfile) | |
|
522 | figfilename = os.path.join(figpath,fig_file) | |
|
523 | self.sendByFTP(figfilename) | |
|
524 | ||
|
525 | self.counter_imagwr = 0 | |
|
526 | ||
|
527 | ||
|
528 | # if save: | |
|
529 | # date = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
|
530 | # date = '%4d%3d00010000100'%(thisDatetime.timetuple().tm_year,thisDatetime.timetuple().tm_yday) | |
|
531 | # if figfile == None: | |
|
532 | # figfile = self.getFilename(name = date) | |
|
533 | # | |
|
534 | # self.saveFigure(figpath, figfile) | |
|
515 | 535 | |
|
516 | 536 | class Scope(Figure): |
|
517 | 537 |
General Comments 0
You need to be logged in to leave comments.
Login now