##// END OF EJS Templates
Se agrega el archivo de test: test4NewSignalChain.py, este test funciona correctamente...
Daniel Valdez -
r189:f1e3cc151fd3
parent child
Show More
@@ -0,0 +1,1
1 import controller No newline at end of file
@@ -0,0 +1,78
1 """
2 $Author$
3 $Id$
4
5 """
6 import datetime
7 from controller import *
8 from model import *
9
10
11 class Test():
12 def __init__(self):
13 self.createObjects()
14 self.run()
15
16 def createObjects(self):
17
18
19
20 self.upConfig = controller.UPConf(id=1, name="voltageproc", type="voltage")
21
22 opConf = self.upConfig.addOperation(name="init", priority=0)
23
24 opConf1 = self.upConfig.addOperation(name="CohInt", priority=1, type="other")
25
26 opConf1.addParameter(name="nCohInt", value=10)
27
28
29 opConf = self.upConfig.addOperation(name="selectChannels", priority=2)
30
31 opConf.addParameter(name="channelList", value=[0,1])
32
33
34 #########################################
35 self.objR = jrodataIO.VoltageReader()
36 self.objP = jroprocessing.VoltageProc()
37
38 self.objInt = jroprocessing.CohInt()
39
40 self.objP.addOperation(self.objInt, opConf1.id)
41
42 self.connect(self.objR, self.objP)
43
44 def connect(self, obj1, obj2):
45 obj2.dataIn = obj1.dataOut
46
47 def run(self):
48
49 while(True):
50 self.objR.run(path="/Users/dsuarez/Remote/Meteors",
51 startDate=datetime.date(2012,1,1),
52 endDate=datetime.date(2012,12,30),
53 startTime=datetime.time(0,0,0),
54 endTime=datetime.time(23,59,59),
55 set=0,
56 expLabel = "",
57 ext = None,
58 online = False)
59
60 for opConf in self.upConfig.getOperationObjList():
61 kwargs={}
62 for parm in opConf.getParameterObjList():
63 kwargs[parm.name]=parm.value
64
65 self.objP.call(opConf,**kwargs)
66
67 if self.objR.flagNoMoreFiles:
68 break
69
70 if self.objR.flagIsNewBlock:
71 print 'Block No %04d, Time: %s' %(self.objR.nTotalBlocks,
72 datetime.datetime.fromtimestamp(self.objR.basicHeaderObj.utc + self.objR.basicHeaderObj.miliSecond/1000.0),)
73
74
75
76
77 if __name__ == "__main__":
78 Test() No newline at end of file
@@ -79,7 +79,7 class JROData:
79 79
80 80 def isEmpty(self):
81 81
82 return flagNoData
82 return self.flagNoData
83 83
84 84 class Voltage(JROData):
85 85
@@ -436,9 +436,6 class JRODataReader(JRODataIO):
436 436 if ext == None:
437 437 ext = self.ext
438 438
439 if dataOut != None:
440 self.dataOut = dataOut
441
442 439 if online:
443 440 print "Searching files in online mode..."
444 441 doypath, file, year, doy, set = self.__searchFilesOnLine(path=path, expLabel=expLabel, ext=ext)
@@ -100,7 +100,7 class ProcessingUnit:
100 100 None
101 101 """
102 102
103 object = self.objectList[objId]
103 object = self.objectDict[objId]
104 104
105 105 object.run(self.dataOut, **kwargs)
106 106
@@ -366,7 +366,7 class CohInt(Operation):
366 366 def byProfiles(self, data):
367 367
368 368 self.__dataReady = False
369 avg_data = None
369 avgdata = None
370 370 nCohInt = None
371 371
372 372 self.putData(data)
@@ -376,12 +376,12 class CohInt(Operation):
376 376 avgdata, nCohInt = self.pushData()
377 377 self.__dataReady = True
378 378
379 return avgdata, nCohInt
379 return avgdata
380 380
381 381 def byTime(self, data, datatime):
382 382
383 383 self.__dataReady = False
384 avg_data = None
384 avgdata = None
385 385 nCohInt = None
386 386
387 387 self.putData(data)
@@ -391,7 +391,7 class CohInt(Operation):
391 391 self.nCohInt = nCohInt
392 392 self.__dataReady = True
393 393
394 return avgdata, nCohInt
394 return avgdata
395 395
396 396 def integrate(self, data, datatime=None):
397 397
@@ -407,7 +407,7 class CohInt(Operation):
407 407 self.__lastdatatime = datatime
408 408
409 409 if avgdata == None:
410 return None
410 return None, None
411 411
412 412 avgdatatime = self.__initime
413 413
@@ -428,8 +428,8 class CohInt(Operation):
428 428
429 429 avgdata, avgdatatime = self.integrate(dataOut.data, dataOut.utctime)
430 430
431 # self.dataOut.timeInterval *= nCohInt
432 self.dataOut.flagNoData = True
431 # dataOut.timeInterval *= nCohInt
432 dataOut.flagNoData = True
433 433
434 434 if self.__dataReady:
435 435 dataOut.data = avgdata
General Comments 0
You need to be logged in to leave comments. Login now