@@ -0,0 +1,11 | |||||
|
1 | #!/home/soporte/workspace/schain/ENV_DIR/bin/python3 | |||
|
2 | ||||
|
3 | # -*- coding: utf-8 -*- | |||
|
4 | import re | |||
|
5 | import sys | |||
|
6 | ||||
|
7 | from setuptools.command.easy_install import main | |||
|
8 | ||||
|
9 | if __name__ == '__main__': | |||
|
10 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |||
|
11 | sys.exit(main()) |
@@ -0,0 +1,11 | |||||
|
1 | #!/home/soporte/workspace/schain/ENV_DIR/bin/python3 | |||
|
2 | ||||
|
3 | # -*- coding: utf-8 -*- | |||
|
4 | import re | |||
|
5 | import sys | |||
|
6 | ||||
|
7 | from setuptools.command.easy_install import main | |||
|
8 | ||||
|
9 | if __name__ == '__main__': | |||
|
10 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |||
|
11 | sys.exit(main()) |
@@ -0,0 +1,11 | |||||
|
1 | #!/home/soporte/workspace/schain/ENV_DIR/bin/python3 | |||
|
2 | ||||
|
3 | # -*- coding: utf-8 -*- | |||
|
4 | import re | |||
|
5 | import sys | |||
|
6 | ||||
|
7 | from pip import main | |||
|
8 | ||||
|
9 | if __name__ == '__main__': | |||
|
10 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |||
|
11 | sys.exit(main()) |
@@ -0,0 +1,11 | |||||
|
1 | #!/home/soporte/workspace/schain/ENV_DIR/bin/python3 | |||
|
2 | ||||
|
3 | # -*- coding: utf-8 -*- | |||
|
4 | import re | |||
|
5 | import sys | |||
|
6 | ||||
|
7 | from pip import main | |||
|
8 | ||||
|
9 | if __name__ == '__main__': | |||
|
10 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |||
|
11 | sys.exit(main()) |
@@ -0,0 +1,11 | |||||
|
1 | #!/home/soporte/workspace/schain/ENV_DIR/bin/python3 | |||
|
2 | ||||
|
3 | # -*- coding: utf-8 -*- | |||
|
4 | import re | |||
|
5 | import sys | |||
|
6 | ||||
|
7 | from pip import main | |||
|
8 | ||||
|
9 | if __name__ == '__main__': | |||
|
10 | sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) | |||
|
11 | sys.exit(main()) |
@@ -0,0 +1,1 | |||||
|
1 | python3 No newline at end of file |
@@ -0,0 +1,1 | |||||
|
1 | /usr/bin/python3 No newline at end of file |
@@ -0,0 +1,1 | |||||
|
1 | lib No newline at end of file |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
1 | NO CONTENT: new file 100644, binary diff hidden |
|
NO CONTENT: new file 100644, binary diff hidden |
@@ -478,7 +478,6 class Spectra(JROData): | |||||
478 | """ |
|
478 | """ | |
479 |
|
479 | |||
480 | noise = numpy.zeros(self.nChannels) |
|
480 | noise = numpy.zeros(self.nChannels) | |
481 |
|
||||
482 | for channel in range(self.nChannels): |
|
481 | for channel in range(self.nChannels): | |
483 | daux = self.data_spc[channel, |
|
482 | daux = self.data_spc[channel, | |
484 | xmin_index:xmax_index, ymin_index:ymax_index] |
|
483 | xmin_index:xmax_index, ymin_index:ymax_index] |
@@ -236,7 +236,7 class Plot(Operation): | |||||
236 | self.width = kwargs.get('width', None) |
|
236 | self.width = kwargs.get('width', None) | |
237 | self.height = kwargs.get('height', None) |
|
237 | self.height = kwargs.get('height', None) | |
238 | self.colorbar = kwargs.get('colorbar', True) |
|
238 | self.colorbar = kwargs.get('colorbar', True) | |
239 |
self.factors = kwargs.get('factors', |
|
239 | self.factors = kwargs.get('factors', range(18)) | |
240 | self.channels = kwargs.get('channels', None) |
|
240 | self.channels = kwargs.get('channels', None) | |
241 | self.titles = kwargs.get('titles', []) |
|
241 | self.titles = kwargs.get('titles', []) | |
242 | self.polar = False |
|
242 | self.polar = False |
@@ -48,7 +48,8 class SnrPlot(RTIPlot): | |||||
48 | colormap = 'jet' |
|
48 | colormap = 'jet' | |
49 |
|
49 | |||
50 | def update(self, dataOut): |
|
50 | def update(self, dataOut): | |
51 |
|
51 | if len(self.channelList) == 0: | ||
|
52 | self.channelList = dataOut.channelList | |||
52 | data = { |
|
53 | data = { | |
53 | 'snr': 10*numpy.log10(dataOut.data_snr) |
|
54 | 'snr': 10*numpy.log10(dataOut.data_snr) | |
54 | } |
|
55 | } | |
@@ -80,11 +81,12 class PowerPlot(RTIPlot): | |||||
80 | colormap = 'jet' |
|
81 | colormap = 'jet' | |
81 |
|
82 | |||
82 | def update(self, dataOut): |
|
83 | def update(self, dataOut): | |
83 |
|
84 | if len(self.channelList) == 0: | ||
|
85 | self.channelList = dataOut.channelList | |||
84 | data = { |
|
86 | data = { | |
85 | 'pow': 10*numpy.log10(dataOut.data_pow) |
|
87 | 'pow': 10*numpy.log10(dataOut.data_pow) | |
86 | } |
|
88 | } | |
87 | print("data",data) |
|
89 | #print("data",data) | |
88 | return data, {} |
|
90 | return data, {} | |
89 |
|
91 | |||
90 | class SpectralWidthPlot(RTIPlot): |
|
92 | class SpectralWidthPlot(RTIPlot): |
@@ -10,7 +10,7 import os | |||||
10 | import numpy |
|
10 | import numpy | |
11 |
|
11 | |||
12 | from schainpy.model.graphics.jroplot_base import Plot, plt, log |
|
12 | from schainpy.model.graphics.jroplot_base import Plot, plt, log | |
13 |
|
13 | from itertools import combinations | ||
14 |
|
14 | |||
15 | class SpectraPlot(Plot): |
|
15 | class SpectraPlot(Plot): | |
16 | ''' |
|
16 | ''' | |
@@ -43,6 +43,7 class SpectraPlot(Plot): | |||||
43 | data = {} |
|
43 | data = {} | |
44 | meta = {} |
|
44 | meta = {} | |
45 | spc = 10*numpy.log10(dataOut.data_spc/dataOut.normFactor) |
|
45 | spc = 10*numpy.log10(dataOut.data_spc/dataOut.normFactor) | |
|
46 | ||||
46 | data['spc'] = spc |
|
47 | data['spc'] = spc | |
47 | data['rti'] = dataOut.getPower() |
|
48 | data['rti'] = dataOut.getPower() | |
48 | data['noise'] = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) |
|
49 | data['noise'] = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) | |
@@ -139,7 +140,6 class CrossSpectraPlot(Plot): | |||||
139 | cspc = dataOut.data_cspc |
|
140 | cspc = dataOut.data_cspc | |
140 | meta['xrange'] = (dataOut.getFreqRange(1)/1000., dataOut.getAcfRange(1), dataOut.getVelRange(1)) |
|
141 | meta['xrange'] = (dataOut.getFreqRange(1)/1000., dataOut.getAcfRange(1), dataOut.getVelRange(1)) | |
141 | rawPairs = list(combinations(list(range(dataOut.nChannels)), 2)) |
|
142 | rawPairs = list(combinations(list(range(dataOut.nChannels)), 2)) | |
142 | #print(rawPairs) |
|
|||
143 | meta['pairs'] = rawPairs |
|
143 | meta['pairs'] = rawPairs | |
144 |
|
144 | |||
145 | if self.crossPairs == None: |
|
145 | if self.crossPairs == None: | |
@@ -224,7 +224,7 class RTIPlot(Plot): | |||||
224 | def setup(self): |
|
224 | def setup(self): | |
225 | self.xaxis = 'time' |
|
225 | self.xaxis = 'time' | |
226 | self.ncols = 1 |
|
226 | self.ncols = 1 | |
227 | print("dataChannels ",self.data.channels) |
|
227 | #print("dataChannels ",self.data.channels) | |
228 | self.nrows = len(self.data.channels) |
|
228 | self.nrows = len(self.data.channels) | |
229 | self.nplots = len(self.data.channels) |
|
229 | self.nplots = len(self.data.channels) | |
230 | self.ylabel = 'Range [km]' |
|
230 | self.ylabel = 'Range [km]' | |
@@ -233,7 +233,7 class RTIPlot(Plot): | |||||
233 | self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95}) |
|
233 | self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95}) | |
234 | self.titles = ['{} Channel {}'.format( |
|
234 | self.titles = ['{} Channel {}'.format( | |
235 | self.CODE.upper(), x) for x in range(self.nplots)] |
|
235 | self.CODE.upper(), x) for x in range(self.nplots)] | |
236 | print("SETUP") |
|
236 | ||
237 | def update(self, dataOut): |
|
237 | def update(self, dataOut): | |
238 | if len(self.channelList) == 0: |
|
238 | if len(self.channelList) == 0: | |
239 | self.channelList = dataOut.channelList |
|
239 | self.channelList = dataOut.channelList | |
@@ -241,10 +241,10 class RTIPlot(Plot): | |||||
241 | meta = {} |
|
241 | meta = {} | |
242 | data['rti'] = dataOut.getPower() |
|
242 | data['rti'] = dataOut.getPower() | |
243 | data['noise'] = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) |
|
243 | data['noise'] = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) | |
244 |
|
||||
245 | return data, meta |
|
244 | return data, meta | |
246 |
|
245 | |||
247 | def plot(self): |
|
246 | def plot(self): | |
|
247 | ||||
248 | self.x = self.data.times |
|
248 | self.x = self.data.times | |
249 | self.y = self.data.yrange |
|
249 | self.y = self.data.yrange | |
250 | self.z = self.data[self.CODE] |
|
250 | self.z = self.data[self.CODE] |
@@ -585,7 +585,7 class Reader(object): | |||||
585 | path, startDate, endDate, folderfmt, last=True) |
|
585 | path, startDate, endDate, folderfmt, last=True) | |
586 | else: |
|
586 | else: | |
587 | folders = path.split(',') |
|
587 | folders = path.split(',') | |
588 |
|
588 | |||
589 | return self.find_files( |
|
589 | return self.find_files( | |
590 | folders, ext, filefmt, startDate, endDate, expLabel, last=True) |
|
590 | folders, ext, filefmt, startDate, endDate, expLabel, last=True) | |
591 |
|
591 | |||
@@ -1431,6 +1431,7 class JRODataWriter(Reader): | |||||
1431 | if self.fp != None: |
|
1431 | if self.fp != None: | |
1432 | self.fp.close() |
|
1432 | self.fp.close() | |
1433 |
|
1433 | |||
|
1434 | ||||
1434 | if not os.path.exists(path): |
|
1435 | if not os.path.exists(path): | |
1435 | os.mkdir(path) |
|
1436 | os.mkdir(path) | |
1436 |
|
1437 |
@@ -1,4 +1,4 | |||||
1 | ''' |
|
1 | '''' | |
2 | Created on Set 9, 2015 |
|
2 | Created on Set 9, 2015 | |
3 |
|
3 | |||
4 | @author: roj-idl71 Karim Kuyeng |
|
4 | @author: roj-idl71 Karim Kuyeng | |
@@ -245,8 +245,8 class AMISRReader(ProcessingUnit): | |||||
245 | month = int(amisr_dirname_format[4:6]) |
|
245 | month = int(amisr_dirname_format[4:6]) | |
246 | dom = int(amisr_dirname_format[6:8]) |
|
246 | dom = int(amisr_dirname_format[6:8]) | |
247 | thisDate = datetime.date(year,month,dom) |
|
247 | thisDate = datetime.date(year,month,dom) | |
248 |
|
248 | #margen de un día extra, igual luego se filtra for fecha y hora | ||
249 | if (thisDate>=self.startDate and thisDate <= self.endDate): |
|
249 | if (thisDate>=(self.startDate - datetime.timedelta(days=1)) and thisDate <= (self.endDate)+ datetime.timedelta(days=1)): | |
250 | return amisr_dirname_format |
|
250 | return amisr_dirname_format | |
251 | except: |
|
251 | except: | |
252 | return None |
|
252 | return None | |
@@ -302,15 +302,16 class AMISRReader(ProcessingUnit): | |||||
302 | if self.timezone == 'lt': |
|
302 | if self.timezone == 'lt': | |
303 | startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300) |
|
303 | startDateTime_File = startDateTime_File - datetime.timedelta(minutes = 300) | |
304 | endDateTime_File = endDateTime_File - datetime.timedelta(minutes = 300) |
|
304 | endDateTime_File = endDateTime_File - datetime.timedelta(minutes = 300) | |
305 |
if ( |
|
305 | if (startDateTime_File >=startDateTime_Reader and endDateTime_File<=endDateTime_Reader): | |
306 | filter_filenameList.append(filename) |
|
306 | filter_filenameList.append(filename) | |
307 |
|
307 | |||
308 |
if ( |
|
308 | if (startDateTime_File>endDateTime_Reader): | |
309 | break |
|
309 | break | |
310 |
|
310 | |||
311 |
|
311 | |||
312 | filter_filenameList.sort() |
|
312 | filter_filenameList.sort() | |
313 | self.filenameList = filter_filenameList |
|
313 | self.filenameList = filter_filenameList | |
|
314 | ||||
314 | return 1 |
|
315 | return 1 | |
315 |
|
316 | |||
316 | def __filterByGlob1(self, dirName): |
|
317 | def __filterByGlob1(self, dirName): | |
@@ -335,9 +336,7 class AMISRReader(ProcessingUnit): | |||||
335 | return None |
|
336 | return None | |
336 |
|
337 | |||
337 | dirList = [os.path.join(self.path,x) for x in self.dirnameList] |
|
338 | dirList = [os.path.join(self.path,x) for x in self.dirnameList] | |
338 |
|
||||
339 | fileListInKeys = [self.__filterByGlob1(x) for x in dirList] |
|
339 | fileListInKeys = [self.__filterByGlob1(x) for x in dirList] | |
340 |
|
||||
341 | self.__getFilenameList(fileListInKeys, dirList) |
|
340 | self.__getFilenameList(fileListInKeys, dirList) | |
342 | if not(online): |
|
341 | if not(online): | |
343 | #filtro por tiempo |
|
342 | #filtro por tiempo | |
@@ -629,7 +628,6 class AMISRReader(ProcessingUnit): | |||||
629 | indexprof = numpy.mod(self.profileIndex, self.newProfiles) |
|
628 | indexprof = numpy.mod(self.profileIndex, self.newProfiles) | |
630 | indexblock = self.profileIndex/self.newProfiles |
|
629 | indexblock = self.profileIndex/self.newProfiles | |
631 | #print (indexblock, indexprof) |
|
630 | #print (indexblock, indexprof) | |
632 | diffUTC = 1.8e4 #UTC diference from peru in seconds --Joab |
|
|||
633 | diffUTC = 0 |
|
631 | diffUTC = 0 | |
634 | t_comp = (indexprof * self.ippSeconds * self.nchannels) + diffUTC # |
|
632 | t_comp = (indexprof * self.ippSeconds * self.nchannels) + diffUTC # | |
635 |
|
633 | |||
@@ -637,12 +635,12 class AMISRReader(ProcessingUnit): | |||||
637 | #print(numpy.shape(self.timeset)) |
|
635 | #print(numpy.shape(self.timeset)) | |
638 | self.dataOut.utctime = self.timeset[numpy.int_(indexblock)] + t_comp |
|
636 | self.dataOut.utctime = self.timeset[numpy.int_(indexblock)] + t_comp | |
639 | #self.dataOut.utctime = self.timeset[self.profileIndex] + t_comp |
|
637 | #self.dataOut.utctime = self.timeset[self.profileIndex] + t_comp | |
640 | #print(self.dataOut.utctime) |
|
638 | ||
641 | self.dataOut.profileIndex = self.profileIndex |
|
639 | self.dataOut.profileIndex = self.profileIndex | |
642 | #print("N profile:",self.profileIndex,self.newProfiles,self.nblocks,self.dataOut.utctime) |
|
640 | #print("N profile:",self.profileIndex,self.newProfiles,self.nblocks,self.dataOut.utctime) | |
643 | self.dataOut.flagNoData = False |
|
641 | self.dataOut.flagNoData = False | |
644 |
|
|
642 | # if indexprof == 0: | |
645 |
|
|
643 | # print("kamisr: ",self.dataOut.utctime) | |
646 |
|
644 | |||
647 | self.profileIndex += 1 |
|
645 | self.profileIndex += 1 | |
648 |
|
646 |
@@ -109,7 +109,7 class HDFReader(Reader, ProcessingUnit): | |||||
109 | self.endDate, self.expLabel, self.ext, self.walk, |
|
109 | self.endDate, self.expLabel, self.ext, self.walk, | |
110 | self.filefmt, self.folderfmt) |
|
110 | self.filefmt, self.folderfmt) | |
111 | pathname, filename = os.path.split(fullpath) |
|
111 | pathname, filename = os.path.split(fullpath) | |
112 | print(pathname,filename) |
|
112 | #print(pathname,filename) | |
113 | try: |
|
113 | try: | |
114 | fullpath = next(fullpath) |
|
114 | fullpath = next(fullpath) | |
115 |
|
115 | |||
@@ -180,7 +180,6 class HDFReader(Reader, ProcessingUnit): | |||||
180 | self.interval = numpy.min(thisUtcTime[1:] - thisUtcTime[:-1]) |
|
180 | self.interval = numpy.min(thisUtcTime[1:] - thisUtcTime[:-1]) | |
181 | thisDatetime = datetime.datetime.utcfromtimestamp(thisUtcTime[0]) |
|
181 | thisDatetime = datetime.datetime.utcfromtimestamp(thisUtcTime[0]) | |
182 | self.startFileDatetime = thisDatetime |
|
182 | self.startFileDatetime = thisDatetime | |
183 | print("datee ",self.startFileDatetime) |
|
|||
184 | thisDate = thisDatetime.date() |
|
183 | thisDate = thisDatetime.date() | |
185 | thisTime = thisDatetime.time() |
|
184 | thisTime = thisDatetime.time() | |
186 |
|
185 | |||
@@ -427,7 +426,7 class HDFWriter(Operation): | |||||
427 | currentTime = self.dataOut.utctime |
|
426 | currentTime = self.dataOut.utctime | |
428 | timeTuple = time.localtime(currentTime) |
|
427 | timeTuple = time.localtime(currentTime) | |
429 | dataDay = timeTuple.tm_yday |
|
428 | dataDay = timeTuple.tm_yday | |
430 |
|
429 | #print("time UTC: ",currentTime, self.dataOut.datatime) | ||
431 | if self.lastTime is None: |
|
430 | if self.lastTime is None: | |
432 | self.lastTime = currentTime |
|
431 | self.lastTime = currentTime | |
433 | self.currentDay = dataDay |
|
432 | self.currentDay = dataDay | |
@@ -467,7 +466,8 class HDFWriter(Operation): | |||||
467 | path = self.path |
|
466 | path = self.path | |
468 | setFile = self.setFile |
|
467 | setFile = self.setFile | |
469 |
|
468 | |||
470 |
timeTuple = time. |
|
469 | timeTuple = time.gmtime(self.dataOut.utctime) | |
|
470 | #print("path: ",timeTuple) | |||
471 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) |
|
471 | subfolder = 'd%4.4d%3.3d' % (timeTuple.tm_year,timeTuple.tm_yday) | |
472 | fullpath = os.path.join(path, subfolder) |
|
472 | fullpath = os.path.join(path, subfolder) | |
473 |
|
473 |
@@ -60,7 +60,7 class ParametersProc(ProcessingUnit): | |||||
60 | self.profIndex = 0 |
|
60 | self.profIndex = 0 | |
61 | self.dataOut = Parameters() |
|
61 | self.dataOut = Parameters() | |
62 | self.setupReq = False #Agregar a todas las unidades de proc |
|
62 | self.setupReq = False #Agregar a todas las unidades de proc | |
63 | print("INIT PROC") |
|
63 | ||
64 | def __updateObjFromInput(self): |
|
64 | def __updateObjFromInput(self): | |
65 |
|
65 | |||
66 | self.dataOut.inputUnit = self.dataIn.type |
|
66 | self.dataOut.inputUnit = self.dataIn.type | |
@@ -99,7 +99,6 class ParametersProc(ProcessingUnit): | |||||
99 | self.dataOut.elevationList = self.dataIn.elevationList |
|
99 | self.dataOut.elevationList = self.dataIn.elevationList | |
100 |
|
100 | |||
101 | def run(self): |
|
101 | def run(self): | |
102 | print("run proc param") |
|
|||
103 |
|
102 | |||
104 | #---------------------- Voltage Data --------------------------- |
|
103 | #---------------------- Voltage Data --------------------------- | |
105 |
|
104 |
@@ -643,11 +643,12 class CleanRayleigh(Operation): | |||||
643 |
|
643 | |||
644 | def cleanRayleigh(self,dataOut,spectra,cspectra,factor_stdv): |
|
644 | def cleanRayleigh(self,dataOut,spectra,cspectra,factor_stdv): | |
645 | #print("OP cleanRayleigh") |
|
645 | #print("OP cleanRayleigh") | |
646 | import matplotlib.pyplot as plt |
|
646 | #import matplotlib.pyplot as plt | |
647 | #for k in range(149): |
|
647 | #for k in range(149): | |
648 | channelsProcssd = [] |
|
648 | #channelsProcssd = [] | |
649 | channelA_ok = False |
|
649 | #channelA_ok = False | |
650 | rfunc = cspectra.copy() #self.bloques |
|
650 | #rfunc = cspectra.copy() #self.bloques | |
|
651 | rfunc = spectra.copy() | |||
651 | #rfunc = cspectra |
|
652 | #rfunc = cspectra | |
652 | #val_spc = spectra*0.0 #self.bloque0*0.0 |
|
653 | #val_spc = spectra*0.0 #self.bloque0*0.0 | |
653 | #val_cspc = cspectra*0.0 #self.bloques*0.0 |
|
654 | #val_cspc = cspectra*0.0 #self.bloques*0.0 | |
@@ -672,22 +673,27 class CleanRayleigh(Operation): | |||||
672 | gauss_fit, covariance = None, None |
|
673 | gauss_fit, covariance = None, None | |
673 | for ih in range(self.minAltInd,self.maxAltInd): |
|
674 | for ih in range(self.minAltInd,self.maxAltInd): | |
674 | for ifreq in range(self.nFFTPoints): |
|
675 | for ifreq in range(self.nFFTPoints): | |
|
676 | ''' | |||
675 | ###ONLY FOR TEST: |
|
677 | ###ONLY FOR TEST: | |
676 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY |
|
678 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY | |
677 | fig, axs = plt.subplots(raxs, caxs) |
|
679 | fig, axs = plt.subplots(raxs, caxs) | |
678 | fig2, axs2 = plt.subplots(raxs, caxs) |
|
680 | fig2, axs2 = plt.subplots(raxs, caxs) | |
679 | col_ax = 0 |
|
681 | col_ax = 0 | |
680 | row_ax = 0 |
|
682 | row_ax = 0 | |
|
683 | ''' | |||
681 | #print(self.nPairs) |
|
684 | #print(self.nPairs) | |
682 |
for ii in range(self.n |
|
685 | for ii in range(self.nChan): #PARES DE CANALES SELF y CROSS | |
683 | if self.crosspairs[ii][1]-self.crosspairs[ii][0] > 1: # APLICAR SOLO EN PARES CONTIGUOS |
|
686 | # if self.crosspairs[ii][1]-self.crosspairs[ii][0] > 1: # APLICAR SOLO EN PARES CONTIGUOS | |
684 | continue |
|
687 | # continue | |
685 | if not self.crosspairs[ii][0] in channelsProcssd: |
|
688 | # if not self.crosspairs[ii][0] in channelsProcssd: | |
686 | channelA_ok = True |
|
689 | # channelA_ok = True | |
687 | #print("pair: ",self.crosspairs[ii]) |
|
690 | #print("pair: ",self.crosspairs[ii]) | |
688 | if (col_ax%caxs==0 and col_ax!=0 and self.nPairs !=1): ###ONLY FOR TEST: |
|
691 | ''' | |
|
692 | ###ONLY FOR TEST: | |||
|
693 | if (col_ax%caxs==0 and col_ax!=0 and self.nPairs !=1): | |||
689 | col_ax = 0 |
|
694 | col_ax = 0 | |
690 | row_ax += 1 |
|
695 | row_ax += 1 | |
|
696 | ''' | |||
691 | func2clean = 10*numpy.log10(numpy.absolute(rfunc[:,ii,ifreq,ih])) #Potencia? |
|
697 | func2clean = 10*numpy.log10(numpy.absolute(rfunc[:,ii,ifreq,ih])) #Potencia? | |
692 | #print(func2clean.shape) |
|
698 | #print(func2clean.shape) | |
693 | val = (numpy.isfinite(func2clean)==True).nonzero() |
|
699 | val = (numpy.isfinite(func2clean)==True).nonzero() | |
@@ -718,31 +724,31 class CleanRayleigh(Operation): | |||||
718 | mode = gauss_fit[1] |
|
724 | mode = gauss_fit[1] | |
719 | stdv = gauss_fit[2] |
|
725 | stdv = gauss_fit[2] | |
720 | #print(" FIT OK",gauss_fit) |
|
726 | #print(" FIT OK",gauss_fit) | |
721 |
|
727 | ''' | ||
722 | ###ONLY FOR TEST: |
|
728 | ###ONLY FOR TEST: | |
723 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY |
|
729 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY | |
724 | newY = fit_func(x_dist,gauss_fit[0],gauss_fit[1],gauss_fit[2]) |
|
730 | newY = fit_func(x_dist,gauss_fit[0],gauss_fit[1],gauss_fit[2]) | |
725 | axs[row_ax,col_ax].plot(binstep[:-1],y_dist,color='green') |
|
731 | axs[row_ax,col_ax].plot(binstep[:-1],y_dist,color='green') | |
726 | axs[row_ax,col_ax].plot(binstep[:-1],newY,color='red') |
|
732 | axs[row_ax,col_ax].plot(binstep[:-1],newY,color='red') | |
727 |
axs[row_ax,col_ax].set_title(" |
|
733 | axs[row_ax,col_ax].set_title("CH "+str(self.channels[ii])) | |
728 |
|
734 | ''' | ||
729 | except: |
|
735 | except: | |
730 | mode = mean |
|
736 | mode = mean | |
731 | stdv = sigma |
|
737 | stdv = sigma | |
732 | #print("FIT FAIL") |
|
738 | #print("FIT FAIL") | |
733 | continue |
|
739 | #continue | |
734 |
|
740 | |||
735 |
|
741 | |||
736 | #print(mode,stdv) |
|
742 | #print(mode,stdv) | |
737 | #Removing echoes greater than mode + std_factor*stdv |
|
743 | #Removing echoes greater than mode + std_factor*stdv | |
738 | noval = (abs(func2clean - mode)>=(factor_stdv*stdv)).nonzero() |
|
744 | noval = (abs(func2clean - mode)>=(factor_stdv*stdv)).nonzero() | |
739 | #noval tiene los indices que se van a remover |
|
745 | #noval tiene los indices que se van a remover | |
740 |
#print(" |
|
746 | #print("Chan ",ii," novals: ",len(noval[0])) | |
741 | if len(noval[0]) > 0: #forma de array (N,) es igual a longitud (N) |
|
747 | if len(noval[0]) > 0: #forma de array (N,) es igual a longitud (N) | |
742 | novall = ((func2clean - mode) >= (factor_stdv*stdv)).nonzero() |
|
748 | novall = ((func2clean - mode) >= (factor_stdv*stdv)).nonzero() | |
743 | #print(novall) |
|
749 | #print(novall) | |
744 | #print(" ",self.pairsArray[ii]) |
|
750 | #print(" ",self.pairsArray[ii]) | |
745 | cross_pairs = self.pairsArray[ii] |
|
751 | #cross_pairs = self.pairsArray[ii] | |
746 | #Getting coherent echoes which are removed. |
|
752 | #Getting coherent echoes which are removed. | |
747 | # if len(novall[0]) > 0: |
|
753 | # if len(novall[0]) > 0: | |
748 | # |
|
754 | # | |
@@ -750,30 +756,39 class CleanRayleigh(Operation): | |||||
750 | # val_spc[novall[0],cross_pairs[1],ifreq,ih] = 1 |
|
756 | # val_spc[novall[0],cross_pairs[1],ifreq,ih] = 1 | |
751 | # val_cspc[novall[0],ii,ifreq,ih] = 1 |
|
757 | # val_cspc[novall[0],ii,ifreq,ih] = 1 | |
752 | #print("OUT NOVALL 1") |
|
758 | #print("OUT NOVALL 1") | |
753 |
|
759 | try: | ||
754 | new_a = numpy.delete(cspectra[:,ii,ifreq,ih], noval[0]) |
|
760 | pair = (self.channels[ii],self.channels[ii + 1]) | |
755 | cspectra[noval,ii,ifreq,ih] = numpy.mean(new_a) #mean CrossSpectra |
|
761 | except: | |
756 |
|
762 | pair = (99,99) | ||
757 |
|
|
763 | #print("par ", pair) | |
758 |
|
|
764 | if ( pair in self.crosspairs): | |
759 | new_b = numpy.delete(spectra[:,chA,ifreq,ih], noval[0]) |
|
765 | q = self.crosspairs.index(pair) | |
760 | spectra[noval,chA,ifreq,ih] = numpy.mean(new_b) #mean Spectra Pair A |
|
766 | #print("está aqui: ", q, (ii,ii + 1)) | |
761 | channelA_ok = False |
|
767 | new_a = numpy.delete(cspectra[:,q,ifreq,ih], noval[0]) | |
762 | chB = self.channels.index(cross_pairs[1]) |
|
768 | cspectra[noval,q,ifreq,ih] = numpy.mean(new_a) #mean CrossSpectra | |
763 | new_c = numpy.delete(spectra[:,chB,ifreq,ih], noval[0]) |
|
769 | ||
764 | spectra[noval,chB,ifreq,ih] = numpy.mean(new_c) #mean Spectra Pair B |
|
770 | #if channelA_ok: | |
765 |
|
771 | #chA = self.channels.index(cross_pairs[0]) | ||
766 | channelsProcssd.append(self.crosspairs[ii][0]) # save channel A |
|
772 | new_b = numpy.delete(spectra[:,ii,ifreq,ih], noval[0]) | |
767 | channelsProcssd.append(self.crosspairs[ii][1]) # save channel B |
|
773 | spectra[noval,ii,ifreq,ih] = numpy.mean(new_b) #mean Spectra Pair A | |
768 |
|
774 | #channelA_ok = False | ||
|
775 | ||||
|
776 | # chB = self.channels.index(cross_pairs[1]) | |||
|
777 | # new_c = numpy.delete(spectra[:,chB,ifreq,ih], noval[0]) | |||
|
778 | # spectra[noval,chB,ifreq,ih] = numpy.mean(new_c) #mean Spectra Pair B | |||
|
779 | # | |||
|
780 | # channelsProcssd.append(self.crosspairs[ii][0]) # save channel A | |||
|
781 | # channelsProcssd.append(self.crosspairs[ii][1]) # save channel B | |||
|
782 | ''' | |||
769 | ###ONLY FOR TEST: |
|
783 | ###ONLY FOR TEST: | |
770 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY |
|
784 | if ifreq ==fft_rev and ih==hei_rev: #TO VIEW A SIGNLE FREQUENCY | |
771 |
func2clean = 10*numpy.log10(numpy.absolute( |
|
785 | func2clean = 10*numpy.log10(numpy.absolute(spectra[:,ii,ifreq,ih])) | |
772 | y_dist,binstep = numpy.histogram(func2clean,bins=range(int(min_val),int(max_val+2),step)) |
|
786 | y_dist,binstep = numpy.histogram(func2clean,bins=range(int(min_val),int(max_val+2),step)) | |
773 | axs2[row_ax,col_ax].plot(binstep[:-1],newY,color='red') |
|
787 | axs2[row_ax,col_ax].plot(binstep[:-1],newY,color='red') | |
774 | axs2[row_ax,col_ax].plot(binstep[:-1],y_dist,color='green') |
|
788 | axs2[row_ax,col_ax].plot(binstep[:-1],y_dist,color='green') | |
775 |
axs2[row_ax,col_ax].set_title(" |
|
789 | axs2[row_ax,col_ax].set_title("CH "+str(self.channels[ii])) | |
776 |
|
790 | ''' | ||
|
791 | ''' | |||
777 | ###ONLY FOR TEST: |
|
792 | ###ONLY FOR TEST: | |
778 | col_ax += 1 #contador de ploteo columnas |
|
793 | col_ax += 1 #contador de ploteo columnas | |
779 | ##print(col_ax) |
|
794 | ##print(col_ax) | |
@@ -784,31 +799,8 class CleanRayleigh(Operation): | |||||
784 | fig.suptitle(title) |
|
799 | fig.suptitle(title) | |
785 | fig2.suptitle(title2) |
|
800 | fig2.suptitle(title2) | |
786 | plt.show() |
|
801 | plt.show() | |
787 |
|
||||
788 |
|
||||
789 | ''' |
|
|||
790 |
|
||||
791 | channels = channels |
|
|||
792 | cross_pairs = cross_pairs |
|
|||
793 | #print("OUT NOVALL 2") |
|
|||
794 |
|
||||
795 | vcross0 = (cross_pairs[0] == channels[ii]).nonzero() |
|
|||
796 | vcross1 = (cross_pairs[1] == channels[ii]).nonzero() |
|
|||
797 | vcross = numpy.concatenate((vcross0,vcross1),axis=None) |
|
|||
798 | #print('vcros =', vcross) |
|
|||
799 |
|
||||
800 | #Getting coherent echoes which are removed. |
|
|||
801 | if len(novall) > 0: |
|
|||
802 | #val_spc[novall,ii,ifreq,ih] = 1 |
|
|||
803 | val_spc[ii,ifreq,ih,novall] = 1 |
|
|||
804 | if len(vcross) > 0: |
|
|||
805 | val_cspc[vcross,ifreq,ih,novall] = 1 |
|
|||
806 |
|
||||
807 | #Removing coherent from ISR data. |
|
|||
808 | self.bloque0[ii,ifreq,ih,noval] = numpy.nan |
|
|||
809 | if len(vcross) > 0: |
|
|||
810 | self.bloques[vcross,ifreq,ih,noval] = numpy.nan |
|
|||
811 | ''' |
|
802 | ''' | |
|
803 | ################################################################################################## | |||
812 |
|
804 | |||
813 | #print("Getting average of the spectra and cross-spectra from incoherent echoes.") |
|
805 | #print("Getting average of the spectra and cross-spectra from incoherent echoes.") | |
814 | out_spectra = numpy.zeros([self.nChan,self.nFFTPoints,self.nHeights], dtype=float) #+numpy.nan |
|
806 | out_spectra = numpy.zeros([self.nChan,self.nFFTPoints,self.nHeights], dtype=float) #+numpy.nan | |
@@ -827,88 +819,14 class CleanRayleigh(Operation): | |||||
827 | valid = (numpy.isfinite(tmp)==True).nonzero() |
|
819 | valid = (numpy.isfinite(tmp)==True).nonzero() | |
828 | if len(valid[0]) > 0: |
|
820 | if len(valid[0]) > 0: | |
829 | out_cspectra[icr,ifreq,ih] = numpy.nansum(tmp)#/len(valid[0]) |
|
821 | out_cspectra[icr,ifreq,ih] = numpy.nansum(tmp)#/len(valid[0]) | |
830 | ''' |
|
|||
831 | # print('##########################################################') |
|
|||
832 | print("Removing fake coherent echoes (at least 4 points around the point)") |
|
|||
833 |
|
||||
834 | val_spectra = numpy.sum(val_spc,0) |
|
|||
835 | val_cspectra = numpy.sum(val_cspc,0) |
|
|||
836 |
|
||||
837 | val_spectra = self.REM_ISOLATED_POINTS(val_spectra,4) |
|
|||
838 | val_cspectra = self.REM_ISOLATED_POINTS(val_cspectra,4) |
|
|||
839 |
|
||||
840 | for i in range(nChan): |
|
|||
841 | for j in range(nProf): |
|
|||
842 | for k in range(nHeights): |
|
|||
843 | if numpy.isfinite(val_spectra[i,j,k]) and val_spectra[i,j,k] < 1 : |
|
|||
844 | val_spc[:,i,j,k] = 0.0 |
|
|||
845 | for i in range(nPairs): |
|
|||
846 | for j in range(nProf): |
|
|||
847 | for k in range(nHeights): |
|
|||
848 | if numpy.isfinite(val_cspectra[i,j,k]) and val_cspectra[i,j,k] < 1 : |
|
|||
849 | val_cspc[:,i,j,k] = 0.0 |
|
|||
850 |
|
||||
851 | # val_spc = numpy.reshape(val_spc, (len(spectra[:,0,0,0]),nProf*nHeights*nChan)) |
|
|||
852 | # if numpy.isfinite(val_spectra)==str(True): |
|
|||
853 | # noval = (val_spectra<1).nonzero() |
|
|||
854 | # if len(noval) > 0: |
|
|||
855 | # val_spc[:,noval] = 0.0 |
|
|||
856 | # val_spc = numpy.reshape(val_spc, (149,nChan,nProf,nHeights)) |
|
|||
857 |
|
||||
858 | #val_cspc = numpy.reshape(val_spc, (149,nChan*nHeights*nProf)) |
|
|||
859 | #if numpy.isfinite(val_cspectra)==str(True): |
|
|||
860 | # noval = (val_cspectra<1).nonzero() |
|
|||
861 | # if len(noval) > 0: |
|
|||
862 | # val_cspc[:,noval] = 0.0 |
|
|||
863 | # val_cspc = numpy.reshape(val_cspc, (149,nChan,nProf,nHeights)) |
|
|||
864 | tmp_sat_spectra = spectra.copy() |
|
|||
865 | tmp_sat_spectra = tmp_sat_spectra*numpy.nan |
|
|||
866 | tmp_sat_cspectra = cspectra.copy() |
|
|||
867 | tmp_sat_cspectra = tmp_sat_cspectra*numpy.nan |
|
|||
868 | ''' |
|
|||
869 | # fig = plt.figure(figsize=(6,5)) |
|
|||
870 | # left, bottom, width, height = 0.1, 0.1, 0.8, 0.8 |
|
|||
871 | # ax = fig.add_axes([left, bottom, width, height]) |
|
|||
872 | # cp = ax.contour(10*numpy.log10(numpy.absolute(spectra[0,0,:,:]))) |
|
|||
873 | # ax.clabel(cp, inline=True,fontsize=10) |
|
|||
874 | # plt.show() |
|
|||
875 | ''' |
|
|||
876 | val = (val_spc > 0).nonzero() |
|
|||
877 | if len(val[0]) > 0: |
|
|||
878 | tmp_sat_spectra[val] = in_sat_spectra[val] |
|
|||
879 | val = (val_cspc > 0).nonzero() |
|
|||
880 | if len(val[0]) > 0: |
|
|||
881 | tmp_sat_cspectra[val] = in_sat_cspectra[val] |
|
|||
882 |
|
||||
883 | print("Getting average of the spectra and cross-spectra from incoherent echoes 2") |
|
|||
884 | sat_spectra = numpy.zeros((nChan,nProf,nHeights), dtype=float) |
|
|||
885 | sat_cspectra = numpy.zeros((nPairs,nProf,nHeights), dtype=complex) |
|
|||
886 | for ih in range(nHeights): |
|
|||
887 | for ifreq in range(nProf): |
|
|||
888 | for ich in range(nChan): |
|
|||
889 | tmp = numpy.squeeze(tmp_sat_spectra[:,ich,ifreq,ih]) |
|
|||
890 | valid = (numpy.isfinite(tmp)).nonzero() |
|
|||
891 | if len(valid[0]) > 0: |
|
|||
892 | sat_spectra[ich,ifreq,ih] = numpy.nansum(tmp)/len(valid[0]) |
|
|||
893 |
|
822 | |||
894 | for icr in range(nPairs): |
|
|||
895 | tmp = numpy.squeeze(tmp_sat_cspectra[:,icr,ifreq,ih]) |
|
|||
896 | valid = (numpy.isfinite(tmp)).nonzero() |
|
|||
897 | if len(valid[0]) > 0: |
|
|||
898 | sat_cspectra[icr,ifreq,ih] = numpy.nansum(tmp)/len(valid[0]) |
|
|||
899 | ''' |
|
|||
900 | #self.__dataReady= True |
|
|||
901 | #sat_spectra, sat_cspectra= sat_spectra, sat_cspectra |
|
|||
902 | #if not self.__dataReady: |
|
|||
903 | #return None, None |
|
|||
904 | #return out_spectra, out_cspectra ,sat_spectra,sat_cspectra |
|
|||
905 | return out_spectra, out_cspectra |
|
823 | return out_spectra, out_cspectra | |
906 |
|
824 | |||
907 | def REM_ISOLATED_POINTS(self,array,rth): |
|
825 | def REM_ISOLATED_POINTS(self,array,rth): | |
908 | # import matplotlib.pyplot as plt |
|
826 | # import matplotlib.pyplot as plt | |
909 | if rth == None : |
|
827 | if rth == None : | |
910 | rth = 4 |
|
828 | rth = 4 | |
911 | print("REM ISO") |
|
829 | #print("REM ISO") | |
912 | num_prof = len(array[0,:,0]) |
|
830 | num_prof = len(array[0,:,0]) | |
913 | num_hei = len(array[0,0,:]) |
|
831 | num_hei = len(array[0,0,:]) | |
914 | n2d = len(array[:,0,0]) |
|
832 | n2d = len(array[:,0,0]) |
@@ -1335,9 +1335,7 class PulsePairVoltage(Operation): | |||||
1335 | self.lambda_ = 3.0e8/(9345.0e6) |
|
1335 | self.lambda_ = 3.0e8/(9345.0e6) | |
1336 | self.ippSec = dataOut.ippSeconds |
|
1336 | self.ippSec = dataOut.ippSeconds | |
1337 | self.nCohInt = dataOut.nCohInt |
|
1337 | self.nCohInt = dataOut.nCohInt | |
1338 | print("IPPseconds",dataOut.ippSeconds) |
|
1338 | ||
1339 |
|
||||
1340 | print("ELVALOR DE n es:", n) |
|
|||
1341 | if n == None: |
|
1339 | if n == None: | |
1342 | raise ValueError("n should be specified.") |
|
1340 | raise ValueError("n should be specified.") | |
1343 |
|
1341 |
General Comments 0
You need to be logged in to leave comments.
Login now