##// END OF EJS Templates
Operando clean Rayleigh con crossSpectra
Operando clean Rayleigh con crossSpectra

File last commit:

r1387:8b6109d4fb6e
r1392:e987b2f0c1da
Show More
jrodata.py
1074 lines | 28.9 KiB | text/x-python | PythonLexer
Add metadata attribute to data types
r1338 # Copyright (c) 2012-2020 Jicamarca Radio Observatory
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
"""Definition of diferent Data objects for different types of data
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
Add metadata attribute to data types
r1338 Here you will find the diferent data objects for the different types
of data, this data objects must be used as dataIn or dataOut objects in
processing units and operations. Currently the supported data objects are:
Voltage, Spectra, SpectraHeis, Fits, Correlation and Parameters
"""
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
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
Update and fix plot modules #TODO: correlation & spectraheis
r1285 import schainpy.admin
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. Espinoza
Update noise C extension to properly work with python 3
r1286 from schainpy.model.data import _noise
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)
Juan C. Espinoza
Update noise C extension to properly work with python 3
r1286 '''
George Yong
Multiprocessing for writing Units(Spectral, Voltage and Parameters)
r1179 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
Juan C. Espinoza
Update noise C extension to properly work with python 3
r1286 '''
return _noise.hildebrand_sekhon(sortdata, navg)
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
Guardado de datos azimuth y elevacion de amisr en hdf5, modificaciones a proc_spectra, proc_param y jrodata
r1387
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
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 def isReady(self):
José Chávez
formatting, template actualizado, decimation a 300
r1092
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 return not 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):
systemHeaderObj = SystemHeader()
radarControllerHeaderObj = RadarControllerHeader()
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 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
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
nCohInt = None
windowOfFilter = 1
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
Add metadata attribute to data types
r1338 metadata_list = ['heightList', 'timeZone', 'type']
Guardado de datos azimuth y elevacion de amisr en hdf5, modificaciones a proc_spectra, proc_param y jrodata
r1387 codeList = None
azimuthList = None
elevationList = None
Juan C. Espinoza
Remove C extension
r1176
def __str__(self):
Add metadata attribute to data types
r1338 return '{} - {}'.format(self.type, self.datatime())
Juan C. Espinoza
Remove C extension
r1176
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
Add metadata attribute to data types
r1338 @property
def nChannels(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
Add metadata attribute to data types
r1338 @property
def channelIndexList(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
Add metadata attribute to data types
r1338 @property
def nHeights(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
Miguel Valdez
Bug fixed: Fmax should not be divided by 2.
r765 def getDeltaH(self):
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 return self.heightList[1] - self.heightList[0]
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
def ltctime(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
Add metadata attribute to data types
r1338 @property
def datatime(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
Add metadata attribute to data types
r1338 @property
def ippSeconds(self):
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.radarControllerHeaderObj.ippSeconds
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @ippSeconds.setter
def ippSeconds(self, ippSeconds):
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
Add metadata attribute to data types
r1338 @property
def code(self):
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 '''
'''
Add metadata attribute to data types
r1338 return self.radarControllerHeaderObj.code
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @code.setter
def code(self, code):
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 '''
'''
Add metadata attribute to data types
r1338 self.radarControllerHeaderObj.code = code
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
Bug in jrodata ncode nbaud
r1340 def nCode(self):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 return self.radarControllerHeaderObj.nCode
ReceiverData Operation, test PlotData
r889
Bug in jrodata ncode nbaud
r1340 @nCode.setter
def nCode(self, ncode):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 self.radarControllerHeaderObj.nCode = ncode
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568
Add metadata attribute to data types
r1338 @property
Bug in jrodata ncode nbaud
r1340 def nBaud(self):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 return self.radarControllerHeaderObj.nBaud
ReceiverData Operation, test PlotData
r889
Bug in jrodata ncode nbaud
r1340 @nBaud.setter
def nBaud(self, nbaud):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 self.radarControllerHeaderObj.nBaud = nbaud
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
def ipp(self):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 return self.radarControllerHeaderObj.ipp
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @ipp.setter
def ipp(self, ipp):
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 '''
'''
Add metadata attribute to data types
r1338 self.radarControllerHeaderObj.ipp = ipp
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
def metadata(self):
'''
'''
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 return {attr: getattr(self, attr) for attr in self.metadata_list}
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
modificacion de atributos pulsepair y ploteo
r1315 dataPP_POW = None
dataPP_DOP = None
dataPP_WIDTH = None
dataPP_SNR = 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.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.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
Juan C. Espinoza
Rewrite Param reader/writer as HDF reader/writer
r1326 self.timeZone = 0
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.dstFlag = None
self.errorCount = None
self.nCohInt = None
self.blocksize = None
Juan C. Espinoza
Fix ScpecraWriter and CohInt attribute
r1310 self.flagCohInt = False
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
merged branches
r1370 self.metadata_list = ['type', 'heightList', 'timeZone', 'nProfiles', 'channelList', 'nCohInt',
Bug in jrodata ncode nbaud
r1340 'code', 'nCode', 'nBaud', 'ippSeconds', 'ipp']
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
Add metadata attribute to data types
r1338 @property
def timeInterval(self):
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 return self.ippSeconds * self.nCohInt
ReceiverData Operation, test PlotData
r889
Miguel Valdez
JRODATA: timeInterval is a property now
r526 noise = property(getNoise, "I'm the 'nHeights' 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
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
Fix bug in noise estimation
r1364 self.data_dc = None
self.data_spc = None
self.data_cspc = None
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"
Juan C. Espinoza
Rewrite Param reader/writer as HDF reader/writer
r1326 self.timeZone = 0
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
self.heightList = None
self.channelList = 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.beacon_heiIndexList = []
self.noise_estimation = None
merged branches
r1370 self.metadata_list = ['type', 'heightList', 'timeZone', 'pairsList', 'channelList', 'nCohInt',
Bug in jrodata ncode nbaud
r1340 'code', 'nCode', 'nBaud', 'ippSeconds', 'ipp','nIncohInt', 'nFFTPoints', 'nProfiles']
ReceiverData Operation, test PlotData
r889
Guardado de datos azimuth y elevacion de amisr en hdf5, modificaciones a proc_spectra, proc_param y jrodata
r1387
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)
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 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.)
Modificación a kmamisr para ejecutarse en la versión 3, creación de scripts con terminación v3 para difereciarlos, se comentó la linea #720 de JroIO_param.py debido a que reiniciaba la lista de archivos, ocasionando la reescritura del archivo hdf5. Alguna otra modificación aparente es producto de algunas variaciones en espacios al usar la función print()
r1279
Juan C. Espinoza
Merge with Claire_proc
r1188 if self.nmodes:
return velrange/self.nmodes
else:
return velrange
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
def nPairs(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
Add metadata attribute to data types
r1338 @property
def pairsIndexList(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
Add metadata attribute to data types
r1338 @property
def normFactor(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
Add metadata attribute to data types
r1338 @property
def flag_cspc(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
Add metadata attribute to data types
r1338 @property
def flag_dc(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
Add metadata attribute to data types
r1338 @property
def timeInterval(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 noise = property(getNoise, setValue, "I'm the 'nHeights' property.")
José Chávez
formatting, template actualizado, decimation a 300
r1092
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 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()
self.systemHeaderObj = SystemHeader()
self.type = "SpectraHeis"
self.nProfiles = None
self.heightList = None
self.channelList = 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.blocksize = None
Miguel Valdez
Affected:...
r534 self.profileIndex = 0
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nCohInt = 1
self.nIncohInt = 1
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 @property
def normFactor(self):
Daniel Valdez
The Spectra-1d Plot shows the normalized power.
r496 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
Add metadata attribute to data types
r1338 @property
def timeInterval(self):
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 return self.ippSeconds * self.nCohInt * self.nIncohInt
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 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"
self.nProfiles = None
self.heightList = None
self.channelList = None
self.flagNoData = True
self.utctime = None
Miguel Valdez
Signal Chain GUI updated:...
r587 self.nCohInt = 1
self.nIncohInt = 1
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
Miguel Valdez
Affected:...
r534 self.profileIndex = 0
Juan C. Espinoza
Rewrite Param reader/writer as HDF reader/writer
r1326 self.timeZone = 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 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 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
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
Add metadata attribute to data types
r1338 @property
def timeInterval(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
Add metadata attribute to data types
r1338 @property
def ippSeconds(self):
George Yong
Multiprocessing for heispectra (Fits) all working
r1191 '''
'''
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 noise = property(getNoise, "I'm the 'nHeights' property.")
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 def __init__(self):
'''
Constructor
'''
self.radarControllerHeaderObj = RadarControllerHeader()
self.systemHeaderObj = SystemHeader()
self.type = "Correlation"
self.data = None
self.dtype = None
self.nProfiles = None
self.heightList = None
self.channelList = None
self.flagNoData = True
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.flagDiscontinuousBlock = False
Julio Valdez
Processing Modules added:...
r502 self.utctime = None
Juan C. Espinoza
Rewrite Param reader/writer as HDF reader/writer
r1326 self.timeZone = 0
Julio Valdez
Processing Modules added:...
r502 self.dstFlag = None
self.errorCount = 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
Julio Valdez
Processing Modules added:...
r502 self.pairsList = None
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
Add metadata attribute to data types
r1338 @property
def timeInterval(self):
ReceiverData Operation, test PlotData
r889
Add metadata attribute to data types
r1338 return self.ippSeconds * self.nCohInt * self.nProfiles
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
Add metadata attribute to data types
r1338 @property
def normFactor(self):
Julio Valdez
-Corrections to Vmax calculation...
r850 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
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 groupList = None # List of Pairs, Groups, etc
data_param = None # Parameters obtained
data_pre = None # Data Pre Parametrization
data_SNR = None # Signal to Noise Ratio
abscissaList = None # Abscissa, can be velocities, lags or time
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()
self.systemHeaderObj = SystemHeader()
self.type = "Parameters"
Juan C. Espinoza
Rewrite Param reader/writer as HDF reader/writer
r1326 self.timeZone = 0
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
Add metadata attribute to data types
r1338 @property
def timeInterval(self):
Add WindProfiler support, multiSchain by_day
r923
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
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
'''
Juan C. Espinoza
Fix sending data to server in plots
r1299 MAXNUMX = 200
MAXNUMY = 200
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
Add update method to plots to pass data (no more changes in jrodata)
r1343 def __init__(self, code, exp_code, localtime=True):
Modificación a kmamisr para ejecutarse en la versión 3, creación de scripts con terminación v3 para difereciarlos, se comentó la linea #720 de JroIO_param.py debido a que reiniciaba la lista de archivos, ocasionando la reescritura del archivo hdf5. Alguna otra modificación aparente es producto de algunas variaciones en espacios al usar la función print()
r1279
Juan C. Espinoza
Update plots for realtime app
r1221 self.key = code
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.exp_code = exp_code
self.ready = False
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 self.flagNoData = False
Juan C. Espinoza
Correct localtime in plots, handle exception in send_to_server
r1327 self.localtime = localtime
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.data = {}
self.meta = {}
self.__heights = []
def __str__(self):
dum = ['{}{}'.format(key, self.shape(key)) for key in self.data]
Juan C. Espinoza
Update plots modules
r1308 return 'Data[{}][{}]'.format(';'.join(dum), len(self.times))
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
def __len__(self):
Add update method to plots to pass data (no more changes in jrodata)
r1343 return len(self.data)
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
def __getitem__(self, key):
Add update method to plots to pass data (no more changes in jrodata)
r1343 if isinstance(key, int):
return self.data[self.times[key]]
elif isinstance(key, str):
ret = numpy.array([self.data[x][key] for x in self.times])
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 if ret.ndim > 1:
ret = numpy.swapaxes(ret, 0, 1)
Add update method to plots to pass data (no more changes in jrodata)
r1343 return ret
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
def __contains__(self, key):
Add update method to plots to pass data (no more changes in jrodata)
r1343 return key in self.data[self.min_time]
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
def setup(self):
'''
Configure object
'''
self.type = ''
self.ready = False
Juan C. Espinoza
Update plots modules
r1308 del self.data
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 self.data = {}
self.__heights = []
self.__all_heights = set()
Modificación a kmamisr para ejecutarse en la versión 3, creación de scripts con terminación v3 para difereciarlos, se comentó la linea #720 de JroIO_param.py debido a que reiniciaba la lista de archivos, ocasionando la reescritura del archivo hdf5. Alguna otra modificación aparente es producto de algunas variaciones en espacios al usar la función print()
r1279
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
'''
Add update method to plots to pass data (no more changes in jrodata)
r1343 if len(self.data[self.min_time][key]):
return self.data[self.min_time][key].shape
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 return (0,)
Add update method to plots to pass data (no more changes in jrodata)
r1343 def update(self, data, tm, meta={}):
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 '''
Update data object with new dataOut
'''
Modificación a kmamisr para ejecutarse en la versión 3, creación de scripts con terminación v3 para difereciarlos, se comentó la linea #720 de JroIO_param.py debido a que reiniciaba la lista de archivos, ocasionando la reescritura del archivo hdf5. Alguna otra modificación aparente es producto de algunas variaciones en espacios al usar la función print()
r1279
Add update method to plots to pass data (no more changes in jrodata)
r1343 self.data[tm] = data
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
Add update method to plots to pass data (no more changes in jrodata)
r1343 for key, value in meta.items():
setattr(self, key, value)
Juan C. Espinoza
Update plot for moments pow, dop, width, snr
r1229
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 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()):
Juan C. Espinoza
Fix ParametersPlot & BLTRParamReader
r1322 h = self.__heights[self.times.tolist().index(tm)]
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 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
Juan C. Espinoza
Update plots modules
r1308 self.__heights = [H for tm in self.times]
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
Juan C. Espinoza
Update plots modules
r1308 def jsonify(self, tm, plot_name, plot_type, decimate=False):
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 '''
Convert data to json
'''
Add update method to plots to pass data (no more changes in jrodata)
r1343 meta = {}
meta['xrange'] = []
dy = int(len(self.yrange)/self.MAXNUMY) + 1
tmp = self.data[tm][self.key]
shape = tmp.shape
if len(shape) == 2:
data = self.roundFloats(self.data[tm][self.key][::, ::dy].tolist())
elif len(shape) == 3:
dx = int(self.data[tm][self.key].shape[1]/self.MAXNUMX) + 1
Juan C. Espinoza
Update plots for realtime app
r1221 data = self.roundFloats(
Add update method to plots to pass data (no more changes in jrodata)
r1343 self.data[tm][self.key][::, ::dx, ::dy].tolist())
meta['xrange'] = self.roundFloats(self.xrange[2][::dx].tolist())
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 else:
Add update method to plots to pass data (no more changes in jrodata)
r1343 data = self.roundFloats(self.data[tm][self.key].tolist())
Juan C. Espinoza
Update plots for realtime app
r1221
ret = {
'plot': plot_name,
'code': self.exp_code,
'time': float(tm),
'data': data,
}
meta['type'] = plot_type
meta['interval'] = float(self.interval)
meta['localtime'] = self.localtime
Add update method to plots to pass data (no more changes in jrodata)
r1343 meta['yrange'] = self.roundFloats(self.yrange[::dy].tolist())
Modificación a kmamisr para ejecutarse en la versión 3, creación de scripts con terminación v3 para difereciarlos, se comentó la linea #720 de JroIO_param.py debido a que reiniciaba la lista de archivos, ocasionando la reescritura del archivo hdf5. Alguna otra modificación aparente es producto de algunas variaciones en espacios al usar la función print()
r1279 meta.update(self.meta)
Juan C. Espinoza
Update plots for realtime app
r1221 ret['metadata'] = meta
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 return json.dumps(ret)
@property
def times(self):
'''
Return the list of times of the current data
'''
Add update method to plots to pass data (no more changes in jrodata)
r1343 ret = [t for t in self.data]
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187 ret.sort()
Add update method to plots to pass data (no more changes in jrodata)
r1343 return numpy.array(ret)
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
@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]
Add update method to plots to pass data (no more changes in jrodata)
r1343 # @property
# def heights(self):
# '''
# Return the list of heights of the current data
# '''
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
Add update method to plots to pass data (no more changes in jrodata)
r1343 # return numpy.array(self.__heights[-1])
Juan C. Espinoza
New plotting architecture with buffering/throttle capabilities
r1187
@staticmethod
def roundFloats(obj):
if isinstance(obj, list):
return list(map(PlotterData.roundFloats, obj))
elif isinstance(obj, float):
return round(obj, 2)