##// END OF EJS Templates
Lectura/Escritura de Rawdata y Pdata operando correctamente, se hicieron pruebas con datos de Drifts,Faraday e Imagenes.
Daniel Valdez -
r126:ba26fa07a34d
parent child
Show More
@@ -1,3 +1,9
1 '''
2
3 $Author$
4 $Id$
5 '''
6
1 7 import os, sys
2 8 import copy
3 9 import numpy
@@ -1,3 +1,9
1 '''
2
3 $Author$
4 $Id$
5 '''
6
1 7 import os, sys
2 8 import numpy
3 9
@@ -1,3 +1,9
1 '''
2
3 $Author$
4 $Id$
5 '''
6
1 7 import os, sys
2 8 import numpy
3 9
@@ -1,3 +1,9
1 '''
2
3 $Author$
4 $Id$
5 '''
6
1 7 import os, sys
2 8 import glob
3 9 import time
@@ -707,7 +713,7 class JRODataWriter(JRODataIO):
707 713
708 714 raise ValueError, "No implemented"
709 715
710 def setup(self, path, profilesPerBlock, blocksPerFile, set=0, ext=None):
716 def setup(self, path, blocksPerFile, profilesPerBlock=None, set=0, ext=None):
711 717 """
712 718 Setea el tipo de formato en la cual sera guardada la data y escribe el First Header
713 719
@@ -732,10 +738,10 class JRODataWriter(JRODataIO):
732 738
733 739 self.setFile = set - 1
734 740
735 self.profilesPerBlock = profilesPerBlock
736
737 741 self.blocksPerFile = blocksPerFile
738 742
743 self.profilesPerBlock = profilesPerBlock
744
739 745 if not(self.setNextFile()):
740 746 print "There isn't a next file"
741 747 return 0
@@ -1,8 +1,7
1 1 '''
2 Created on 23/01/2012
3 2
4 @author $Author: vsarmiento $
5 @version $Id: HeaderIO.py 37 2012-03-26 22:55:13Z vsarmiento $
3 $Author$
4 $Id$
6 5 '''
7 6
8 7 import numpy
@@ -1,9 +1,7
1 1 '''
2 File: SpectraIO.py
3 Created on 20/02/2012
4 2
5 @author $Author: dsuarez $
6 @version $Id: SpectraIO.py 110 2012-07-19 15:18:18Z dsuarez $
3 $Author$
4 $Id$
7 5 '''
8 6
9 7 import os, sys
@@ -367,7 +365,7 class SpectraReader(JRODataReader):
367 365
368 366 self.dataOutObj.channelIndexList = range(self.systemHeaderObj.nChannels)
369 367
370 self.dataOutObj.dataUtcTime = self.basicHeaderObj.utc #+ self.profileIndex * self.ippSeconds
368 self.dataOutObj.dataUtcTime = self.basicHeaderObj.utc + self.basicHeaderObj.miliSecond/1000.#+ self.profileIndex * self.ippSeconds
371 369
372 370 self.dataOutObj.flagShiftFFT = self.processingHeaderObj.shif_fft
373 371
@@ -541,6 +539,7 class SpectraWriter(JRODataWriter):
541 539 data = data.reshape((-1))
542 540 data.tofile(self.fp)
543 541
542 if self.data_dc != None:
544 543 data = numpy.zeros( self.shape_dc_Buffer, self.dtype )
545 544 dc = self.data_dc
546 545 data['real'] = dc.real
@@ -557,6 +556,7 class SpectraWriter(JRODataWriter):
557 556 self.flagIsNewBlock = 1
558 557 self.nTotalBlocks += 1
559 558 self.nWriteBlocks += 1
559 self.blockIndex += 1
560 560
561 561
562 562 def putData(self):
@@ -673,17 +673,17 class SpectraWriter(JRODataWriter):
673 673 pts2write = self.dataOutObj.nHeights * self.dataOutObj.nFFTPoints
674 674
675 675 pts2write_SelfSpectra = int(self.nWrChannels * pts2write)
676 blocksize = pts2write_SelfSpectra
676 blocksize = (pts2write_SelfSpectra*datatypeValue)
677 677
678 678 if self.dataOutObj.data_cspc != None:
679 679 pts2write_CrossSpectra = int(self.nWrPairs * pts2write)
680 blocksize += pts2write_CrossSpectra
680 blocksize += (pts2write_CrossSpectra*datatypeValue*2)
681 681
682 682 if self.dataOutObj.data_dc != None:
683 683 pts2write_DCchannels = int(self.nWrChannels * self.dataOutObj.nHeights)
684 blocksize += pts2write_DCchannels
684 blocksize += (pts2write_DCchannels*datatypeValue*2)
685 685
686 blocksize = blocksize * datatypeValue * 2
686 blocksize = blocksize #* datatypeValue * 2 #CORREGIR ESTO
687 687
688 688 return blocksize
689 689
@@ -1,8 +1,7
1 1 '''
2 Created on 23/01/2012
3 2
4 @author $Author: dsuarez $
5 @version $Id: VoltageIO.py 110 2012-07-19 15:18:18Z dsuarez $
3 $Author$
4 $Id$
6 5 '''
7 6
8 7 import os, sys
@@ -294,7 +293,7 class VoltageReader(JRODataReader):
294 293
295 294 self.dataOutObj.flagTimeBlock = self.flagTimeBlock
296 295
297 self.dataOutObj.dataUtcTime = self.basicHeaderObj.utc + self.profileIndex * self.ippSeconds
296 self.dataOutObj.dataUtcTime = self.basicHeaderObj.utc + self.basicHeaderObj.miliSecond/1000. + self.profileIndex * self.ippSeconds
298 297
299 298 self.dataOutObj.nCohInt = self.processingHeaderObj.nCohInt
300 299
@@ -1,9 +1,9
1 1 '''
2 Created on Feb 7, 2012
3 2
4 @author $Author: murco $
5 @version $Id: SpectraProcessor.py 119 2012-09-05 17:06:09Z murco $
3 $Author$
4 $Id$
6 5 '''
6
7 7 import os, sys
8 8 import numpy
9 9 import time
@@ -256,9 +256,9 class SpectraProcessor:
256 256
257 257 # self.getNoise()
258 258
259 def addWriter(self, wrpath, profilesPerBlock, blocksPerFile):
259 def addWriter(self, wrpath, blocksPerFile):
260 260 objWriter = SpectraWriter(self.dataOutObj)
261 objWriter.setup(wrpath, profilesPerBlock, blocksPerFile)
261 objWriter.setup(wrpath, blocksPerFile)
262 262 self.writerObjList.append(objWriter)
263 263
264 264 def addIntegrator(self,N,timeInterval):
@@ -266,12 +266,12 class SpectraProcessor:
266 266 objIncohInt = IncoherentIntegration(N,timeInterval)
267 267 self.integratorObjList.append(objIncohInt)
268 268
269 def writeData(self, wrpath, profilesPerBlock, blocksPerFile):
269 def writeData(self, wrpath, blocksPerFile):
270 270 if self.dataOutObj.flagNoData:
271 271 return 0
272 272
273 273 if len(self.writerObjList) <= self.writerObjIndex:
274 self.addWriter(wrpath, profilesPerBlock, blocksPerFile)
274 self.addWriter(wrpath, blocksPerFile)
275 275
276 276 self.writerObjList[self.writerObjIndex].putData()
277 277
@@ -1,3 +1,9
1 '''
2
3 $Author$
4 $Id$
5 '''
6
1 7 import os
2 8 import sys
3 9 import numpy
@@ -46,18 +52,18 class VoltageProcessor:
46 52 objCohInt = CoherentIntegrator(N,timeInterval)
47 53 self.integratorObjList.append(objCohInt)
48 54
49 def addWriter(self, wrpath, profilesPerBlock, blocksPerFile):
55 def addWriter(self, wrpath, blocksPerFile, profilesPerBlock):
50 56 objWriter = VoltageWriter(self.dataOutObj)
51 objWriter.setup(wrpath,profilesPerBlock,blocksPerFile)
57 objWriter.setup(wrpath,blocksPerFile,profilesPerBlock)
52 58 self.writerObjList.append(objWriter)
53 59
54 def writeData(self, wrpath, profilesPerBlock, blocksPerFile):
60 def writeData(self, wrpath, blocksPerFile, profilesPerBlock):
55 61
56 62 if self.dataOutObj.flagNoData:
57 63 return 0
58 64
59 65 if len(self.writerObjList) <= self.writerObjIndex:
60 self.addWriter(wrpath, profilesPerBlock, blocksPerFile)
66 self.addWriter(wrpath, blocksPerFile, profilesPerBlock)
61 67
62 68 self.writerObjList[self.writerObjIndex].putData()
63 69
@@ -1,4 +1,8
1 '''
1 2
3 $Author$
4 $Id$
5 '''
2 6 import os, sys
3 7 import time, datetime
4 8
@@ -1,3 +1,8
1 '''
2
3 $Author$
4 $Id$
5 '''
1 6
2 7 import os, sys
3 8 import time, datetime
@@ -20,10 +25,11 class TestSChain:
20 25 self.testSChain()
21 26
22 27 def setValues(self):
23 self.path = "/Users/jro/Documents/RadarData/MST_ISR/MST"
24 # self.path = "/home/roj-idl71/Data/RAWDATA/IMAGING"
25 self.path = "/Users/danielangelsuarezmunoz/Data/EW_Drifts"
26 self.path = "/Users/danielangelsuarezmunoz/Data/IMAGING"
28 # self.path = "/Users/jro/Documents/RadarData/MST_ISR/MST"
29 ## self.path = "/home/roj-idl71/Data/RAWDATA/IMAGING"
30 # self.path = "/Users/danielangelsuarezmunoz/Data/EW_Drifts"
31 # self.path = "/Users/danielangelsuarezmunoz/Data/IMAGING"
32 self.path = "/home/daniel/RadarData/IMAGING"
27 33
28 34 self.startDate = datetime.date(2012,3,1)
29 35 self.endDate = datetime.date(2012,3,30)
@@ -32,10 +38,9 class TestSChain:
32 38 self.endTime = datetime.time(14,1,1)
33 39
34 40 # paramatros para Escritura de Pdata
35 self.wrpath = "/Users/danielangelsuarezmunoz/Data/testWR_pdata"
36 self.profilesPerBlock = 8
41 self.wrpath = "/home/daniel/RadarData/test_wr2"
37 42 self.blocksPerFile = 5
38 # self.pairList = [(0,1),(0,2)]
43
39 44
40 45
41 46 def createObjects(self):
@@ -50,7 +55,7 class TestSChain:
50 55 endTime = self.endTime,
51 56 expLabel = '',
52 57 online = 0)
53 # new lines
58
54 59 self.specObjProc = SpectraProcessor()
55 60
56 61 self.specObj2 = self.specObjProc.setup(dataInObj = self.specObj1)
@@ -66,8 +71,8 class TestSChain:
66 71
67 72 self.specObjProc.init()
68 73
69 self.specObjProc.writeData(self.wrpath,self.profilesPerBlock,self.blocksPerFile)
70
74 self.specObjProc.writeData(self.wrpath,self.blocksPerFile)
75 #
71 76 if self.readerObj.flagNoMoreFiles:
72 77 break
73 78
General Comments 0
You need to be logged in to leave comments. Login now