##// END OF EJS Templates
changes to integrate AMISR Reader with Voltage and Spectra Objs
changes to integrate AMISR Reader with Voltage and Spectra Objs

File last commit:

r475:b9af3aa878ca
r475:b9af3aa878ca
Show More
jroplot.py
2117 lines | 74.4 KiB | text/x-python | PythonLexer
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 import numpy
Daniel Valdez
Envio de graficos por FTP:...
r283 import time, datetime, os
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 from graphics.figure import *
Daniel Valdez
Se agrega a JROData el flag realtime, para este caso se da prioridad al procesamiento de datos. Los graficos se generan solo cuando el tiempo de procesamiento es cercano al tiempo de adquisición.
r360 def isRealtime(utcdatatime):
Daniel Valdez
se corrige bug en el metodo isRealTime de jroplot.py para estimar el tiempo de diferencia entre el tiempo de adquisicion y procesamiento
r407 utcnow = time.mktime(time.localtime())
delta = abs(utcnow - utcdatatime) # abs
Daniel Valdez
Optimizacion de Salvado de Spectros...
r404 if delta >= 30.:
Daniel Valdez
Se agrega a JROData el flag realtime, para este caso se da prioridad al procesamiento de datos. Los graficos se generan solo cuando el tiempo de procesamiento es cercano al tiempo de adquisición.
r360 return False
return True
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 class CrossSpectraPlot(Figure):
__isConfig = None
__nsubplots = None
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 WIDTH = None
HEIGHT = None
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 WIDTHPROF = None
HEIGHTPROF = None
Miguel Valdez
Se restrige el numero de pares a graficar en Cross-Spectra....
r228 PREFIX = 'cspc'
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
def __init__(self):
self.__isConfig = False
self.__nsubplots = 4
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 self.counter_imagwr = 0
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 self.WIDTH = 250
self.HEIGHT = 250
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 self.WIDTHPROF = 0
self.HEIGHTPROF = 0
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.PLOT_CODE = 1
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 def getSubplots(self):
ncol = 4
nrow = self.nplots
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 1
colspan = 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT + self.HEIGHTPROF,
show=True)
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
nrow, ncol = self.getSubplots()
counter = 0
for y in range(nrow):
for x in range(ncol):
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
counter += 1
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 def run(self, dataOut, id, wintitle="", pairsList=None,
Daniel Valdez
vuelta a una version anterior
r278 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 save=False, figpath='./', figfile=None, ftp=False, wr_period=1,
power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True,
server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
"""
Input:
dataOut :
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id :
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
if pairsList == None:
pairsIndexList = dataOut.pairsIndexList
else:
pairsIndexList = []
for pair in pairsList:
if pair not in dataOut.pairsList:
raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair)
pairsIndexList.append(dataOut.pairsList.index(pair))
Miguel Valdez
Bugs fixed: Eliminacion de numpy.abs() en el calculo de las cross-correlaciones y mejoras en los graficos de CrossSpectra
r227 if pairsIndexList == []:
Miguel Valdez
Busqueda de archivos dentro del directorio indicado (sin busqueda de subdirectorios) activando el flag de lectura 'walk'
r224 return
Miguel Valdez
Se restrige el numero de pares a graficar en Cross-Spectra....
r228 if len(pairsIndexList) > 4:
pairsIndexList = pairsIndexList[0:4]
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 factor = dataOut.normFactor
Miguel Valdez
jroplot:...
r237 x = dataOut.getVelRange(1)
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 y = dataOut.getHeiRange()
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 z = dataOut.data_spc[:,:,:]/factor
Daniel Valdez
actualizacion para calculo de fase
r281 # z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
avg = numpy.abs(numpy.average(z, axis=1))
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 noise = dataOut.getNoise()/factor
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245
zdB = 10*numpy.log10(z)
avgdB = 10*numpy.log10(avg)
noisedB = 10*numpy.log10(noise)
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " Cross-Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 xlabel = "Velocity (m/s)"
ylabel = "Range (Km)"
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 if not self.__isConfig:
nplots = len(pairsIndexList)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 showprofile=False,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 show=show)
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
if xmin == None: xmin = numpy.nanmin(x)
if xmax == None: xmax = numpy.nanmax(x)
if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 if zmin == None: zmin = numpy.nanmin(avgdB)*0.9
if zmax == None: zmax = numpy.nanmax(avgdB)*0.9
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 self.__isConfig = True
self.setWinTitle(title)
for i in range(self.nplots):
pair = dataOut.pairsList[pairsIndexList[i]]
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
title = "Ch%d: %4.2fdB: %s" %(pair[0], noisedB[pair[0]], str_datetime)
Daniel Valdez
jrodata.py: el atributo ippFactor se inicia en 1...
r448 zdB = 10.*numpy.log10(dataOut.data_spc[pair[0],:,:])
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 axes0 = self.axesList[i*self.__nsubplots]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 axes0.pcolor(x, y, zdB,
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, colormap=power_cmap, cblabel='')
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 title = "Ch%d: %4.2fdB: %s" %(pair[1], noisedB[pair[1]], str_datetime)
Daniel Valdez
jrodata.py: el atributo ippFactor se inicia en 1...
r448 zdB = 10.*numpy.log10(dataOut.data_spc[pair[1],:,:])
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 axes0 = self.axesList[i*self.__nsubplots+1]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 axes0.pcolor(x, y, zdB,
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, colormap=power_cmap, cblabel='')
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[pair[0],:,:]*dataOut.data_spc[pair[1],:,:])
coherence = numpy.abs(coherenceComplex)
Daniel Valdez
actualizacion para calculo de fase
r281 # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
phase = numpy.arctan2(coherenceComplex.imag, coherenceComplex.real)*180/numpy.pi
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
title = "Coherence %d%d" %(pair[0], pair[1])
axes0 = self.axesList[i*self.__nsubplots+2]
axes0.pcolor(x, y, coherence,
Miguel Valdez
Bugs fixed: Eliminacion de numpy.abs() en el calculo de las cross-correlaciones y mejoras en los graficos de CrossSpectra
r227 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=0, zmax=1,
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 xlabel=xlabel, ylabel=ylabel, title=title,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, colormap=coherence_cmap, cblabel='')
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
title = "Phase %d%d" %(pair[0], pair[1])
axes0 = self.axesList[i*self.__nsubplots+3]
axes0.pcolor(x, y, phase,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=-180, zmax=180,
xlabel=xlabel, ylabel=ylabel, title=title,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, colormap=phase_cmap, cblabel='')
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
self.draw()
if save:
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 self.counter_imagwr += 1
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 if (self.counter_imagwr==wr_period):
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 if figfile == None:
str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
figfile = self.getFilename(name = str_datetime)
self.saveFigure(figpath, figfile)
if ftp:
#provisionalmente envia archivos en el formato de la web en tiempo real
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400
self.counter_imagwr = 0
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
Daniel Valdez
Nueva clase de ploteo SNRPlot
r469 class SNRPlot(Figure):
__isConfig = None
__nsubplots = None
WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'snr'
def __init__(self):
self.timerange = 2*60*60
self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 800
self.HEIGHT = 150
self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.counter_imagwr = 0
self.PLOT_CODE = 0
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
def getSubplots(self):
ncol = 1
nrow = self.nplots
return nrow, ncol
def setup(self, id, nplots, wintitle, showprofile=True, show=True):
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 7
colspan = 6
self.__nsubplots = 2
self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
heightplot = self.HEIGHT + self.HEIGHTPROF,
show=show)
nrow, ncol = self.getSubplots()
counter = 0
for y in range(nrow):
for x in range(ncol):
if counter >= self.nplots:
break
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
counter += 1
def run(self, dataOut, id, wintitle="", channelList=None, showprofile=False,
xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
timerange=None,
save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
"""
Input:
dataOut :
id :
wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
if channelList == None:
channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
channelIndexList.append(dataOut.channelList.index(channel))
if timerange != None:
self.timerange = timerange
tmin = None
tmax = None
factor = dataOut.normFactor
x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
z = dataOut.data_spc[channelIndexList,:,:]/factor
z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
avg = numpy.average(z, axis=1)
avgdB = 10.*numpy.log10(avg)
noise = dataOut.getNoise()/factor
noisedB = 10.*numpy.log10(noise)
SNR = numpy.transpose(numpy.divide(avg.T,noise))
SNR_dB = 10.*numpy.log10(SNR)
#SNR_dB = numpy.transpose(numpy.subtract(avgdB.T, noisedB))
# thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " RTI" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = ""
ylabel = "Range (Km)"
if not self.__isConfig:
nplots = len(channelIndexList)
self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
tmin, tmax = self.getTimeLim(x, xmin, xmax)
if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
if zmin == None: zmin = numpy.nanmin(avgdB)*0.9
if zmax == None: zmax = numpy.nanmax(avgdB)*0.9
self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
self.__isConfig = True
self.setWinTitle(title)
for i in range(self.nplots):
title = "Channel %d: %s" %(dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
axes = self.axesList[i*self.__nsubplots]
zdB = SNR_dB[i].reshape((1,-1))
axes.pcolorbuffer(x, y, zdB,
xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
ticksize=9, cblabel='', cbsize="1%")
# if self.__showprofile:
# axes = self.axesList[i*self.__nsubplots +1]
# axes.pline(avgdB[i], y,
# xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
# xlabel='dB', ylabel='', title='',
# ytick_visible=False,
# grid='x')
#
self.draw()
if lastone:
if dataOut.blocknow >= dataOut.last_block:
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
if (save and not(lastone)):
self.counter_imagwr += 1
if (self.counter_imagwr==wr_period):
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
if ftp:
#provisionalmente envia archivos en el formato de la web en tiempo real
name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
self.counter_imagwr = 0
if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
self.__isConfig = False
if lastone:
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
if ftp:
#provisionalmente envia archivos en el formato de la web en tiempo real
name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215
Daniel Valdez
Adicion de la clase RTIPlot
r207 class RTIPlot(Figure):
__isConfig = None
__nsubplots = None
Daniel Valdez
vuelta a una version anterior
r278
Daniel Valdez
Adicion de la clase RTIPlot
r207 WIDTHPROF = None
HEIGHTPROF = None
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 PREFIX = 'rti'
Daniel Valdez
Adicion de la clase RTIPlot
r207
def __init__(self):
Miguel Valdez
jroplot:...
r237 self.timerange = 2*60*60
Daniel Valdez
Adicion de la clase RTIPlot
r207 self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 800
Daniel Valdez
correccion de bug en el grafico de RTI, el xlabel = "velocity(m/s)"
r282 self.HEIGHT = 150
Daniel Valdez
Adicion de la clase RTIPlot
r207 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
Adicion de la clase RTIPlot
r207
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.PLOT_CODE = 0
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 self.tmin = None
self.tmax = None
self.xmin = None
self.xmax = None
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401
Daniel Valdez
Adicion de la clase RTIPlot
r207 def getSubplots(self):
ncol = 1
nrow = self.nplots
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Daniel Valdez
Adicion de la clase RTIPlot
r207
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 7
colspan = 6
self.__nsubplots = 2
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 wintitle = wintitle,
Daniel Valdez
vuelta a una version anterior
r278 widthplot = self.WIDTH + self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT + self.HEIGHTPROF,
show=show)
Daniel Valdez
Adicion de la clase RTIPlot
r207
nrow, ncol = self.getSubplots()
counter = 0
for y in range(nrow):
for x in range(ncol):
if counter >= self.nplots:
break
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
counter += 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
Daniel Valdez
vuelta a una version anterior
r278 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 timerange=None,
Daniel Valdez
se agregan variables para salvar graficos en disco para el ultimo bloque de datos o cuando se actualiza el eje x
r458 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Daniel Valdez
Adicion de la clase RTIPlot
r207
"""
Input:
dataOut :
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id :
Daniel Valdez
Adicion de la clase RTIPlot
r207 wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
if channelList == None:
channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 channelIndexList.append(dataOut.channelList.index(channel))
Daniel Valdez
Adicion de la clase RTIPlot
r207
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 if timerange != None:
Miguel Valdez
r231 self.timerange = timerange
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 #tmin = None
#tmax = None
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 factor = dataOut.normFactor
Miguel Valdez
Busqueda de archivos dentro del directorio indicado (sin busqueda de subdirectorios) activando el flag de lectura 'walk'
r224 x = dataOut.getTimeRange()
Daniel Valdez
Adicion de la clase RTIPlot
r207 y = dataOut.getHeiRange()
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 z = dataOut.data_spc[channelIndexList,:,:]/factor
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Daniel Valdez
Adicion de la clase RTIPlot
r207 avg = numpy.average(z, axis=1)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 avgdB = 10.*numpy.log10(avg)
Daniel Valdez
actualizacion para calculo de fase
r281
Miguel Valdez
r232
Daniel Valdez
Modificaciones para operacion en tiempo real: lectura de archivos, titulo de graficos, timeinterval
r389 # thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 title = wintitle + " RTI" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
Daniel Valdez
correccion de bug en el grafico de RTI, el xlabel = "velocity(m/s)"
r282 xlabel = ""
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 ylabel = "Range (Km)"
Daniel Valdez
Adicion de la clase RTIPlot
r207 if not self.__isConfig:
nplots = len(channelIndexList)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Adicion de la clase RTIPlot
r207 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 showprofile=showprofile,
show=show)
Daniel Valdez
Adicion de la clase RTIPlot
r207
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
# if timerange != None:
# self.timerange = timerange
# self.xmin, self.tmax = self.getTimeLim(x, xmin, xmax, timerange)
Daniel Valdez
Adicion de la clase RTIPlot
r207 if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 if zmin == None: zmin = numpy.nanmin(avgdB)*0.9
if zmax == None: zmax = numpy.nanmax(avgdB)*0.9
Daniel Valdez
Adicion de la clase RTIPlot
r207
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Miguel Valdez
r232 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Daniel Valdez
Adicion de la clase RTIPlot
r207 self.__isConfig = True
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234
Daniel Valdez
Adicion de la clase RTIPlot
r207
self.setWinTitle(title)
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471
if ((self.xmax - x[1]) < (x[1]-x[0])):
x[1] = self.xmax
Daniel Valdez
Adicion de la clase RTIPlot
r207 for i in range(self.nplots):
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 title = "Channel %d: %s" %(dataOut.channelList[i]+1, thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
Daniel Valdez
Adicion de la clase RTIPlot
r207 axes = self.axesList[i*self.__nsubplots]
Daniel Valdez
vuelta a una version anterior
r278 zdB = avgdB[i].reshape((1,-1))
Daniel Valdez
Optimizacion de graficos con buffer, el buffer se crea en la clase Axes del modulo figure.py, se agrega el metodo pcolorbuffer....
r318 axes.pcolorbuffer(x, y, zdB,
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
Daniel Valdez
Adicion del metodo saveFigure() para guardar archivos de imagen de la clase Figure(). Se modifica los xaxis se muestran en formato datetime, falta hacer ajustes en los ticks de acuerdo al intervalo [xmin, xmax]
r209 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
Miguel Valdez
Se adecuo el ancho del colorbar de acuerdo al tipo de grafico
r211 ticksize=9, cblabel='', cbsize="1%")
Daniel Valdez
Adicion de la clase RTIPlot
r207
if self.__showprofile:
axes = self.axesList[i*self.__nsubplots +1]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 axes.pline(avgdB[i], y,
Daniel Valdez
Adicion de la clase RTIPlot
r207 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
xlabel='dB', ylabel='', title='',
ytick_visible=False,
grid='x')
self.draw()
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 # if lastone:
# if dataOut.blocknow >= dataOut.last_block:
# if figfile == None:
# figfile = self.getFilename(name = self.name)
# self.saveFigure(figpath, figfile)
#
# if (save and not(lastone)):
#
# self.counter_imagwr += 1
# if (self.counter_imagwr==wr_period):
# if figfile == None:
# figfile = self.getFilename(name = self.name)
# self.saveFigure(figpath, figfile)
#
# if ftp:
# #provisionalmente envia archivos en el formato de la web en tiempo real
# name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
# path = '%s%03d' %(self.PREFIX, self.id)
# ftp_file = os.path.join(path,'ftp','%s.png'%name)
# self.saveFigure(figpath, ftp_file)
# ftp_filename = os.path.join(figpath,ftp_file)
# self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
# self.counter_imagwr = 0
#
# self.counter_imagwr = 0
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 #if ((dataOut.utctime-time.timezone) >= self.axesList[0].xmax):
if x[1] >= self.axesList[0].xmax:
Daniel Valdez
changes to integrate AMISR Reader with Voltage and Spectra Objs
r475 #self.saveFigure(figpath, figfile)
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.__isConfig = False
Daniel Valdez
se agregan variables para salvar graficos en disco para el ultimo bloque de datos o cuando se actualiza el eje x
r458
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 # if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
#
# self.__isConfig = False
# if lastone:
# if figfile == None:
# figfile = self.getFilename(name = self.name)
# self.saveFigure(figpath, figfile)
#
# if ftp:
# #provisionalmente envia archivos en el formato de la web en tiempo real
# name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
# path = '%s%03d' %(self.PREFIX, self.id)
# ftp_file = os.path.join(path,'ftp','%s.png'%name)
# self.saveFigure(figpath, ftp_file)
# ftp_filename = os.path.join(figpath,ftp_file)
# self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
Daniel Valdez
se agregan variables para salvar graficos en disco para el ultimo bloque de datos o cuando se actualiza el eje x
r458
Daniel Valdez
Adicion del metodo saveFigure() para guardar archivos de imagen de la clase Figure(). Se modifica los xaxis se muestran en formato datetime, falta hacer ajustes en los ticks de acuerdo al intervalo [xmin, xmax]
r209
Daniel Valdez
En graphics:...
r192 class SpectraPlot(Figure):
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
En graphics:...
r192 __isConfig = None
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 __nsubplots = None
WIDTHPROF = None
HEIGHTPROF = None
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 PREFIX = 'spc'
Daniel Valdez
En graphics:...
r192
def __init__(self):
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
En graphics:...
r192 self.__isConfig = False
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 self.__nsubplots = 1
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 self.WIDTH = 280
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 self.HEIGHT = 250
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
Daniel Valdez
Version para procesar Meteoros
r399 self.counter_imagwr = 0
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.PLOT_CODE = 1
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
En graphics:...
r192 def getSubplots(self):
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
En graphics:...
r192 ncol = int(numpy.sqrt(self.nplots)+0.9)
nrow = int(self.nplots*1./ncol + 0.9)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
self.__showprofile = showprofile
self.nplots = nplots
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 ncolspan = 1
Daniel Valdez
En graphics:...
r192 colspan = 1
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 if showprofile:
ncolspan = 3
colspan = 2
self.__nsubplots = 2
Daniel Valdez
vuelta a una version anterior
r278
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 wintitle = wintitle,
Daniel Valdez
vuelta a una version anterior
r278 widthplot = self.WIDTH + self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT + self.HEIGHTPROF,
show=show)
Daniel Valdez
En graphics:...
r192
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 nrow, ncol = self.getSubplots()
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
En graphics:...
r192 counter = 0
for y in range(nrow):
for x in range(ncol):
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
if counter >= self.nplots:
break
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
if showprofile:
Daniel Valdez
Adicion de la clase RTIPlot
r207 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
Daniel Valdez
En graphics:...
r192 counter += 1
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 def run(self, dataOut, id, wintitle="", channelList=None, showprofile=True,
Daniel Valdez
vuelta a una version anterior
r278 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
server=None, folder=None, username=None, password=None,
Daniel Valdez
se corrige bug en el metodo isRealTime de jroplot.py para estimar el tiempo de diferencia entre el tiempo de adquisicion y procesamiento
r407 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
"""
Input:
dataOut :
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id :
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
Daniel Valdez
En graphics:...
r192
Daniel Valdez
changes to integrate AMISR Reader with Voltage and Spectra Objs
r475 if dataOut.flagNoData:
return None
Daniel Valdez
se corrige bug en el metodo isRealTime de jroplot.py para estimar el tiempo de diferencia entre el tiempo de adquisicion y procesamiento
r407 if realtime:
Daniel Valdez
Optimizacion de Salvado de Spectros...
r404 if not(isRealtime(utcdatatime = dataOut.utctime)):
print 'Skipping this plot function'
return
Daniel Valdez
En graphics:...
r192 if channelList == None:
Miguel Valdez
Bug fixed: Al graficar los canales selecionados en SpectraPlot
r203 channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
Miguel Valdez
Bux fixed: La seleccion de canales en el gragico SpectraPlot, RTIPlot y Scope fueron testeados
r214 channelIndexList.append(dataOut.channelList.index(channel))
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 factor = dataOut.normFactor
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 x = dataOut.getVelRange(1)
Daniel Valdez
Adicion de la clase RTIPlot
r207 y = dataOut.getHeiRange()
Miguel Valdez
r232
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 z = dataOut.data_spc[channelIndexList,:,:]/factor
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Miguel Valdez
Se modifico el calculo automatico del rango de valores del grafico de Espectros.
r205 avg = numpy.average(z, axis=1)
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 noise = dataOut.getNoise()/factor
Daniel Valdez
En graphics:...
r192
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 zdB = 10*numpy.log10(z)
avgdB = 10*numpy.log10(avg)
noisedB = 10*numpy.log10(noise)
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 title = wintitle + " Spectra"
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 xlabel = "Velocity (m/s)"
ylabel = "Range (Km)"
Daniel Valdez
En graphics:...
r192 if not self.__isConfig:
Miguel Valdez
Bug fixed: Al graficar los canales selecionados en SpectraPlot
r203 nplots = len(channelIndexList)
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 showprofile=showprofile,
show=show)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
if xmin == None: xmin = numpy.nanmin(x)
if xmax == None: xmax = numpy.nanmax(x)
if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 if zmin == None: zmin = numpy.nanmin(avgdB)*0.9
if zmax == None: zmax = numpy.nanmax(avgdB)*0.9
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Daniel Valdez
En graphics:...
r192 self.__isConfig = True
Daniel Valdez
En esta version se ha implementado la clase para ploteo de espectros, a este grafico aun le falta agregar el perfil de potencia para cada canal.
r196
self.setWinTitle(title)
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 for i in range(self.nplots):
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[i]+1, noisedB[i], str_datetime)
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 axes = self.axesList[i*self.__nsubplots]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 axes.pcolor(x, y, zdB[i,:,:],
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title,
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 ticksize=9, cblabel='')
if self.__showprofile:
axes = self.axesList[i*self.__nsubplots +1]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 axes.pline(avgdB[i], y,
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
xlabel='dB', ylabel='', title='',
ytick_visible=False,
grid='x')
Daniel Valdez
Se agrega el metodo deflip a jroprocessing.py....
r239
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 noiseline = numpy.repeat(noisedB[i], len(y))
Daniel Valdez
Se agrega el metodo deflip a jroprocessing.py....
r239 axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2)
Miguel Valdez
Primera version del controlador probada y testeada incluyendo graficos
r199
Daniel Valdez
En graphics:...
r192 self.draw()
Daniel Valdez
Adicion del metodo saveFigure() para guardar archivos de imagen de la clase Figure(). Se modifica los xaxis se muestran en formato datetime, falta hacer ajustes en los ticks de acuerdo al intervalo [xmin, xmax]
r209
if save:
Daniel Valdez
Version para procesar Meteoros
r399
self.counter_imagwr += 1
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 if (self.counter_imagwr==wr_period):
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 if figfile == None:
str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
figfile = self.getFilename(name = str_datetime)
Daniel Valdez
Version para procesar Meteoros
r399
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 self.saveFigure(figpath, figfile)
Daniel Valdez
Version para procesar Meteoros
r399
if ftp:
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 #provisionalmente envia archivos en el formato de la web en tiempo real
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400 path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
Daniel Valdez
El envio de los archivos de imagen al servidor FTP se realiza mediante un thread. Por ahora esta funcion se ha aplicado a la clase SpectraPlot
r435 self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
Daniel Valdez
Version para procesar Meteoros
r399
self.counter_imagwr = 0
Daniel Valdez
Los graficos RTI, Spc, Cspc y CoherenceMap se guardan en archivos .png por defecto con el PREFIX que corresponde a cada grafico. Para envio de archivos por FTP, se crea una sub-carpeta con nombre 'ftp', luego se guarda el archivo con nombre 'YYYYDDDWWEXPSSTTNN', donde YYYY indica el year, DDD indica el doy, WW,EXP,SS,TT,NN se definen para uso provisional en la web de Jicamarca, la web para monitoreo en tiempo real se debe cambiar.
r400
Daniel Valdez
En graphics:...
r192
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 class Scope(Figure):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 __isConfig = None
def __init__(self):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 self.__isConfig = False
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 self.WIDTH = 300
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 self.HEIGHT = 200
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 self.counter_imagwr = 0
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
def getSubplots(self):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 nrow = self.nplots
ncol = 3
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, show):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Miguel Valdez
r232 self.nplots = nplots
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id=id,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 wintitle=wintitle,
show=show)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
nrow,ncol = self.getSubplots()
colspan = 3
rowspan = 1
for i in range(nplots):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 self.addAxes(nrow, ncol, i, 0, colspan, rowspan)
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474
def plot_iq(self, x, y, id, channelIndexList, thisDatetime, wintitle, show, xmin, xmax, ymin, ymax):
yreal = y[channelIndexList,:].real
yimag = y[channelIndexList,:].imag
title = wintitle + " Scope: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
xlabel = "Range (Km)"
ylabel = "Intensity - IQ"
if not self.__isConfig:
nplots = len(channelIndexList)
self.setup(id=id,
nplots=nplots,
wintitle='',
show=show)
if xmin == None: xmin = numpy.nanmin(x)
if xmax == None: xmax = numpy.nanmax(x)
if ymin == None: ymin = min(numpy.nanmin(yreal),numpy.nanmin(yimag))
if ymax == None: ymax = max(numpy.nanmax(yreal),numpy.nanmax(yimag))
self.__isConfig = True
self.setWinTitle(title)
for i in range(len(self.axesList)):
title = "Channel %d" %(i)
axes = self.axesList[i]
axes.pline(x, yreal[i,:],
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title)
axes.addpline(x, yimag[i,:], idline=1, color="red", linestyle="solid", lw=2)
def plot_power(self, x, y, id, channelIndexList, thisDatetime, wintitle, show, xmin, xmax, ymin, ymax):
y = y[channelIndexList,:] * numpy.conjugate(y[channelIndexList,:])
yreal = y.real
title = wintitle + " Scope: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
xlabel = "Range (Km)"
ylabel = "Intensity"
if not self.__isConfig:
nplots = len(channelIndexList)
self.setup(id=id,
nplots=nplots,
wintitle='',
show=show)
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 if xmin == None: xmin = numpy.nanmin(x)
if xmax == None: xmax = numpy.nanmax(x)
if ymin == None: ymin = numpy.nanmin(yreal)
if ymax == None: ymax = numpy.nanmax(yreal)
self.__isConfig = True
Miguel Valdez
r232
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 self.setWinTitle(title)
for i in range(len(self.axesList)):
title = "Channel %d" %(i)
axes = self.axesList[i]
ychannel = yreal[i,:]
axes.pline(x, ychannel,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None,
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 figpath='./', figfile=None, show=True, wr_period=1,
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 server=None, folder=None, username=None, password=None, type='power'):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
"""
Input:
dataOut :
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id :
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 wintitle :
channelList :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
"""
Daniel Valdez
changes to integrate AMISR Reader with Voltage and Spectra Objs
r475 if dataOut.flagNoData:
return None
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
if channelList == None:
Miguel Valdez
Bux fixed: La seleccion de canales en el gragico SpectraPlot, RTIPlot y Scope fueron testeados
r214 channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
Daniel Valdez
Se agrega clase para ploteo de Espectros Cruzados.
r215 channelIndexList.append(dataOut.channelList.index(channel))
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 x = dataOut.heightList
Miguel Valdez
r232 y = dataOut.data[channelIndexList,:] * numpy.conjugate(dataOut.data[channelIndexList,:])
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 y = y.real
Daniel Valdez
Bugs Fixed
r392 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 if type == "power":
self.plot_power(dataOut.heightList,
dataOut.data,
id,
channelIndexList,
thisDatetime,
wintitle,
show,
xmin,
xmax,
ymin,
ymax)
if type == "iq":
self.plot_iq(dataOut.heightList,
dataOut.data,
id,
channelIndexList,
thisDatetime,
wintitle,
show,
xmin,
xmax,
ymin,
ymax)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
self.draw()
Daniel Valdez
Adicion del metodo saveFigure() para guardar archivos de imagen de la clase Figure(). Se modifica los xaxis se muestran en formato datetime, falta hacer ajustes en los ticks de acuerdo al intervalo [xmin, xmax]
r209 if save:
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 date = thisDatetime.strftime("%Y%m%d_%H%M%S")
if figfile == None:
figfile = self.getFilename(name = date)
self.saveFigure(figpath, figfile)
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443
self.counter_imagwr += 1
if (ftp and (self.counter_imagwr==wr_period)):
ftp_filename = os.path.join(figpath,figfile)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 class PowerProfile(Figure):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 __isConfig = None
__nsubplots = None
WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'spcprofile'
def __init__(self):
self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 300
self.HEIGHT = 500
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 self.counter_imagwr = 0
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
def getSubplots(self):
ncol = 1
nrow = 1
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, show):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
self.nplots = nplots
ncolspan = 1
colspan = 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 wintitle = wintitle,
widthplot = self.WIDTH,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT,
show=show)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
nrow, ncol = self.getSubplots()
counter = 0
for y in range(nrow):
for x in range(ncol):
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None,
Daniel Valdez
vuelta a una version anterior
r278 xmin=None, xmax=None, ymin=None, ymax=None,
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 save=False, figpath='./', figfile=None, show=True, wr_period=1,
server=None, folder=None, username=None, password=None,):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
changes to integrate AMISR Reader with Voltage and Spectra Objs
r475 if dataOut.flagNoData:
return None
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 if channelList == None:
channelIndexList = dataOut.channelIndexList
channelList = dataOut.channelList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
channelIndexList.append(dataOut.channelList.index(channel))
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 try:
factor = dataOut.normFactor
except:
factor = 1
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 y = dataOut.getHeiRange()
#for voltage
if dataOut.type == 'Voltage':
x = dataOut.data[channelIndexList,:] * numpy.conjugate(dataOut.data[channelIndexList,:])
x = x.real
x = numpy.where(numpy.isfinite(x), x, numpy.NAN)
#for spectra
if dataOut.type == 'Spectra':
x = dataOut.data_spc[channelIndexList,:,:]/factor
x = numpy.where(numpy.isfinite(x), x, numpy.NAN)
x = numpy.average(x, axis=1)
xdB = 10*numpy.log10(x)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245
Daniel Valdez
Bugs Fixed
r392 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " Power Profile %s" %(thisDatetime.strftime("%d-%b-%Y"))
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 xlabel = "dB"
ylabel = "Range (Km)"
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
if not self.__isConfig:
nplots = 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 nplots=nplots,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 wintitle=wintitle,
show=show)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 if xmin == None: xmin = numpy.nanmin(xdB)*0.9
if xmax == None: xmax = numpy.nanmax(xdB)*0.9
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
self.__isConfig = True
self.setWinTitle(title)
title = "Power Profile: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
axes = self.axesList[0]
legendlabels = ["channel %d"%x for x in channelList]
Daniel Valdez
AMISR Reader integration with Signal Chain Blocks, this time just only for Voltages to Profile Selection and Plotting Scope(Power,IQ) and Power Profile(dB). There is thwo python scripts as experiment's test.
r474 axes.pmultiline(xdB, y,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels,
ytick_visible=True, nxticks=5,
grid='x')
self.draw()
if save:
date = thisDatetime.strftime("%Y%m%d")
if figfile == None:
figfile = self.getFilename(name = date)
self.saveFigure(figpath, figfile)
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443
self.counter_imagwr += 1
if (ftp and (self.counter_imagwr==wr_period)):
ftp_filename = os.path.join(figpath,figfile)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 class CoherenceMap(Figure):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 __isConfig = None
__nsubplots = None
WIDTHPROF = None
HEIGHTPROF = None
Daniel Valdez
actualizacion para calculo de fase
r281 PREFIX = 'cmap'
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
def __init__(self):
Miguel Valdez
jroplot:...
r237 self.timerange = 2*60*60
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 800
Daniel Valdez
correccion de bug en el grafico de RTI, el xlabel = "velocity(m/s)"
r282 self.HEIGHT = 150
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401
self.PLOT_CODE = 3
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
self.counter_imagwr = 0
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471
self.xmin = None
self.xmax = None
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
def getSubplots(self):
ncol = 1
nrow = self.nplots*2
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 7
colspan = 6
self.__nsubplots = 2
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT + self.HEIGHTPROF,
show=True)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
nrow, ncol = self.getSubplots()
for y in range(nrow):
for x in range(ncol):
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
timerange=None,
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 save=False, figpath='./', figfile=None, ftp=False, wr_period=1,
coherence_cmap='jet', phase_cmap='RdBu_r', show=True,
server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
if pairsList == None:
pairsIndexList = dataOut.pairsIndexList
else:
pairsIndexList = []
for pair in pairsList:
if pair not in dataOut.pairsList:
raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair)
pairsIndexList.append(dataOut.pairsList.index(pair))
if timerange != None:
Miguel Valdez
r231 self.timerange = timerange
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Miguel Valdez
jrodataIO.py: Adicion del parametro LOCALTIME para la lectura de datos....
r234 if pairsIndexList == []:
return
if len(pairsIndexList) > 4:
pairsIndexList = pairsIndexList[0:4]
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 # tmin = None
# tmax = None
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 title = wintitle + " CoherenceMap" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 xlabel = ""
ylabel = "Range (Km)"
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 if not self.__isConfig:
nplots = len(pairsIndexList)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 showprofile=showprofile,
show=show)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 #tmin, tmax = self.getTimeLim(x, xmin, xmax)
self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Daniel Valdez
Cambios realizados para adaptar los valores de Cohencia en un rango elegido por el usuario, por defecto de 0-1.
r398 if zmin == None: zmin = 0.
if zmax == None: zmax = 1.
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Daniel Valdez
vuelta a una version anterior
r278
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 self.__isConfig = True
self.setWinTitle(title)
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 if ((self.xmax - x[1]) < (x[1]-x[0])):
x[1] = self.xmax
Daniel Valdez
vuelta a una version anterior
r278 for i in range(self.nplots):
pair = dataOut.pairsList[pairsIndexList[i]]
Daniel Valdez
Bug Fixed: Coherence Calculation
r427 # coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[pair[0],:,:]*dataOut.data_spc[pair[1],:,:])
# avgcoherenceComplex = numpy.average(coherenceComplex, axis=0)
# coherence = numpy.abs(avgcoherenceComplex)
## coherence = numpy.abs(coherenceComplex)
## avg = numpy.average(coherence, axis=0)
ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i],:,:],axis=0)
powa = numpy.average(dataOut.data_spc[pair[0],:,:],axis=0)
powb = numpy.average(dataOut.data_spc[pair[1],:,:],axis=0)
avgcoherenceComplex = ccf/numpy.sqrt(powa*powb)
Daniel Valdez
actualizacion para calculo de fase
r281 coherence = numpy.abs(avgcoherenceComplex)
z = coherence.reshape((1,-1))
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
vuelta a una version anterior
r278 counter = 0
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
vuelta a una version anterior
r278 title = "Coherence %d%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 axes = self.axesList[i*self.__nsubplots*2]
Daniel Valdez
Optimizacion de graficos con buffer, el buffer se crea en la clase Axes del modulo figure.py, se agrega el metodo pcolorbuffer....
r318 axes.pcolorbuffer(x, y, z,
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, cblabel='', colormap=coherence_cmap, cbsize="1%")
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
if self.__showprofile:
counter += 1
axes = self.axesList[i*self.__nsubplots*2 + counter]
Daniel Valdez
actualizacion para calculo de fase
r281 axes.pline(coherence, y,
Daniel Valdez
Cambios realizados para adaptar los valores de Cohencia en un rango elegido por el usuario, por defecto de 0-1.
r398 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xlabel='', ylabel='', title='', ticksize=7,
ytick_visible=False, nxticks=5,
grid='x')
counter += 1
Daniel Valdez
actualizacion para calculo de fase
r281 # phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi
# avg = numpy.average(phase, axis=0)
z = phase.reshape((1,-1))
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
vuelta a una version anterior
r278 title = "Phase %d%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 axes = self.axesList[i*self.__nsubplots*2 + counter]
Daniel Valdez
Optimizacion de graficos con buffer, el buffer se crea en la clase Axes del modulo figure.py, se agrega el metodo pcolorbuffer....
r318 axes.pcolorbuffer(x, y, z,
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=-180, zmax=180,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
Daniel Valdez
actualizacion para calculo de fase
r281 ticksize=9, cblabel='', colormap=phase_cmap, cbsize="1%")
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
if self.__showprofile:
counter += 1
axes = self.axesList[i*self.__nsubplots*2 + counter]
Daniel Valdez
actualizacion para calculo de fase
r281 axes.pline(phase, y,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 xmin=-180, xmax=180, ymin=ymin, ymax=ymax,
xlabel='', ylabel='', title='', ticksize=7,
ytick_visible=False, nxticks=4,
grid='x')
self.draw()
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 if x[1] >= self.axesList[0].xmax:
self.saveFigure(figpath, figfile)
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 self.__isConfig = False
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471
# if save:
#
# self.counter_imagwr += 1
# if (self.counter_imagwr==wr_period):
# if figfile == None:
# figfile = self.getFilename(name = self.name)
# self.saveFigure(figpath, figfile)
#
# if ftp:
# #provisionalmente envia archivos en el formato de la web en tiempo real
# name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
# path = '%s%03d' %(self.PREFIX, self.id)
# ftp_file = os.path.join(path,'ftp','%s.png'%name)
# self.saveFigure(figpath, ftp_file)
# ftp_filename = os.path.join(figpath,ftp_file)
# self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
# self.counter_imagwr = 0
#
# self.counter_imagwr = 0
#
#
# if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
# self.__isConfig = False
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453 class BeaconPhase(Figure):
__isConfig = None
__nsubplots = None
PREFIX = 'beacon_phase'
def __init__(self):
self.timerange = 24*60*60
self.__isConfig = False
self.__nsubplots = 1
self.counter_imagwr = 0
self.WIDTH = 600
self.HEIGHT = 300
self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.xdata = None
self.ydata = None
Daniel Valdez
El grafico de la fase del Beacon se guarda en el disco y envia por ftp
r454 self.PLOT_CODE = 18
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
se agrega metodos para almacenar en disco las fases...
r460 self.filename_phase = None
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453 def getSubplots(self):
ncol = 1
nrow = 1
return nrow, ncol
def setup(self, id, nplots, wintitle, showprofile=True, show=True):
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 7
colspan = 6
self.__nsubplots = 2
self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH+self.WIDTHPROF,
heightplot = self.HEIGHT+self.HEIGHTPROF,
show=show)
nrow, ncol = self.getSubplots()
self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
Daniel Valdez
se agrega metodos para almacenar en disco las fases...
r460
def save_phase(self, filename_phase):
f = open(filename_phase,'w+')
f.write('\n\n')
f.write('JICAMARCA RADIO OBSERVATORY - Beacon Phase \n')
f.write('DD MM YYYY HH MM SS pair(2,0) pair(2,1) pair(2,3) pair(2,4)\n\n' )
f.close()
def save_data(self, filename_phase, data, data_datetime):
f=open(filename_phase,'a')
timetuple_data = data_datetime.timetuple()
day = str(timetuple_data.tm_mday)
month = str(timetuple_data.tm_mon)
year = str(timetuple_data.tm_year)
hour = str(timetuple_data.tm_hour)
minute = str(timetuple_data.tm_min)
second = str(timetuple_data.tm_sec)
f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' '+str(data[0])+' '+str(data[1])+' '+str(data[2])+' '+str(data[3])+'\n')
f.close()
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453 def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
xmin=None, xmax=None, ymin=None, ymax=None,
timerange=None,
save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
if pairsList == None:
pairsIndexList = dataOut.pairsIndexList
else:
pairsIndexList = []
for pair in pairsList:
if pair not in dataOut.pairsList:
raise ValueError, "Pair %s is not in dataOut.pairsList" %(pair)
pairsIndexList.append(dataOut.pairsList.index(pair))
if pairsIndexList == []:
return
Daniel Valdez
El grafico de la fase del Beacon se guarda en el disco y envia por ftp
r454 # if len(pairsIndexList) > 4:
# pairsIndexList = pairsIndexList[0:4]
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453
if timerange != None:
self.timerange = timerange
tmin = None
tmax = None
x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
#thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " Phase of Beacon Signal" # : %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = "Local Time"
ylabel = "Phase"
nplots = len(pairsIndexList)
#phase = numpy.zeros((len(pairsIndexList),len(dataOut.beacon_heiIndexList)))
phase_beacon = numpy.zeros(len(pairsIndexList))
for i in range(nplots):
pair = dataOut.pairsList[pairsIndexList[i]]
ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i],:,:],axis=0)
powa = numpy.average(dataOut.data_spc[pair[0],:,:],axis=0)
powb = numpy.average(dataOut.data_spc[pair[1],:,:],axis=0)
avgcoherenceComplex = ccf/numpy.sqrt(powa*powb)
phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi
#print "Phase %d%d" %(pair[0], pair[1])
#print phase[dataOut.beacon_heiIndexList]
phase_beacon[i] = numpy.average(phase[dataOut.beacon_heiIndexList])
if not self.__isConfig:
nplots = len(pairsIndexList)
self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
tmin, tmax = self.getTimeLim(x, xmin, xmax)
if ymin == None: ymin = numpy.nanmin(phase_beacon) - 10.0
if ymax == None: ymax = numpy.nanmax(phase_beacon) + 10.0
self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
self.__isConfig = True
self.xdata = numpy.array([])
self.ydata = numpy.array([])
Daniel Valdez
se agrega metodos para almacenar en disco las fases...
r460
#open file beacon phase
path = '%s%03d' %(self.PREFIX, self.id)
beacon_file = os.path.join(path,'%s.txt'%self.name)
self.filename_phase = os.path.join(figpath,beacon_file)
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 #self.save_phase(self.filename_phase)
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453
Daniel Valdez
se agrega metodos para almacenar en disco las fases...
r460
#store data beacon phase
Daniel Valdez
Se corrigen bugs en el eje x de los graficos RTI y CoherenceMap, se reduce el numero de puntos o pixeles en X e Y....
r471 #self.save_data(self.filename_phase, phase_beacon, thisDatetime)
Daniel Valdez
se agrega metodos para almacenar en disco las fases...
r460
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453 self.setWinTitle(title)
title = "Beacon Signal %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
legendlabels = ["pairs %d%d"%(pair[0], pair[1]) for pair in dataOut.pairsList]
axes = self.axesList[0]
self.xdata = numpy.hstack((self.xdata, x[0:1]))
if len(self.ydata)==0:
self.ydata = phase_beacon.reshape(-1,1)
else:
self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1)))
axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid",
XAxisAsTime=True, grid='both'
)
self.draw()
Daniel Valdez
El grafico de la fase del Beacon se guarda en el disco y envia por ftp
r454
if save:
self.counter_imagwr += 1
if (self.counter_imagwr==wr_period):
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
if ftp:
#provisionalmente envia archivos en el formato de la web en tiempo real
name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
self.__isConfig = False
del self.xdata
del self.ydata
Daniel Valdez
Calculo y ploteo de la fase del Beacon
r453
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 class Noise(Figure):
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
__isConfig = None
__nsubplots = None
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 PREFIX = 'noise'
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
def __init__(self):
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 self.timerange = 24*60*60
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 self.__isConfig = False
self.__nsubplots = 1
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 self.counter_imagwr = 0
self.WIDTH = 600
self.HEIGHT = 300
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.xdata = None
self.ydata = None
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 self.PLOT_CODE = 77
self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 def getSubplots(self):
ncol = 1
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 nrow = 1
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
return nrow, ncol
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 def openfile(self, filename):
f = open(filename,'w+')
f.write('\n\n')
f.write('JICAMARCA RADIO OBSERVATORY - Noise \n')
f.write('DD MM YYYY HH MM SS Channel0 Channel1 Channel2 Channel3\n\n' )
f.close()
def save_data(self, filename_phase, data, data_datetime):
f=open(filename_phase,'a')
timetuple_data = data_datetime.timetuple()
day = str(timetuple_data.tm_mday)
month = str(timetuple_data.tm_mon)
year = str(timetuple_data.tm_year)
hour = str(timetuple_data.tm_hour)
minute = str(timetuple_data.tm_min)
second = str(timetuple_data.tm_sec)
f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' '+str(data[0])+' '+str(data[1])+' '+str(data[2])+' '+str(data[3])+'\n')
f.close()
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
self.__showprofile = showprofile
self.nplots = nplots
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 ncolspan = 7
colspan = 6
self.__nsubplots = 2
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 wintitle = wintitle,
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 widthplot = self.WIDTH+self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT+self.HEIGHTPROF,
show=show)
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
nrow, ncol = self.getSubplots()
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245
self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
Daniel Valdez
vuelta a una version anterior
r278 xmin=None, xmax=None, ymin=None, ymax=None,
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 timerange=None,
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
if channelList == None:
channelIndexList = dataOut.channelIndexList
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 channelList = dataOut.channelList
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
channelIndexList.append(dataOut.channelList.index(channel))
if timerange != None:
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 self.timerange = timerange
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
tmin = None
tmax = None
x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463 factor = dataOut.normFactor
noise = dataOut.getNoise()/factor
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 noisedB = 10*numpy.log10(noise)
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 title = wintitle + " Noise" # : %s" %(thisDatetime.strftime("%d-%b-%Y"))
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 xlabel = ""
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 ylabel = "Intensity (dB)"
Miguel Valdez
El nombre del archivo grafico esta compuesto por el titulo de la figura mas la fecha y tiempo de los datos.
r238
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 if not self.__isConfig:
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 nplots = 1
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 showprofile=showprofile,
show=show)
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 tmin, tmax = self.getTimeLim(x, xmin, xmax)
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 if ymin == None: ymin = numpy.nanmin(noisedB) - 10.0
if ymax == None: ymax = numpy.nanmax(noisedB) + 10.0
self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 self.__isConfig = True
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 self.xdata = numpy.array([])
self.ydata = numpy.array([])
Daniel Valdez
se actualiza el calculo del factor de normalizacion
r463
#open file beacon phase
path = '%s%03d' %(self.PREFIX, self.id)
noise_file = os.path.join(path,'%s.txt'%self.name)
self.filename_noise = os.path.join(figpath,noise_file)
self.openfile(self.filename_noise)
#store data beacon phase
self.save_data(self.filename_noise, noisedB, thisDatetime)
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233
self.setWinTitle(title)
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 title = "Noise %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 legendlabels = ["channel %d"%(idchannel+1) for idchannel in channelList]
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 axes = self.axesList[0]
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245
self.xdata = numpy.hstack((self.xdata, x[0:1]))
if len(self.ydata)==0:
self.ydata = noisedB[channelIndexList].reshape(-1,1)
else:
self.ydata = numpy.hstack((self.ydata, noisedB[channelIndexList].reshape(-1,1)))
axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid",
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 XAxisAsTime=True, grid='both'
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 )
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 self.draw()
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 # if save:
#
# if figfile == None:
# figfile = self.getFilename(name = self.name)
#
# self.saveFigure(figpath, figfile)
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 if save:
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417 self.counter_imagwr += 1
if (self.counter_imagwr==wr_period):
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
if ftp:
#provisionalmente envia archivos en el formato de la web en tiempo real
name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
path = '%s%03d' %(self.PREFIX, self.id)
ftp_file = os.path.join(path,'ftp','%s.png'%name)
self.saveFigure(figpath, ftp_file)
ftp_filename = os.path.join(figpath,ftp_file)
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
self.counter_imagwr = 0
Daniel Valdez
la clase RTIfromNoise se cambia a Noise, se habilita 'save' y 'ftp'
r417
self.counter_imagwr = 0
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
self.__isConfig = False
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 del self.xdata
del self.ydata
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
class SpectraHeisScope(Figure):
__isConfig = None
__nsubplots = None
WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'spc'
def __init__(self):
self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 230
self.HEIGHT = 250
self.WIDTHPROF = 120
self.HEIGHTPROF = 0
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
def getSubplots(self):
ncol = int(numpy.sqrt(self.nplots)+0.9)
nrow = int(self.nplots*1./ncol + 0.9)
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, show):
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
showprofile = False
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 3
colspan = 2
self.__nsubplots = 2
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT + self.HEIGHTPROF,
show = show)
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
nrow, ncol = self.getSubplots()
counter = 0
for y in range(nrow):
for x in range(ncol):
if counter >= self.nplots:
break
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
counter += 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None,
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 figpath='./', figfile=None, ftp=False, wr_period=1, show=True,
server=None, folder=None, username=None, password=None):
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
"""
Input:
dataOut :
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id :
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 wintitle :
channelList :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
"""
Daniel Valdez
Se agrega a JROData el flag realtime, para este caso se da prioridad al procesamiento de datos. Los graficos se generan solo cuando el tiempo de procesamiento es cercano al tiempo de adquisición.
r360 if dataOut.realtime:
if not(isRealtime(utcdatatime = dataOut.utctime)):
print 'Skipping this plot function'
return
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 if channelList == None:
channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
channelIndexList.append(dataOut.channelList.index(channel))
# x = dataOut.heightList
c = 3E8
deltaHeight = dataOut.heightList[1] - dataOut.heightList[0]
#deberia cambiar para el caso de 1Mhz y 100KHz
x = numpy.arange(-1*dataOut.nHeights/2.,dataOut.nHeights/2.)*(c/(2*deltaHeight*dataOut.nHeights*1000))
Daniel Valdez
Se actualiza SpectraHeisPlot para que imprima el datetime en cada axes.
r441 #para 1Mhz descomentar la siguiente linea
#x= x/(10000.0)
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 # y = dataOut.data[channelIndexList,:] * numpy.conjugate(dataOut.data[channelIndexList,:])
# y = y.real
datadB = 10.*numpy.log10(dataOut.data_spc)
y = datadB
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " Scope: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
Se actualiza SpectraHeisPlot para que imprima el datetime en cada axes.
r441 xlabel = ""
#para 1Mhz descomentar la siguiente linea
#xlabel = "Frequency x 10000"
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 ylabel = "Intensity (dB)"
if not self.__isConfig:
nplots = len(channelIndexList)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 nplots=nplots,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 wintitle=wintitle,
show=show)
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
if xmin == None: xmin = numpy.nanmin(x)
if xmax == None: xmax = numpy.nanmax(x)
if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
self.__isConfig = True
self.setWinTitle(title)
for i in range(len(self.axesList)):
ychannel = y[i,:]
Daniel Valdez
Se actualiza SpectraHeisPlot para que imprima el datetime en cada axes.
r441 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
title = "Channel %d: %4.2fdB: %s" %(i, numpy.max(ychannel), str_datetime)
Daniel Valdez
Se ploteo el valor maximo del espectro, SpectraHeis
r336 axes = self.axesList[i]
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 axes.pline(x, ychannel,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
Daniel Valdez
Se habilita el grid en los graficos de SpectraHeis
r341 xlabel=xlabel, ylabel=ylabel, title=title, grid='both')
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 self.draw()
if save:
date = thisDatetime.strftime("%Y%m%d_%H%M%S")
if figfile == None:
figfile = self.getFilename(name = date)
self.saveFigure(figpath, figfile)
Daniel Valdez
Modificaciones de graficos para SpectraHeis
r337
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr += 1
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 if (ftp and (self.counter_imagwr==wr_period)):
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 ftp_filename = os.path.join(figpath,figfile)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
class RTIfromSpectraHeis(Figure):
__isConfig = None
__nsubplots = None
PREFIX = 'rtinoise'
def __init__(self):
self.timerange = 24*60*60
self.__isConfig = False
self.__nsubplots = 1
self.WIDTH = 820
self.HEIGHT = 200
self.WIDTHPROF = 120
self.HEIGHTPROF = 0
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 self.xdata = None
self.ydata = None
def getSubplots(self):
ncol = 1
nrow = 1
return nrow, ncol
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
self.__showprofile = showprofile
self.nplots = nplots
ncolspan = 7
colspan = 6
self.__nsubplots = 2
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.createFigure(id = id,
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 wintitle = wintitle,
widthplot = self.WIDTH+self.WIDTHPROF,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 heightplot = self.HEIGHT+self.HEIGHTPROF,
show = show)
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
nrow, ncol = self.getSubplots()
self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 xmin=None, xmax=None, ymin=None, ymax=None,
timerange=None,
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 save=False, figpath='./', figfile=None, ftp=False, wr_period=1, show=True,
server=None, folder=None, username=None, password=None):
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
if channelList == None:
channelIndexList = dataOut.channelIndexList
channelList = dataOut.channelList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
raise ValueError, "Channel %d is not in dataOut.channelList"
channelIndexList.append(dataOut.channelList.index(channel))
if timerange != None:
self.timerange = timerange
tmin = None
tmax = None
Daniel Valdez
Se corrige el tiempo para los graficos de Spectros en Alturas
r354 x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
Daniel Valdez
jrodata.py: el atributo ippFactor se inicia en 1...
r448 #factor = 1
data = dataOut.data_spc#/factor
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 data = numpy.average(data,axis=1)
datadB = 10*numpy.log10(data)
# factor = dataOut.normFactor
# noise = dataOut.getNoise()/factor
# noisedB = 10*numpy.log10(noise)
Daniel Valdez
Bugs Fixed
r392 #thisDatetime = dataOut.datatime
thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[1])
title = wintitle + " RTI: %s" %(thisDatetime.strftime("%d-%b-%Y"))
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 xlabel = "Local Time"
ylabel = "Intensity (dB)"
if not self.__isConfig:
nplots = 1
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.setup(id=id,
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 nplots=nplots,
wintitle=wintitle,
Daniel Valdez
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
r342 showprofile=showprofile,
show=show)
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
tmin, tmax = self.getTimeLim(x, xmin, xmax)
if ymin == None: ymin = numpy.nanmin(datadB)
if ymax == None: ymax = numpy.nanmax(datadB)
self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
self.__isConfig = True
self.xdata = numpy.array([])
self.ydata = numpy.array([])
self.setWinTitle(title)
Daniel Valdez
Modificaciones de graficos para SpectraHeis
r337 # title = "RTI %s" %(thisDatetime.strftime("%d-%b-%Y"))
Daniel Valdez
En esta version se tiene:...
r439 title = "RTI - %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334
Daniel Valdez
En jrodataIO.py se corrige la lectura de channelList desde el archivo FITS. En jroplot, el RTIfromSpectraHeis imprime la leyenda la imprime a partir de channelList
r446 legendlabels = ["channel %d"%idchannel for idchannel in channelList]
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 axes = self.axesList[0]
self.xdata = numpy.hstack((self.xdata, x[0:1]))
if len(self.ydata)==0:
self.ydata = datadB[channelIndexList].reshape(-1,1)
else:
self.ydata = numpy.hstack((self.ydata, datadB[channelIndexList].reshape(-1,1)))
axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax,
Daniel Valdez
Se habilita el grid en los graficos de SpectraHeis
r341 xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='.', markersize=8, linestyle="solid", grid='both',
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 XAxisAsTime=True
)
self.draw()
if save:
if figfile == None:
figfile = self.getFilename(name = self.name)
self.saveFigure(figpath, figfile)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr += 1
Daniel Valdez
El envio de imagenes por ftp requiere de parametros: ftp_wei, exp_code, sub_exp_code, plot_pos, plot_code. Estos parametros se han actualizado en las funciones de ploteo.
r401 if (ftp and (self.counter_imagwr==wr_period)):
Daniel Valdez
En esta version todos los tipos de graficos envian un archivo png hacia el servidor FTP usando Threads
r443 ftp_filename = os.path.join(figpath,figfile)
self.sendByFTP_Thread(ftp_filename, server, folder, username, password)
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.counter_imagwr = 0
Daniel Valdez
Modificaciones de graficos para SpectraHeis
r337
Daniel Valdez
Se agregan las clases para Procesamiento en Alturas: SpectraHeis, sus graficos tambien son agregados en jroplot.py....
r334 if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax:
self.__isConfig = False
del self.xdata
del self.ydata
Daniel Valdez
Se corrige el tiempo para los graficos de Spectros en Alturas
r354
Daniel Valdez
Agrega la clase ProfileSelector y el metodo filterByHeights en jroprocessing.py...
r233