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