@@ -214,7 +214,7 class DigitalRFReader(ProcessingUnit): | |||
|
214 | 214 | online |
|
215 | 215 | delay |
|
216 | 216 | ''' |
|
217 | ||
|
217 | self.i = 0 | |
|
218 | 218 | if not os.path.isdir(path): |
|
219 | 219 | raise ValueError, "[Reading] Directory %s does not exist" %path |
|
220 | 220 | |
@@ -248,7 +248,6 class DigitalRFReader(ProcessingUnit): | |||
|
248 | 248 | self.__deltaHeigth = 1e6*0.15/self.__sample_rate ## why 0.15? |
|
249 | 249 | |
|
250 | 250 | this_metadata_file = self.digitalReadObj.get_digital_metadata(channelNameList[channelList[0]]) |
|
251 | print this_metadata_file | |
|
252 | 251 | metadata_bounds = this_metadata_file.get_bounds() |
|
253 | 252 | self.fixed_metadata_dict = this_metadata_file.read(metadata_bounds[0])[metadata_bounds[0]] ## GET FIRST HEADER |
|
254 | 253 | self.__processingHeader = self.fixed_metadata_dict['processingHeader'] |
@@ -321,12 +320,10 class DigitalRFReader(ProcessingUnit): | |||
|
321 | 320 | |
|
322 | 321 | if end_index < endUTCSecond*self.__sample_rate: |
|
323 | 322 | endUTCSecond = end_index/self.__sample_rate |
|
324 | print ippKm | |
|
325 | 323 | if not nSamples: |
|
326 | 324 | if not ippKm: |
|
327 | 325 | raise ValueError, "[Reading] nSamples or ippKm should be defined" |
|
328 | 326 | nSamples = int(ippKm / (1e6*0.15/self.__sample_rate)) |
|
329 | print nSamples | |
|
330 | 327 | channelBoundList = [] |
|
331 | 328 | channelNameListFiltered = [] |
|
332 | 329 | |
@@ -565,7 +562,7 class DigitalRFReader(ProcessingUnit): | |||
|
565 | 562 | return |
|
566 | 563 | # print self.profileIndex |
|
567 | 564 | |
|
568 | ##@profile | |
|
565 | ||
|
569 | 566 | def run(self, **kwargs): |
|
570 | 567 | ''' |
|
571 | 568 | This method will be called many times so here you should put all your code |
@@ -573,7 +570,7 class DigitalRFReader(ProcessingUnit): | |||
|
573 | 570 | |
|
574 | 571 | if not self.isConfig: |
|
575 | 572 | self.setup(**kwargs) |
|
576 | self.i = self.i+1 | |
|
573 | #self.i = self.i+1 | |
|
577 | 574 | self.getData(seconds=self.__delay) |
|
578 | 575 | |
|
579 | 576 | return |
@@ -624,7 +621,8 class DigitalRFWriter(Operation): | |||
|
624 | 621 | self.__nSamples = dataOut.systemHeaderObj.nSamples |
|
625 | 622 | self.__nProfiles = dataOut.nProfiles |
|
626 | 623 | self.__blocks_per_file = dataOut.processingHeaderObj.dataBlocksPerFile |
|
627 | self.arr_data = arr_data = numpy.ones((self.__nSamples, 2), dtype=[('r', self.__dtype), ('i', self.__dtype)]) | |
|
624 | ||
|
625 | self.arr_data = arr_data = numpy.ones((self.__nSamples, len(self.dataOut.channelList)), dtype=[('r', self.__dtype), ('i', self.__dtype)]) | |
|
628 | 626 | |
|
629 | 627 | file_cadence_millisecs = long(1.0 * self.__blocks_per_file * self.__nProfiles * self.__nSamples / self.__sample_rate) * 1000 |
|
630 | 628 | sub_cadence_secs = file_cadence_millisecs / 500 |
@@ -693,7 +691,7 class DigitalRFWriter(Operation): | |||
|
693 | 691 | |
|
694 | 692 | return |
|
695 | 693 | |
|
696 |
def run(self, dataOut, frequency=49.92e6, path=None, fileCadence=100 |
|
|
694 | def run(self, dataOut, frequency=49.92e6, path=None, fileCadence=100, dirCadence=25, metadataCadence=1, **kwargs): | |
|
697 | 695 | ''' |
|
698 | 696 | This method will be called many times so here you should put all your code |
|
699 | 697 | Inputs: |
@@ -703,13 +701,14 class DigitalRFWriter(Operation): | |||
|
703 | 701 | self.dataOut = dataOut |
|
704 | 702 | if not self.isConfig: |
|
705 | 703 | self.setup(dataOut, path, frequency, fileCadence, dirCadence, metadataCadence, **kwargs) |
|
704 | self.writeMetadata() | |
|
706 | 705 | |
|
707 | 706 | self.writeData() |
|
708 | 707 | |
|
709 | self.currentSample += 1 | |
|
710 | if self.dataOut.flagDataAsBlock or self.currentSample == 1: | |
|
711 | self.writeMetadata() | |
|
712 | if self.currentSample == self.__nProfiles: self.currentSample = 0 | |
|
708 | ## self.currentSample += 1 | |
|
709 | ## if self.dataOut.flagDataAsBlock or self.currentSample == 1: | |
|
710 | ## self.writeMetadata() | |
|
711 | ## if self.currentSample == self.__nProfiles: self.currentSample = 0 | |
|
713 | 712 | |
|
714 | 713 | def close(self): |
|
715 | 714 | print '[Writing] - Closing files ' |
@@ -79,9 +79,9 class VoltageReader(JRODataReader, ProcessingUnit): | |||
|
79 | 79 | Return: |
|
80 | 80 | None |
|
81 | 81 | """ |
|
82 | ||
|
82 | ||
|
83 | 83 | ProcessingUnit.__init__(self, **kwargs) |
|
84 | ||
|
84 | self.i = 0 | |
|
85 | 85 | self.isConfig = False |
|
86 | 86 | |
|
87 | 87 | self.datablock = None |
@@ -18,7 +18,7 controllerObj.setup(id = '002', name='script02', description="JASMET Meteor Dete | |||
|
18 | 18 | # path = '/mnt/jars/2016_08/NOCHE' |
|
19 | 19 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/DIA' |
|
20 | 20 | # path = '/media/joscanoa/DATA_JASMET/JASMET/2016_08/NOCHE' |
|
21 |
path = '/media/ |
|
|
21 | path = '/media/nanosat/NewVolumen/JASMET/2016_08/DIA' | |
|
22 | 22 | |
|
23 | 23 | #Path para los graficos |
|
24 | 24 | pathfig = os.path.join(os.environ['HOME'],'Pictures/JASMET30/201608/graphics') |
@@ -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="/media/jchavez/DATA/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="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="Voltage" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /></ProcUnit></Project> No newline at end of file | |
|
1 | <Project description="Testing USRP data reader" id="191" name="test01"><ReadUnit datatype="Voltage" id="1911" inputId="0" name="VoltageReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="Voltage" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/data/John" /><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="blockTime" value="100" /><Parameter format="int" id="191119" name="walk" value="0" /><Parameter format="int" id="191120" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="VoltageProc" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="Decoder" priority="2" type="external"><Parameter format="intlist" id="191221" name="code" value="1,-1,-1,1,-1" /><Parameter format="int" id="191222" name="nCode" value="5" /><Parameter format="int" id="191223" name="nBaud" value="1" /></Operation></ProcUnit></Project> No newline at end of file |
@@ -24,15 +24,15 def main(): | |||
|
24 | 24 | #Creating a reader object with its parameters |
|
25 | 25 | #schainpy.model.io.jroIO_usrp.USRPReader.setup() |
|
26 | 26 | readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRF', |
|
27 |
path='/ |
|
|
27 | path='/home/nanosat/data/', | |
|
28 | 28 | startDate='2000/07/03', |
|
29 | 29 | endDate='2017/07/03', |
|
30 | 30 | startTime='00:00:00', |
|
31 | 31 | endTime='23:59:59', |
|
32 | 32 | online=0) |
|
33 | 33 | |
|
34 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', | |
|
35 | inputId=readUnitConfObj.getId()) | |
|
34 | # procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', | |
|
35 | # inputId=readUnitConfObj.getId()) | |
|
36 | 36 | |
|
37 | 37 | # opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
38 | 38 | # opObj10.addParameter(name='minHei', value='0', format='float') |
@@ -12,7 +12,7 if __name__ == '__main__': | |||
|
12 | 12 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
13 | 13 | |
|
14 | 14 | readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', |
|
15 |
path='/home/ |
|
|
15 | path='/home/nanosat/data/John', | |
|
16 | 16 | startDate='2010/10/28', |
|
17 | 17 | endDate='2017/10/28', |
|
18 | 18 | startTime='00:00:00', |
@@ -30,7 +30,7 if __name__ == '__main__': | |||
|
30 | 30 | # opObj11.addParameter(name='wintitle', value='Scope', format='str') |
|
31 | 31 | |
|
32 | 32 | opObj10 = procUnitConfObj0.addOperation(name='DigitalRFWriter', optype='other') |
|
33 |
opObj10.addParameter(name='path', value='/ |
|
|
33 | opObj10.addParameter(name='path', value='/home/nanosat/data/digitalrf', format='str') | |
|
34 | 34 | # opObj10.addParameter(name='minHei', value='0', format='float') |
|
35 | 35 | # opObj10.addParameter(name='maxHei', value='8', format='float') |
|
36 | 36 |
General Comments 0
You need to be logged in to leave comments.
Login now