##// END OF EJS Templates
Se añade el metodo fix_publish y se editan los metodos listen y publish, en el ultimo se colocaun pequeño retardo aplicado exclusivamente durante la comunacion desde la unidad de lectura, las demas operaciones se realizan igual.
Se añade el metodo fix_publish y se editan los metodos listen y publish, en el ultimo se colocaun pequeño retardo aplicado exclusivamente durante la comunacion desde la unidad de lectura, las demas operaciones se realizan igual.

File last commit:

r1219:a84ca1922528
r1220:dd4695cf07ce
Show More
jrodata.py
1366 lines | 37.7 KiB | text/x-python | PythonLexer
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 '''
$Author: murco $
$Id: JROData.py 173 2012-11-20 15:06:21Z murco $
'''
import copy
import numpy
import datetime
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 import json
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 from schainpy.utils import log
George Yong
Python 2to3, Spectra (all operations) working
r1167 from .jroheaderIO import SystemHeader, RadarControllerHeader
Juan C. Valdez
Add C extension for hildebrand_sekhon noise estimation and update requirements versions in setup
r878
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
def getNumpyDtype(dataTypeCode):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if dataTypeCode == 0:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<i1'), ('imag', '<i1')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 elif dataTypeCode == 1:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<i2'), ('imag', '<i2')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 elif dataTypeCode == 2:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<i4'), ('imag', '<i4')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 elif dataTypeCode == 3:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<i8'), ('imag', '<i8')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 elif dataTypeCode == 4:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<f4'), ('imag', '<f4')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 elif dataTypeCode == 5:
José Chávez
formatting, template actualizado, decimation a 300
r1092 numpyDtype = numpy.dtype([('real', '<f8'), ('imag', '<f8')])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 else:
George Yong
Python 2to3, Spectra (all operations) working
r1167 raise ValueError('dataTypeCode was not defined')
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return numpyDtype
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getDataTypeCode(numpyDtype):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 if numpyDtype == numpy.dtype([('real', '<i1'), ('imag', '<i1')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 0
José Chávez
formatting, template actualizado, decimation a 300
r1092 elif numpyDtype == numpy.dtype([('real', '<i2'), ('imag', '<i2')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 1
José Chávez
formatting, template actualizado, decimation a 300
r1092 elif numpyDtype == numpy.dtype([('real', '<i4'), ('imag', '<i4')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 2
José Chávez
formatting, template actualizado, decimation a 300
r1092 elif numpyDtype == numpy.dtype([('real', '<i8'), ('imag', '<i8')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 3
José Chávez
formatting, template actualizado, decimation a 300
r1092 elif numpyDtype == numpy.dtype([('real', '<f4'), ('imag', '<f4')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 4
José Chávez
formatting, template actualizado, decimation a 300
r1092 elif numpyDtype == numpy.dtype([('real', '<f8'), ('imag', '<f8')]):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatype = 5
else:
datatype = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return datatype
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def hildebrand_sekhon(data, navg):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 """
ReceiverData Operation, test PlotData
r889 This method is for the objective determination of the noise level in Doppler spectra. This
implementation technique is based on the fact that the standard deviation of the spectral
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 densities is equal to the mean spectral density for white Gaussian noise
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 Inputs:
Data : heights
navg : numbers of averages
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 Return:
Juan C. Espinoza
Remove C extension
r1176 mean : noise's level
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 """
ReceiverData Operation, test PlotData
r889
George Yong
Multiprocessing for writing Units(Spectral, Voltage and Parameters)
r1179 sortdata = numpy.sort(data, axis=None)
lenOfData = len(sortdata)
nums_min = lenOfData*0.2
if nums_min <= 5:
nums_min = 5
sump = 0.
sumq = 0.
j = 0
cont = 1
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 while((cont == 1)and(j < lenOfData)):
George Yong
Multiprocessing for writing Units(Spectral, Voltage and Parameters)
r1179
sump += sortdata[j]
sumq += sortdata[j]**2
if j > nums_min:
rtest = float(j)/(j-1) + 1.0/navg
if ((sumq*j) > (rtest*sump**2)):
j = j - 1
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 sump = sump - sortdata[j]
sumq = sumq - sortdata[j]**2
George Yong
Multiprocessing for writing Units(Spectral, Voltage and Parameters)
r1179 cont = 0
j += 1
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 lnoise = sump / j
George Yong
Multiprocessing for writing Units(Spectral, Voltage and Parameters)
r1179
return lnoise
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501 class Beam:
ReceiverData Operation, test PlotData
r889
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501 def __init__(self):
self.codeList = []
self.azimuthList = []
ReceiverData Operation, test PlotData
r889 self.zenithList = []
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class GenericData(object):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 flagNoData = True
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def copy(self, inputObj=None):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if inputObj == None:
return copy.deepcopy(self)
George Yong
Python 2to3, Spectra (all operations) working
r1167 for key in list(inputObj.__dict__.keys()):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed in jrodata: Error working with more than one branch. When a value is updated in a branch this value is modified in every other branch because variables are references.
r757 attribute = inputObj.__dict__[key]
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # If this attribute is a tuple or list
Miguel Valdez
Bug fixed in jrodata: Error working with more than one branch. When a value is updated in a branch this value is modified in every other branch because variables are references.
r757 if type(inputObj.__dict__[key]) in (tuple, list):
self.__dict__[key] = attribute[:]
continue
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # If this attribute is another object or instance
Miguel Valdez
Bug fixed in jrodata: Error working with more than one branch. When a value is updated in a branch this value is modified in every other branch because variables are references.
r757 if hasattr(attribute, '__dict__'):
self.__dict__[key] = attribute.copy()
continue
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__dict__[key] = inputObj.__dict__[key]
def deepcopy(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return copy.deepcopy(self)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def isEmpty(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return self.flagNoData
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class JROData(GenericData):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # m_BasicHeader = BasicHeader()
# m_ProcessingHeader = ProcessingHeader()
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
systemHeaderObj = SystemHeader()
radarControllerHeaderObj = RadarControllerHeader()
# data = None
type = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 datatype = None # dtype but in string
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # dtype = None
# nChannels = None
# nHeights = None
nProfiles = None
heightList = None
channelList = None
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 flagDiscontinuousBlock = False
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 useLocalTime = False
utctime = None
timeZone = None
dstFlag = None
errorCount = None
blocksize = None
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 # nCode = None
# nBaud = None
# code = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 flagDecodeData = False # asumo q la data no esta decodificada
flagDeflipData = False # asumo q la data no esta sin flip
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 flagShiftFFT = False
# ippSeconds = None
Miguel Valdez
JRODATA: timeInterval is a property now
r526 # timeInterval = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nCohInt = None
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 # noise = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 windowOfFilter = 1
José Chávez
formatting, template actualizado, decimation a 300
r1092 # Speed of ligth
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 C = 3e8
frequency = 49.92e6
realtime = False
beacon_heiIndexList = None
last_block = None
blocknow = None
Daniel Valdez
Filtering AMISR files for Datetime Range...
r499 azimuth = None
zenith = None
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501 beam = Beam()
Miguel Valdez
Affected:...
r534 profileIndex = None
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 error = None
data = None
Juan C. Espinoza
Merge with Claire_proc
r1188 nmodes = None
Juan C. Espinoza
Remove C extension
r1176
def __str__(self):
return '{} - {}'.format(self.type, self.getDatatime())
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNoise(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
-Using ValueError raises instead of IOError...
r684 raise NotImplementedError
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNChannels(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return len(self.channelList)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getChannelIndexList(self):
ReceiverData Operation, test PlotData
r889
George Yong
Python 2to3, Spectra (all operations) working
r1167 return list(range(self.nChannels))
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNHeights(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return len(self.heightList)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getHeiRange(self, extrapoints=0):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 heis = self.heightList
# deltah = self.heightList[1] - self.heightList[0]
ReceiverData Operation, test PlotData
r889 #
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # heis.append(self.heightList[-1])
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return heis
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 def getDeltaH(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 delta = self.heightList[1] - self.heightList[0]
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 return delta
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getltctime(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.useLocalTime:
José Chávez
formatting, template actualizado, decimation a 300
r1092 return self.utctime - self.timeZone * 60
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return self.utctime
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getDatatime(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatimeValue = datetime.datetime.utcfromtimestamp(self.ltctime)
return datatimeValue
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getTimeRange(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = []
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime.append(self.ltctime)
José Chávez
formatting, template actualizado, decimation a 300
r1092 datatime.append(self.ltctime + self.timeInterval + 1)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = numpy.array(datatime)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return datatime
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 def getFmaxTimeResponse(self):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 period = (10**-6) * self.getDeltaH() / (0.15)
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 PRF = 1. / (period * self.nCohInt)
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 fmax = PRF
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 return fmax
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getFmax(self):
José Chávez
formatting, template actualizado, decimation a 300
r1092 PRF = 1. / (self.ippSeconds * self.nCohInt)
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 fmax = PRF
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return fmax
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getVmax(self):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 _lambda = self.C / self.frequency
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 vmax = self.getFmax() * _lambda / 2
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return vmax
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def get_ippSeconds(self):
'''
'''
return self.radarControllerHeaderObj.ippSeconds
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def set_ippSeconds(self, ippSeconds):
'''
'''
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.radarControllerHeaderObj.ippSeconds = ippSeconds
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def get_dtype(self):
'''
'''
return getNumpyDtype(self.datatype)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def set_dtype(self, numpyDtype):
'''
'''
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.datatype = getDataTypeCode(numpyDtype)
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568
def get_code(self):
'''
'''
return self.radarControllerHeaderObj.code
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def set_code(self, code):
'''
'''
self.radarControllerHeaderObj.code = code
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 return
def get_ncode(self):
'''
'''
return self.radarControllerHeaderObj.nCode
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def set_ncode(self, nCode):
'''
'''
self.radarControllerHeaderObj.nCode = nCode
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 return
def get_nbaud(self):
'''
'''
return self.radarControllerHeaderObj.nBaud
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def set_nbaud(self, nBaud):
'''
'''
self.radarControllerHeaderObj.nBaud = nBaud
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 return
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nChannels = property(getNChannels, "I'm the 'nChannel' property.")
José Chávez
formatting, template actualizado, decimation a 300
r1092 channelIndexList = property(
getChannelIndexList, "I'm the 'channelIndexList' property.")
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nHeights = property(getNHeights, "I'm the 'nHeights' property.")
#noise = property(getNoise, "I'm the 'nHeights' property.")
datatime = property(getDatatime, "I'm the 'datatime' property")
ltctime = property(getltctime, "I'm the 'ltctime' property")
ippSeconds = property(get_ippSeconds, set_ippSeconds)
dtype = property(get_dtype, set_dtype)
Miguel Valdez
JRODATA: timeInterval is a property now
r526 # timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property")
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 code = property(get_code, set_code)
nCode = property(get_ncode, set_ncode)
nBaud = property(get_nbaud, set_nbaud)
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class Voltage(JROData):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # data es un numpy array de 2 dmensiones (canales, alturas)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 data = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def __init__(self):
'''
Constructor
'''
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566 self.useLocalTime = True
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.radarControllerHeaderObj = RadarControllerHeader()
self.systemHeaderObj = SystemHeader()
self.type = "Voltage"
self.data = None
# self.dtype = None
# self.nChannels = 0
# self.nHeights = 0
self.nProfiles = None
George Yong
Multiprocessing for heispectra (Fits) all working
r1191 self.heightList = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.channelList = None
# self.channelIndexList = None
self.flagNoData = True
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.flagDiscontinuousBlock = False
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.utctime = None
self.timeZone = None
self.dstFlag = None
self.errorCount = None
self.nCohInt = None
self.blocksize = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 self.flagDecodeData = False # asumo q la data no esta decodificada
self.flagDeflipData = False # asumo q la data no esta sin flip
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.flagShiftFFT = False
José Chávez
formatting, template actualizado, decimation a 300
r1092 self.flagDataAsBlock = False # Asumo que la data es leida perfil a perfil
Miguel Valdez
Affected:...
r534 self.profileIndex = 0
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 def getNoisebyHildebrand(self, channel=None):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 """
Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 Return:
noiselevel
"""
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if channel != None:
data = self.data[channel]
nChannels = 1
else:
data = self.data
nChannels = self.nChannels
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 noise = numpy.zeros(nChannels)
power = data * numpy.conjugate(data)
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 for thisChannel in range(nChannels):
if nChannels == 1:
daux = power[:].real
else:
José Chávez
formatting, template actualizado, decimation a 300
r1092 daux = power[thisChannel, :].real
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 noise[thisChannel] = hildebrand_sekhon(daux, self.nCohInt)
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 return noise
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 def getNoise(self, type=1, channel=None):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if type == 1:
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 noise = self.getNoisebyHildebrand(channel)
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Coherent Integration by Blocks: Bug fixed, nProfiles is divided by number of integrations
r720 return noise
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 def getPower(self, channel=None):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if channel != None:
data = self.data[channel]
else:
data = self.data
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 power = data * numpy.conjugate(data)
José Chávez
formatting, template actualizado, decimation a 300
r1092 powerdB = 10 * numpy.log10(power.real)
Julio Valdez
-Corrections to Vmax calculation...
r850 powerdB = numpy.squeeze(powerdB)
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 return powerdB
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 def getTimeInterval(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 timeInterval = self.ippSeconds * self.nCohInt
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 return timeInterval
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 noise = property(getNoise, "I'm the 'nHeights' property.")
timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property")
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class Spectra(JROData):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # data spc es un numpy array de 2 dmensiones (canales, perfiles, alturas)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 data_spc = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 # data cspc es un numpy array de 2 dmensiones (canales, pares, alturas)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 data_cspc = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 # data dc es un numpy array de 2 dmensiones (canales, alturas)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 data_dc = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 # data power
Julio Valdez
-Parameters Plot corrected...
r832 data_pwr = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nFFTPoints = None
# nPairs = None
pairsList = None
nIncohInt = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 wavelength = None # Necesario para cacular el rango de velocidad desde la frecuencia
nCohInt = None # se requiere para determinar el valor de timeInterval
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ippFactor = None
Miguel Valdez
Affected:...
r534 profileIndex = 0
Miguel Valdez
jrodata.py: plotting attribute added to SpectraData
r773 plotting = "spectra"
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def __init__(self):
'''
Constructor
'''
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566 self.useLocalTime = True
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.radarControllerHeaderObj = RadarControllerHeader()
self.systemHeaderObj = SystemHeader()
self.type = "Spectra"
# self.data = None
# self.dtype = None
# self.nChannels = 0
# self.nHeights = 0
self.nProfiles = None
self.heightList = None
self.channelList = None
# self.channelIndexList = None
self.pairsList = None
self.flagNoData = True
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.flagDiscontinuousBlock = False
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.utctime = None
self.nCohInt = None
self.nIncohInt = None
self.blocksize = None
self.nFFTPoints = None
self.wavelength = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 self.flagDecodeData = False # asumo q la data no esta decodificada
self.flagDeflipData = False # asumo q la data no esta sin flip
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.flagShiftFFT = False
self.ippFactor = 1
#self.noise = None
self.beacon_heiIndexList = []
self.noise_estimation = None
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def getNoisebyHildebrand(self, xmin_index=None, xmax_index=None, ymin_index=None, ymax_index=None):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 """
Determino el nivel de ruido usando el metodo Hildebrand-Sekhon
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 Return:
noiselevel
"""
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 noise = numpy.zeros(self.nChannels)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for channel in range(self.nChannels):
José Chávez
formatting, template actualizado, decimation a 300
r1092 daux = self.data_spc[channel,
xmin_index:xmax_index, ymin_index:ymax_index]
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 noise[channel] = hildebrand_sekhon(daux, self.nIncohInt)
ReceiverData Operation, test PlotData
r889
return noise
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def getNoise(self, xmin_index=None, xmax_index=None, ymin_index=None, ymax_index=None):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
minor changes
r729 if self.noise_estimation is not None:
José Chávez
formatting, template actualizado, decimation a 300
r1092 # this was estimated by getNoise Operation defined in jroproc_spectra.py
return self.noise_estimation
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 else:
José Chávez
formatting, template actualizado, decimation a 300
r1092 noise = self.getNoisebyHildebrand(
xmin_index, xmax_index, ymin_index, ymax_index)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return noise
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 def getFreqRangeTimeResponse(self, extrapoints=0):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 deltafreq = self.getFmaxTimeResponse() / (self.nFFTPoints * self.ippFactor)
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2
ReceiverData Operation, test PlotData
r889
Miguel Valdez
jrodata: TimeRange added for ACF module
r771 return freqrange
ReceiverData Operation, test PlotData
r889
Miguel Valdez
jrodata: TimeRange added for ACF module
r771 def getAcfRange(self, extrapoints=0):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 deltafreq = 10. / (self.getFmax() / (self.nFFTPoints * self.ippFactor))
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 return freqrange
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getFreqRange(self, extrapoints=0):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 deltafreq = self.getFmax() / (self.nFFTPoints * self.ippFactor)
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 freqrange = deltafreq * (numpy.arange(self.nFFTPoints + extrapoints) -self.nFFTPoints / 2.) - deltafreq / 2
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return freqrange
def getVelRange(self, extrapoints=0):
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 deltav = self.getVmax() / (self.nFFTPoints * self.ippFactor)
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 velrange = deltav * (numpy.arange(self.nFFTPoints + extrapoints) - self.nFFTPoints / 2.)
Juan C. Espinoza
Merge with Claire_proc
r1188 if self.nmodes:
return velrange/self.nmodes
else:
return velrange
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNPairs(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return len(self.pairsList)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getPairsIndexList(self):
ReceiverData Operation, test PlotData
r889
George Yong
Python 2to3, Spectra (all operations) working
r1167 return list(range(self.nPairs))
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNormFactor(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 pwcode = 1
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.flagDecodeData:
pwcode = numpy.sum(self.code[0]**2)
#normFactor = min(self.nFFTPoints,self.nProfiles)*self.nIncohInt*self.nCohInt*pwcode*self.windowOfFilter
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 normFactor = self.nProfiles * self.nIncohInt * self.nCohInt * pwcode * self.windowOfFilter
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return normFactor
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getFlagCspc(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Padding decode data with zeros at the first heights was eliminated.
r611 if self.data_cspc is None:
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return True
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return False
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getFlagDc(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed: Padding decode data with zeros at the first heights was eliminated.
r611 if self.data_dc is None:
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return True
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return False
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 def getTimeInterval(self):
ReceiverData Operation, test PlotData
r889
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 timeInterval = self.ippSeconds * self.nCohInt * self.nIncohInt * self.nProfiles * self.ippFactor
Juan C. Espinoza
Fix BLTR spectra reader
r1211 if self.nmodes:
return self.nmodes*timeInterval
else:
return timeInterval
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Parameters Plot corrected...
r832 def getPower(self):
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Parameters Plot corrected...
r832 factor = self.normFactor
José Chávez
formatting, template actualizado, decimation a 300
r1092 z = self.data_spc / factor
ReceiverData Operation, test PlotData
r889 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Julio Valdez
-Parameters Plot corrected...
r832 avg = numpy.average(z, axis=1)
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 return 10 * numpy.log10(avg)
ReceiverData Operation, test PlotData
r889
def getCoherence(self, pairsList=None, phase=False):
z = []
if pairsList is None:
pairsIndexList = self.pairsIndexList
else:
pairsIndexList = []
for pair in pairsList:
if pair not in self.pairsList:
George Yong
Python 2to3, Spectra (all operations) working
r1167 raise ValueError("Pair %s is not in dataOut.pairsList" % (
pair))
José Chávez
formatting, template actualizado, decimation a 300
r1092 pairsIndexList.append(self.pairsList.index(pair))
ReceiverData Operation, test PlotData
r889 for i in range(len(pairsIndexList)):
pair = self.pairsList[pairsIndexList[i]]
George Yong
Wind and rainfall processing of CLAIRE radar with V3.0
r1205 ccf = numpy.average(self.data_cspc[pairsIndexList[i], :, :], axis=0)
ReceiverData Operation, test PlotData
r889 powa = numpy.average(self.data_spc[pair[0], :, :], axis=0)
powb = numpy.average(self.data_spc[pair[1], :, :], axis=0)
José Chávez
formatting, template actualizado, decimation a 300
r1092 avgcoherenceComplex = ccf / numpy.sqrt(powa * powb)
ReceiverData Operation, test PlotData
r889 if phase:
data = numpy.arctan2(avgcoherenceComplex.imag,
José Chávez
formatting, template actualizado, decimation a 300
r1092 avgcoherenceComplex.real) * 180 / numpy.pi
ReceiverData Operation, test PlotData
r889 else:
data = numpy.abs(avgcoherenceComplex)
z.append(data)
return numpy.array(z)
Miguel Valdez
Bug fixed:...
r624 def setValue(self, value):
ReceiverData Operation, test PlotData
r889
George Yong
Python 2to3, Spectra (all operations) working
r1167 print("This property should not be initialized")
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed:...
r624 return
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Bug fixed:...
r624 nPairs = property(getNPairs, setValue, "I'm the 'nPairs' property.")
José Chávez
formatting, template actualizado, decimation a 300
r1092 pairsIndexList = property(
getPairsIndexList, setValue, "I'm the 'pairsIndexList' property.")
normFactor = property(getNormFactor, setValue,
"I'm the 'getNormFactor' property.")
Miguel Valdez
Bug fixed:...
r624 flag_cspc = property(getFlagCspc, setValue)
flag_dc = property(getFlagDc, setValue)
noise = property(getNoise, setValue, "I'm the 'nHeights' property.")
José Chávez
formatting, template actualizado, decimation a 300
r1092 timeInterval = property(getTimeInterval, setValue,
"I'm the 'timeInterval' property")
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class SpectraHeis(Spectra):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 data_spc = None
data_cspc = None
data_dc = None
nFFTPoints = None
# nPairs = None
pairsList = None
Miguel Valdez
Signal Chain GUI updated:...
r587 nCohInt = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nIncohInt = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def __init__(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.radarControllerHeaderObj = RadarControllerHeader()
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.systemHeaderObj = SystemHeader()
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.type = "SpectraHeis"
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.dtype = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.nChannels = 0
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.nHeights = 0
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.nProfiles = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.heightList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.channelList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.channelIndexList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.flagNoData = True
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.flagDiscontinuousBlock = False
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.nPairs = 0
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.utctime = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.blocksize = None
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Affected:...
r534 self.profileIndex = 0
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nCohInt = 1
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nIncohInt = 1
ReceiverData Operation, test PlotData
r889
Daniel Valdez
The Spectra-1d Plot shows the normalized power.
r496 def getNormFactor(self):
pwcode = 1
if self.flagDecodeData:
pwcode = numpy.sum(self.code[0]**2)
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 normFactor = self.nIncohInt * self.nCohInt * pwcode
ReceiverData Operation, test PlotData
r889
Daniel Valdez
The Spectra-1d Plot shows the normalized power.
r496 return normFactor
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 def getTimeInterval(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 timeInterval = self.ippSeconds * self.nCohInt * self.nIncohInt
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 return timeInterval
ReceiverData Operation, test PlotData
r889
Daniel Valdez
The Spectra-1d Plot shows the normalized power.
r496 normFactor = property(getNormFactor, "I'm the 'getNormFactor' property.")
Miguel Valdez
JRODATA: timeInterval is a property now
r526 timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property")
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
José Chávez
formatting, template actualizado, decimation a 300
r1092
Miguel Valdez
Signal Chain GUI updated:...
r587 class Fits(JROData):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 heightList = None
channelList = None
flagNoData = True
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 flagDiscontinuousBlock = False
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 useLocalTime = False
utctime = None
timeZone = None
# ippSeconds = None
Miguel Valdez
JRODATA: timeInterval is a property now
r526 # timeInterval = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nCohInt = None
nIncohInt = None
noise = None
windowOfFilter = 1
José Chávez
formatting, template actualizado, decimation a 300
r1092 # Speed of ligth
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 C = 3e8
frequency = 49.92e6
realtime = False
def __init__(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.type = "Fits"
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.nProfiles = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.heightList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.channelList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.channelIndexList = None
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.flagNoData = True
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.utctime = None
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nCohInt = 1
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nIncohInt = 1
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.useLocalTime = True
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Affected:...
r534 self.profileIndex = 0
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 # self.utctime = None
# self.timeZone = None
# self.ltctime = None
# self.timeInterval = None
# self.header = None
# self.data_header = None
# self.data = None
# self.datatime = None
# self.flagNoData = False
# self.expName = ''
# self.nChannels = None
# self.nSamples = None
# self.dataBlocksPerFile = None
# self.comments = ''
ReceiverData Operation, test PlotData
r889 #
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getltctime(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.useLocalTime:
José Chávez
formatting, template actualizado, decimation a 300
r1092 return self.utctime - self.timeZone * 60
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return self.utctime
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getDatatime(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = datetime.datetime.utcfromtimestamp(self.ltctime)
return datatime
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getTimeRange(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = []
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime.append(self.ltctime)
datatime.append(self.ltctime + self.timeInterval)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = numpy.array(datatime)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return datatime
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getHeiRange(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 heis = self.heightList
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return heis
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNHeights(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return len(self.heightList)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getNChannels(self):
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return len(self.channelList)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def getChannelIndexList(self):
ReceiverData Operation, test PlotData
r889
George Yong
Python 2to3, Spectra (all operations) working
r1167 return list(range(self.nChannels))
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 def getNoise(self, type=1):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 #noise = numpy.zeros(self.nChannels)
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if type == 1:
noise = self.getNoisebyHildebrand()
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if type == 2:
noise = self.getNoisebySort()
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if type == 3:
noise = self.getNoisebyWindow()
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return noise
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 def getTimeInterval(self):
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 timeInterval = self.ippSeconds * self.nCohInt * self.nIncohInt
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 return timeInterval
ReceiverData Operation, test PlotData
r889
George Yong
Multiprocessing for heispectra (Fits) all working
r1191 def get_ippSeconds(self):
'''
'''
return self.ipp_sec
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 datatime = property(getDatatime, "I'm the 'datatime' property")
nHeights = property(getNHeights, "I'm the 'nHeights' property.")
nChannels = property(getNChannels, "I'm the 'nChannel' property.")
José Chávez
formatting, template actualizado, decimation a 300
r1092 channelIndexList = property(
getChannelIndexList, "I'm the 'channelIndexList' property.")
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 noise = property(getNoise, "I'm the 'nHeights' property.")
ReceiverData Operation, test PlotData
r889
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ltctime = property(getltctime, "I'm the 'ltctime' property")
Miguel Valdez
JRODATA: timeInterval is a property now
r526 timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property")
George Yong
Multiprocessing for heispectra (Fits) all working
r1191 ippSeconds = property(get_ippSeconds, '')
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 class Correlation(JROData):
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 noise = None
SNR = None
#--------------------------------------------------
Julio Valdez
-Corrections to Vmax calculation...
r850 mode = None
split = False
data_cf = None
lags = None
lagRange = None
Julio Valdez
Processing Modules added:...
r502 pairsList = None
Julio Valdez
-Corrections to Vmax calculation...
r850 normFactor = None
#--------------------------------------------------
# calculateVelocity = None
nLags = None
nPairs = None
nAvg = None
Julio Valdez
Processing Modules added:...
r502 def __init__(self):
'''
Constructor
'''
self.radarControllerHeaderObj = RadarControllerHeader()
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.systemHeaderObj = SystemHeader()
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.type = "Correlation"
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.data = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.dtype = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.nProfiles = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.heightList = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.channelList = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.flagNoData = True
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.flagDiscontinuousBlock = False
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.utctime = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.timeZone = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.dstFlag = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.errorCount = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.blocksize = None
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 self.flagDecodeData = False # asumo q la data no esta decodificada
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 self.flagDeflipData = False # asumo q la data no esta sin flip
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.pairsList = None
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.nPoints = None
Julio Valdez
-Corrections to Vmax calculation...
r850
Julio Valdez
Processing Modules added:...
r502 def getPairsList(self):
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 return self.pairsList
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 def getNoise(self, mode=2):
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 indR = numpy.where(self.lagR == 0)[0][0]
indT = numpy.where(self.lagT == 0)[0][0]
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 jspectra0 = self.data_corr[:, :, indR, :]
Julio Valdez
Processing Modules added:...
r502 jspectra = copy.copy(jspectra0)
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 num_chan = jspectra.shape[0]
num_hei = jspectra.shape[2]
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 freq_dc = jspectra.shape[1] / 2
ind_vel = numpy.array([-2, -1, 1, 2]) + freq_dc
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 if ind_vel[0] < 0:
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 ind_vel[list(range(0, 1))] = ind_vel[list(
range(0, 1))] + self.num_prof
ReceiverData Operation, test PlotData
r889
if mode == 1:
José Chávez
formatting, template actualizado, decimation a 300
r1092 jspectra[:, freq_dc, :] = (
jspectra[:, ind_vel[1], :] + jspectra[:, ind_vel[2], :]) / 2 # CORRECCION
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 if mode == 2:
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 vel = numpy.array([-2, -1, 1, 2])
xx = numpy.zeros([4, 4])
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 for fil in range(4):
George Yong
Python 2to3, Spectra (all operations) working
r1167 xx[fil, :] = vel[fil]**numpy.asarray(list(range(4)))
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 xx_inv = numpy.linalg.inv(xx)
José Chávez
formatting, template actualizado, decimation a 300
r1092 xx_aux = xx_inv[0, :]
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 for ich in range(num_chan):
José Chávez
formatting, template actualizado, decimation a 300
r1092 yy = jspectra[ich, ind_vel, :]
jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy)
Julio Valdez
Processing Modules added:...
r502
José Chávez
formatting, template actualizado, decimation a 300
r1092 junkid = jspectra[ich, freq_dc, :] <= 0
Julio Valdez
Processing Modules added:...
r502 cjunkid = sum(junkid)
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 if cjunkid.any():
José Chávez
formatting, template actualizado, decimation a 300
r1092 jspectra[ich, freq_dc, junkid.nonzero()] = (
jspectra[ich, ind_vel[1], junkid] + jspectra[ich, ind_vel[2], junkid]) / 2
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 noise = jspectra0[:, freq_dc, :] - jspectra[:, freq_dc, :]
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 return noise
Miguel Valdez
Signal Chain GUI updated:...
r587
def getTimeInterval(self):
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 timeInterval = self.ippSeconds * self.nCohInt * self.nProfiles
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 return timeInterval
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 def splitFunctions(self):
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 pairsList = self.pairsList
ccf_pairs = []
acf_pairs = []
ccf_ind = []
acf_ind = []
ReceiverData Operation, test PlotData
r889 for l in range(len(pairsList)):
Julio Valdez
-Corrections to Vmax calculation...
r850 chan0 = pairsList[l][0]
chan1 = pairsList[l][1]
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 # Obteniendo pares de Autocorrelacion
Julio Valdez
-Corrections to Vmax calculation...
r850 if chan0 == chan1:
acf_pairs.append(chan0)
acf_ind.append(l)
else:
ccf_pairs.append(pairsList[l])
ccf_ind.append(l)
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 data_acf = self.data_cf[acf_ind]
data_ccf = self.data_cf[ccf_ind]
return acf_ind, ccf_ind, acf_pairs, ccf_pairs, data_acf, data_ccf
def getNormFactor(self):
acf_ind, ccf_ind, acf_pairs, ccf_pairs, data_acf, data_ccf = self.splitFunctions()
acf_pairs = numpy.array(acf_pairs)
José Chávez
formatting, template actualizado, decimation a 300
r1092 normFactor = numpy.zeros((self.nPairs, self.nHeights))
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 for p in range(self.nPairs):
pair = self.pairsList[p]
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 ch0 = pair[0]
ch1 = pair[1]
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092 ch0_max = numpy.max(data_acf[acf_pairs == ch0, :, :], axis=1)
ch1_max = numpy.max(data_acf[acf_pairs == ch1, :, :], axis=1)
normFactor[p, :] = numpy.sqrt(ch0_max * ch1_max)
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Corrections to Vmax calculation...
r850 return normFactor
ReceiverData Operation, test PlotData
r889
Miguel Valdez
Signal Chain GUI updated:...
r587 timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property")
Julio Valdez
-Corrections to Vmax calculation...
r850 normFactor = property(getNormFactor, "I'm the 'normFactor property'")
ReceiverData Operation, test PlotData
r889
José Chávez
formatting, template actualizado, decimation a 300
r1092
Fix all PlotData, add SpectraMean, CrossSpectra plots, now Parameters extends Spectra fix bugs in ParametersProc
r922 class Parameters(Spectra):
Julio Valdez
Processing Modules added:...
r502
José Chávez
formatting, template actualizado, decimation a 300
r1092 experimentInfo = None # Information about the experiment
# Information from previous data
inputUnit = None # Type of data to be processed
operation = None # Type of operation to parametrize
# normFactor = None #Normalization Factor
groupList = None # List of Pairs, Groups, etc
# Parameters
data_param = None # Parameters obtained
data_pre = None # Data Pre Parametrization
data_SNR = None # Signal to Noise Ratio
Julio Valdez
data...
r608 # heightRange = None #Heights
José Chávez
formatting, template actualizado, decimation a 300
r1092 abscissaList = None # Abscissa, can be velocities, lags or time
Add WindProfiler support, multiSchain by_day
r923 # noise = None #Noise Potency
José Chávez
formatting, template actualizado, decimation a 300
r1092 utctimeInit = None # Initial UTC time
paramInterval = None # Time interval to calculate Parameters in seconds
Julio Valdez
Changes in data Parameters
r802 useLocalTime = True
José Chávez
formatting, template actualizado, decimation a 300
r1092 # Fitting
data_error = None # Error of the estimation
ReceiverData Operation, test PlotData
r889 constants = None
Julio Valdez
First Spectral Fitting and EW Drifts operative module inside Signal Chain TRUNK
r513 library = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 # Output signal
outputInterval = None # Time interval to calculate output signal in seconds
data_output = None # Out signal
Julio Valdez
-Corrections to Vmax calculation...
r850 nAvg = None
Fix all PlotData, add SpectraMean, CrossSpectra plots, now Parameters extends Spectra fix bugs in ParametersProc
r922 noise_estimation = None
José Chávez
formatting, template actualizado, decimation a 300
r1092 GauSPC = None # Fit gaussian SPC
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 def __init__(self):
'''
Constructor
'''
self.radarControllerHeaderObj = RadarControllerHeader()
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.systemHeaderObj = SystemHeader()
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 self.type = "Parameters"
ReceiverData Operation, test PlotData
r889
Julio Valdez
-Functional HDF5 Format Writing and Reading Unit...
r804 def getTimeRange1(self, interval):
ReceiverData Operation, test PlotData
r889
Julio Valdez
Processing Modules added:...
r502 datatime = []
ReceiverData Operation, test PlotData
r889
Julio Valdez
data...
r608 if self.useLocalTime:
José Chávez
formatting, template actualizado, decimation a 300
r1092 time1 = self.utctimeInit - self.timeZone * 60
Julio Valdez
data...
r608 else:
Julio Valdez
Changes in data Parameters
r802 time1 = self.utctimeInit
ReceiverData Operation, test PlotData
r889
Julio Valdez
data...
r608 datatime.append(time1)
Julio Valdez
-Functional HDF5 Format Writing and Reading Unit...
r804 datatime.append(time1 + interval)
Julio Valdez
Processing Modules added:...
r502 datatime = numpy.array(datatime)
ReceiverData Operation, test PlotData
r889
Fix all PlotData, add SpectraMean, CrossSpectra plots, now Parameters extends Spectra fix bugs in ParametersProc
r922 return datatime
Add WindProfiler support, multiSchain by_day
r923
def getTimeInterval(self):
Juan C. Espinoza
Add SkyMapPlotData, operation can access parent kwargs, fix server plot for multiple ReceiverData
r937 if hasattr(self, 'timeInterval1'):
return self.timeInterval1
else:
return self.paramInterval
Juan C. Espinoza
Fix timeInterval for Parameters
r928
ebocanegra
15/08/2017
r1001 def setValue(self, value):
George Yong
Python 2to3, Spectra (all operations) working
r1167 print("This property should not be initialized")
ebocanegra
15/08/2017
r1001
return
Juan C. Espinoza
Fix timeInterval for Parameters
r928 def getNoise(self):
return self.spc_noise
timeInterval = property(getTimeInterval)
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 noise = property(getNoise, setValue, "I'm the 'Noise' property.")
class PlotterData(object):
'''
Object to hold data to be plotted
'''
MAXNUMX = 100
MAXNUMY = 100
Juan C. Espinoza
Fix LT issue in plots add snr option in jrodata
r1219 def __init__(self, code, throttle_value, exp_code, buffering=True, snr=False):
George Yong
Fix bug in CrossSpectraPlot
r1201
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.throttle = throttle_value
self.exp_code = exp_code
self.buffering = buffering
self.ready = False
self.localtime = False
self.data = {}
self.meta = {}
self.__times = []
self.__heights = []
if 'snr' in code:
self.plottypes = ['snr']
elif code == 'spc':
self.plottypes = ['spc', 'noise', 'rti']
elif code == 'rti':
self.plottypes = ['noise', 'rti']
else:
self.plottypes = [code]
Juan C. Espinoza
Fix LT issue in plots add snr option in jrodata
r1219
if 'snr' not in self.plottypes and snr:
self.plottypes.append('snr')
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 for plot in self.plottypes:
self.data[plot] = {}
def __str__(self):
dum = ['{}{}'.format(key, self.shape(key)) for key in self.data]
return 'Data[{}][{}]'.format(';'.join(dum), len(self.__times))
def __len__(self):
return len(self.__times)
def __getitem__(self, key):
George Yong
Add ScopePlot to the new way of plotting data (jroplot_data)
r1202
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 if key not in self.data:
raise KeyError(log.error('Missing key: {}'.format(key)))
if 'spc' in key or not self.buffering:
ret = self.data[key]
George Yong
Add ScopePlot to the new way of plotting data (jroplot_data)
r1202 elif 'scope' in key:
ret = numpy.array(self.data[key][float(self.tm)])
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 else:
ret = numpy.array([self.data[key][x] for x in self.times])
if ret.ndim > 1:
ret = numpy.swapaxes(ret, 0, 1)
return ret
def __contains__(self, key):
return key in self.data
def setup(self):
'''
Configure object
'''
self.type = ''
self.ready = False
self.data = {}
self.__times = []
self.__heights = []
self.__all_heights = set()
for plot in self.plottypes:
if 'snr' in plot:
plot = 'snr'
Juan C. Espinoza
Fix SpectralMoments Plot
r1207 elif 'spc_moments' == plot:
plot = 'moments'
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.data[plot] = {}
Juan C. Espinoza
Fix SpectralMoments Plot
r1207 if 'spc' in self.data or 'rti' in self.data or 'cspc' in self.data or 'moments' in self.data:
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.data['noise'] = {}
Juan C. Espinoza
Fix BLTR spectra reader
r1211 self.data['rti'] = {}
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 if 'noise' not in self.plottypes:
self.plottypes.append('noise')
Juan C. Espinoza
Fix BLTR spectra reader
r1211 if 'rti' not in self.plottypes:
self.plottypes.append('rti')
George Yong
Fix bug in CrossSpectraPlot
r1201
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 def shape(self, key):
'''
Get the shape of the one-element data for the given key
'''
if len(self.data[key]):
if 'spc' in key or not self.buffering:
return self.data[key].shape
return self.data[key][self.__times[0]].shape
return (0,)
def update(self, dataOut, tm):
'''
Update data object with new dataOut
'''
George Yong
Fix bug in CrossSpectraPlot
r1201
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 if tm in self.__times:
return
George Yong
Add ScopePlot to the new way of plotting data (jroplot_data)
r1202 self.profileIndex = dataOut.profileIndex
self.tm = tm
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.type = dataOut.type
self.parameters = getattr(dataOut, 'parameters', [])
if hasattr(dataOut, 'pairsList'):
self.pairs = dataOut.pairsList
if hasattr(dataOut, 'meta'):
self.meta = dataOut.meta
self.channels = dataOut.channelList
self.interval = dataOut.getTimeInterval()
self.localtime = dataOut.useLocalTime
Juan C. Espinoza
Fix SpectralMoments Plot
r1207 if 'spc' in self.plottypes or 'cspc' in self.plottypes or 'spc_moments' in self.plottypes:
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.xrange = (dataOut.getFreqRange(1)/1000.,
dataOut.getAcfRange(1), dataOut.getVelRange(1))
George Yong
Fix bug in CrossSpectraPlot
r1201 self.factor = dataOut.normFactor
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.__heights.append(dataOut.heightList)
self.__all_heights.update(dataOut.heightList)
self.__times.append(tm)
George Yong
Fix bug in CrossSpectraPlot
r1201
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 for plot in self.plottypes:
Juan C. Espinoza
Fix SpectralMoments Plot
r1207 if plot in ('spc', 'spc_moments'):
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 z = dataOut.data_spc/dataOut.normFactor
buffer = 10*numpy.log10(z)
if plot == 'cspc':
George Yong
Fix bug in CrossSpectraPlot
r1201 z = dataOut.data_spc/dataOut.normFactor
buffer = (dataOut.data_spc, dataOut.data_cspc)
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 if plot == 'noise':
buffer = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor)
if plot == 'rti':
buffer = dataOut.getPower()
if plot == 'snr_db':
buffer = dataOut.data_SNR
if plot == 'snr':
buffer = 10*numpy.log10(dataOut.data_SNR)
if plot == 'dop':
buffer = 10*numpy.log10(dataOut.data_DOP)
if plot == 'mean':
buffer = dataOut.data_MEAN
if plot == 'std':
buffer = dataOut.data_STD
if plot == 'coh':
buffer = dataOut.getCoherence()
if plot == 'phase':
buffer = dataOut.getCoherence(phase=True)
if plot == 'output':
buffer = dataOut.data_output
if plot == 'param':
buffer = dataOut.data_param
George Yong
Add ScopePlot to the new way of plotting data (jroplot_data)
r1202 if plot == 'scope':
buffer = dataOut.data
self.flagDataAsBlock = dataOut.flagDataAsBlock
self.nProfiles = dataOut.nProfiles
George Yong
Fix bug in CrossSpectraPlot
r1201 if plot == 'spc':
Juan C. Espinoza
Fix BLTR spectra reader
r1211 self.data['spc'] = buffer
George Yong
Fix bug in CrossSpectraPlot
r1201 elif plot == 'cspc':
self.data['spc'] = buffer[0]
self.data['cspc'] = buffer[1]
Juan C. Espinoza
Fix SpectralMoments Plot
r1207 elif plot == 'spc_moments':
self.data['spc'] = buffer
self.data['moments'][tm] = dataOut.moments
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 else:
if self.buffering:
self.data[plot][tm] = buffer
else:
self.data[plot] = buffer
def normalize_heights(self):
'''
Ensure same-dimension of the data for different heighList
'''
H = numpy.array(list(self.__all_heights))
H.sort()
for key in self.data:
shape = self.shape(key)[:-1] + H.shape
for tm, obj in list(self.data[key].items()):
h = self.__heights[self.__times.index(tm)]
if H.size == h.size:
continue
index = numpy.where(numpy.in1d(H, h))[0]
dummy = numpy.zeros(shape) + numpy.nan
if len(shape) == 2:
dummy[:, index] = obj
else:
dummy[index] = obj
self.data[key][tm] = dummy
self.__heights = [H for tm in self.__times]
def jsonify(self, decimate=False):
'''
Convert data to json
'''
data = {}
tm = self.times[-1]
dy = int(self.heights.size/self.MAXNUMY) + 1
for key in self.data:
if key in ('spc', 'cspc') or not self.buffering:
dx = int(self.data[key].shape[1]/self.MAXNUMX) + 1
data[key] = self.roundFloats(
self.data[key][::, ::dx, ::dy].tolist())
else:
data[key] = self.roundFloats(self.data[key][tm].tolist())
ret = {'data': data}
ret['exp_code'] = self.exp_code
ret['time'] = float(tm)
ret['interval'] = float(self.interval)
ret['localtime'] = self.localtime
ret['yrange'] = self.roundFloats(self.heights[::dy].tolist())
if 'spc' in self.data or 'cspc' in self.data:
ret['xrange'] = self.roundFloats(self.xrange[2][::dx].tolist())
else:
ret['xrange'] = []
if hasattr(self, 'pairs'):
ret['pairs'] = [(int(p[0]), int(p[1])) for p in self.pairs]
else:
ret['pairs'] = []
for key, value in list(self.meta.items()):
ret[key] = value
return json.dumps(ret)
@property
def times(self):
'''
Return the list of times of the current data
'''
ret = numpy.array(self.__times)
ret.sort()
return ret
@property
def min_time(self):
'''
Return the minimun time value
'''
return self.times[0]
@property
def max_time(self):
'''
Return the maximun time value
'''
return self.times[-1]
@property
def heights(self):
'''
Return the list of heights of the current data
'''
return numpy.array(self.__heights[-1])
@staticmethod
def roundFloats(obj):
if isinstance(obj, list):
return list(map(PlotterData.roundFloats, obj))
elif isinstance(obj, float):
return round(obj, 2)