@@ -0,0 +1,94 | |||||
|
1 | import os, sys | |||
|
2 | ||||
|
3 | from schainpy.controller import Project | |||
|
4 | ||||
|
5 | if __name__ == '__main__': | |||
|
6 | ||||
|
7 | desc = "Segundo Test" | |||
|
8 | filename = "schain.xml" | |||
|
9 | ||||
|
10 | controllerObj = Project() | |||
|
11 | ||||
|
12 | controllerObj.setup(id = '191', name='test01', description=desc) | |||
|
13 | ||||
|
14 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', | |||
|
15 | path='/home/jchavez/jicamarca/jro_data/rawdata/', | |||
|
16 | startDate='2010/10/28', | |||
|
17 | endDate='2017/10/28', | |||
|
18 | startTime='00:00:00', | |||
|
19 | endTime='23:59:59', | |||
|
20 | online=0, | |||
|
21 | walk=0) | |||
|
22 | ||||
|
23 | opObj00 = readUnitConfObj.addOperation(name='printNumberOfBlock') | |||
|
24 | ||||
|
25 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', | |||
|
26 | inputId=readUnitConfObj.getId()) | |||
|
27 | ||||
|
28 | opObj10 = procUnitConfObj0.addOperation(name='DigitalRFWriter', optype='other') | |||
|
29 | opObj10.addParameter(name='path', value='/home/jchavez/jicamarca/data_sink/', format='str') | |||
|
30 | # opObj10.addParameter(name='minHei', value='0', format='float') | |||
|
31 | # opObj10.addParameter(name='maxHei', value='8', format='float') | |||
|
32 | ||||
|
33 | # opObj10 = procUnitConfObj0.addOperation(name='filterByHeights') | |||
|
34 | # opObj10.addParameter(name='window', value='2', format='float') | |||
|
35 | ||||
|
36 | # opObj10 = procUnitConfObj0.addOperation(name='Decoder', optype='external') | |||
|
37 | # opObj10.addParameter(name='code', value='1,-1', format='intlist') | |||
|
38 | # opObj10.addParameter(name='nCode', value='2', format='float') | |||
|
39 | # opObj10.addParameter(name='nBaud', value='1', format='float') | |||
|
40 | ||||
|
41 | ||||
|
42 | # opObj10 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |||
|
43 | # opObj10.addParameter(name='n', value='1296', format='float') | |||
|
44 | ||||
|
45 | # procUnitConfObj1 = controllerObj.addProcUnit(datatype='SpectraProc', | |||
|
46 | # inputId=procUnitConfObj0.getId()) | |||
|
47 | ||||
|
48 | #Creating a processing object with its parameters | |||
|
49 | #schainpy.model.proc.jroproc_spectra.SpectraProc.run() | |||
|
50 | #If you need to add more parameters can use the "addParameter method" | |||
|
51 | # procUnitConfObj1.addParameter(name='nFFTPoints', value='128', format='int') | |||
|
52 | ||||
|
53 | # opObj10 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') | |||
|
54 | # opObj10.addParameter(name='n', value='2', format='float') | |||
|
55 | ||||
|
56 | #Using internal methods | |||
|
57 | #schainpy.model.proc.jroproc_spectra.SpectraProc.selectChannels() | |||
|
58 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') | |||
|
59 | # opObj10.addParameter(name='channelList', value='0,1', format='intlist') | |||
|
60 | ||||
|
61 | #Using internal methods | |||
|
62 | #schainpy.model.proc.jroproc_spectra.SpectraProc.selectHeights() | |||
|
63 | # opObj10 = procUnitConfObj1.addOperation(name='selectHeights') | |||
|
64 | # opObj10.addParameter(name='minHei', value='90', format='float') | |||
|
65 | # opObj10.addParameter(name='maxHei', value='180', format='float') | |||
|
66 | ||||
|
67 | #Using external methods (new modules) | |||
|
68 | # #schainpy.model.proc.jroproc_spectra.IncohInt.setup() | |||
|
69 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='other') | |||
|
70 | # opObj12.addParameter(name='n', value='1', format='int') | |||
|
71 | ||||
|
72 | #Using external methods (new modules) | |||
|
73 | #schainpy.model.graphics.jroplot_spectra.SpectraPlot.setup() | |||
|
74 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |||
|
75 | # opObj11.addParameter(name='id', value='11', format='int') | |||
|
76 | # opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str') | |||
|
77 | # opObj11.addParameter(name='zmin', value='-60', format='int') | |||
|
78 | # opObj11.addParameter(name='zmax', value='10', format='int') | |||
|
79 | # opObj11.addParameter(name='save', value='1', format='int') | |||
|
80 | ||||
|
81 | # #Using external methods (new modules) | |||
|
82 | # #schainpy.model.graphics.jroplot_spectra.RTIPlot.setup() | |||
|
83 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') | |||
|
84 | # opObj11.addParameter(name='id', value='30', format='int') | |||
|
85 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') | |||
|
86 | # opObj11.addParameter(name='zmin', value='-60', format='int') | |||
|
87 | # opObj11.addParameter(name='zmax', value='-10', format='int') | |||
|
88 | # opObj11.addParameter(name='showprofile', value='1', format='int') | |||
|
89 | # # opObj11.addParameter(name='timerange', value=str(5*60*60*60), format='int') | |||
|
90 | # opObj11.addParameter(name='xmin', value='14', format='float') | |||
|
91 | # opObj11.addParameter(name='xmax', value='23.9', format='float') | |||
|
92 | # opObj11.addParameter(name='save', value='1', format='int') | |||
|
93 | ||||
|
94 | controllerObj.start() |
@@ -370,7 +370,6 class RadarControllerHeader(Header): | |||||
370 | if fp.tell() < endFp: |
|
370 | if fp.tell() < endFp: | |
371 | sys.stderr.write("Warning %s: Size value read from Radar Controller header is greater than it has to be\n" %fp.name) |
|
371 | sys.stderr.write("Warning %s: Size value read from Radar Controller header is greater than it has to be\n" %fp.name) | |
372 |
|
372 | |||
373 |
|
||||
374 | return 1 |
|
373 | return 1 | |
375 |
|
374 | |||
376 | def write(self, fp): |
|
375 | def write(self, fp): |
@@ -548,7 +548,7 class DigitalRFWriter(Operation): | |||||
548 | Operation.__init__(self, **kwargs) |
|
548 | Operation.__init__(self, **kwargs) | |
549 | self.dataOut = None |
|
549 | self.dataOut = None | |
550 |
|
550 | |||
551 |
def setup(self, dataIn, path, blocksPerFile, set=0, ext= |
|
551 | def setup(self, dataIn, path, blocksPerFile, set=0, ext='.h5'): | |
552 | ''' |
|
552 | ''' | |
553 | In this method we should set all initial parameters. |
|
553 | In this method we should set all initial parameters. | |
554 |
|
554 | |||
@@ -566,7 +566,7 class DigitalRFWriter(Operation): | |||||
566 |
|
566 | |||
567 | return |
|
567 | return | |
568 |
|
568 | |||
569 | def run(self, dataIn, **kwargs): |
|
569 | def run(self, dataIn, path=None, **kwargs): | |
570 | ''' |
|
570 | ''' | |
571 | This method will be called many times so here you should put all your code |
|
571 | This method will be called many times so here you should put all your code | |
572 |
|
572 | |||
@@ -575,9 +575,15 class DigitalRFWriter(Operation): | |||||
575 | dataIn : object with the data |
|
575 | dataIn : object with the data | |
576 |
|
576 | |||
577 | ''' |
|
577 | ''' | |
578 |
|
578 | print dir(dataIn) | ||
|
579 | print 'blocksize', dataIn.blocksize | |||
|
580 | print 'channelIndexList', dataIn.channelIndexList | |||
|
581 | print 'ippSeconds', dataIn.ippSeconds | |||
|
582 | print 'frequency', dataIn.frequency | |||
|
583 | print 'nProfiles', dataIn.nProfiles | |||
|
584 | print 'systemHeaderObj.nSamples', dataIn.systemHeaderObj.nSamples | |||
579 | if not self.isConfig: |
|
585 | if not self.isConfig: | |
580 | self.setup(dataIn, **kwargs) |
|
586 | self.setup(dataIn, path, **kwargs) | |
581 |
|
587 | |||
582 |
|
588 | |||
583 | if __name__ == '__main__': |
|
589 | if __name__ == '__main__': |
@@ -1,1 +1,1 | |||||
1 | <Project description="Testing USRP data reader" id="191" name="test01"><ReadUnit datatype="DigitalRF" id="1911" inputId="0" name="DigitalRFReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="DigitalRF" /><Parameter format="str" id="191112" name="path" value="/home/jchavez/jicamarca/mocked_data" /><Parameter format="date" id="191113" name="startDate" value="2000/07/03" /><Parameter format="date" id="191114" name="endDate" value="2017/07/03" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="ippKm" value="60" /><Parameter format="int" id="191119" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="Voltage" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="CohInt" priority="2" type="external"><Parameter format="float" id="191221" name="n" value="1" /></Operation><Operation id="19123" name="Scope" priority="3" type="external"><Parameter format="int" id="191231" name="id" value="121" /><Parameter format="str" id="191232" name="wintitle" value="Scope" /></Operation></ProcUnit></Project> No newline at end of file |
|
1 | <Project description="Segundo Test" id="191" name="test01"><ReadUnit datatype="VoltageReader" id="1911" inputId="0" name="VoltageReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="VoltageReader" /><Parameter format="str" id="191112" name="path" value="/home/jchavez/jicamarca/jro_data/rawdata" /><Parameter format="date" id="191113" name="startDate" value="2010/10/28" /><Parameter format="date" id="191114" name="endDate" value="2017/10/28" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="online" value="0" /><Parameter format="int" id="191119" name="walk" value="0" /></Operation><Operation id="19112" name="printNumberOfBlock" priority="2" type="self" /></ReadUnit><ProcUnit datatype="VoltageProc" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="DigitalRFWriter" priority="2" type="other"><Parameter format="str" id="191221" name="path" value="/home/jchavez/jicamarca/data_sink/" /></Operation></ProcUnit></Project> No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now