##// END OF EJS Templates
Modificaciones en el numero de intergraciones, en la escala de db Range
Modificaciones en el numero de intergraciones, en la escala de db Range

File last commit:

r596:bf27846f03e1
r599:f46dc4c4834d
Show More
figure.py
609 lines | 20.0 KiB | text/x-python | PythonLexer
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 import os
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 import numpy
Miguel Valdez
r231 import time, datetime
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 import mpldriver
Daniel Valdez
Bug fixed: AMISR Reader filling with zeros at the begining of the processing....
r497
Miguel Valdez
r577 from schainpy.model.proc.jroproc_base import Operation
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
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 def isRealtime(utcdatatime):
utcnow = time.mktime(time.localtime())
delta = abs(utcnow - utcdatatime) # abs
if delta >= 30.:
return False
return True
Miguel Valdez
r577 class Figure(Operation):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
__driver = mpldriver
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 __isConfigThread = False
Miguel Valdez
Metodo destructor agregado a la clase Figure para desactivar el modo interactivo y mantener el gráfico.
r206 fig = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 wintitle = None
Daniel Valdez
En graphics:...
r192 width = None
height = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 nplots = None
Miguel Valdez
r231 timerange = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
axesObjList = []
WIDTH = None
HEIGHT = None
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 PREFIX = 'fig'
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
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 = None
xmax = None
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 counter_imagwr = 0
figfile = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def __init__(self):
raise ValueError, "This method is not implemented"
Miguel Valdez
Metodo destructor agregado a la clase Figure para desactivar el modo interactivo y mantener el gráfico.
r206 def __del__(self):
Miguel Valdez
r577 self.__driver.closeFigure()
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212
def getFilename(self, name, ext='.png'):
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 path = '%s%03d' %(self.PREFIX, self.id)
Miguel Valdez
Se corrigio el calculo de limites de tiempo en la clase Figura (Timezone restado del resultado final)
r248 filename = '%s_%s%s' %(self.PREFIX, name, ext)
return os.path.join(path, filename)
Miguel Valdez
Metodo destructor agregado a la clase Figure para desactivar el modo interactivo y mantener el gráfico.
r206
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def getAxesObjList(self):
return self.axesObjList
def getSubplots(self):
raise ValueError, "Abstract method: This method should be defined"
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 def getScreenDim(self, widthplot, heightplot):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
nrow, ncol = self.getSubplots()
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 widthscreen = widthplot*ncol
heightscreen = heightplot*nrow
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 return widthscreen, heightscreen
Miguel Valdez
El metodo getTimeLim se ha generalizado y se coloco en a clase base Figure
r230
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 def getTimeLim(self, x, xmin=None, xmax=None, timerange=None):
Miguel Valdez
El metodo getTimeLim se ha generalizado y se coloco en a clase base Figure
r230
Daniel Valdez
Bug Fixed: xmin,xmax RTI Plot
r506 if self.xmin != None and self.xmax != 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 if timerange == None:
Daniel Valdez
Bug Fixed: xmin,xmax RTI Plot
r506 timerange = self.xmax - self.xmin
xmin = self.xmin + timerange
xmax = self.xmax + timerange
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
return xmin, xmax
Miguel Valdez
El metodo getTimeLim se ha generalizado y se coloco en a clase base Figure
r230
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange == None and (xmin==None or xmax==None):
Miguel Valdez
r577 timerange = 14400 #seconds
#raise ValueError, "(timerange) or (xmin & xmax) should be defined"
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568
if timerange != None:
txmin = x[0] - x[0] % min(timerange/10, 10*60)
Daniel Valdez
Bug Fixed: Index List for AMISR Beams ...
r504 else:
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 txmin = x[0] - x[0] % 10*60
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566
Daniel Valdez
Bug Fixed: xmin,xmax RTI Plot
r506 thisdatetime = datetime.datetime.utcfromtimestamp(txmin)
thisdate = datetime.datetime.combine(thisdatetime.date(), datetime.time(0,0,0))
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange != 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 xmin = (thisdatetime - thisdate).seconds/(60*60.)
xmax = xmin + timerange/(60*60.)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566 mindt = thisdate + datetime.timedelta(hours=xmin) - datetime.timedelta(seconds=time.timezone)
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_sec = time.mktime(mindt.timetuple())
Miguel Valdez
El metodo getTimeLim se ha generalizado y se coloco en a clase base Figure
r230
Miguel Valdez
Bug plotting RTI fixed: timezone was removed from getLimit function
r566 maxdt = thisdate + datetime.timedelta(hours=xmax) - datetime.timedelta(seconds=time.timezone)
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 xmax_sec = time.mktime(maxdt.timetuple())
return xmin_sec, xmax_sec
Miguel Valdez
El metodo getTimeLim se ha generalizado y se coloco en a clase base Figure
r230
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def init(self, id, nplots, wintitle):
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204
raise ValueError, "This method has been replaced with createFigure"
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 def createFigure(self, id, wintitle, widthplot=None, heightplot=None, show=True):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
"""
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 Crea la figura de acuerdo al driver y parametros seleccionados seleccionados.
Las dimensiones de la pantalla es calculada a partir de los atributos self.WIDTH
y self.HEIGHT y el numero de subplots (nrow, ncol)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 Input:
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 id : Los parametros necesarios son
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 wintitle :
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 """
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 if widthplot == None:
widthplot = self.WIDTH
if heightplot == None:
heightplot = self.HEIGHT
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.id = id
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
self.wintitle = wintitle
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 self.fig = self.__driver.createFigure(id=self.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=self.wintitle,
width=self.widthscreen,
height=self.heightscreen,
show=show)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
self.axesObjList = []
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.counter_imagwr = 0
Daniel Valdez
Envio de graficos por FTP:...
r283
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def setDriver(self, driver=mpldriver):
self.__driver = driver
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 def setTitle(self, title):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
self.__driver.setTitle(self.fig, title)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def setWinTitle(self, title):
self.__driver.setWinTitle(self.fig, title=title)
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
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def setTextFromAxes(self, text):
raise ValueError, "Este metodo ha sido reemplazaado con el metodo setText de la clase Axes"
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
def makeAxes(self, nrow, ncol, xpos, ypos, colspan, rowspan):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
raise ValueError, "Este metodo ha sido reemplazaado con el metodo addAxes"
def addAxes(self, *args):
"""
Input:
*args : Los parametros necesarios son
nrow, ncol, xpos, ypos, colspan, rowspan
"""
axesObj = Axes(self.fig, *args)
self.axesObjList.append(axesObj)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 def saveFigure(self, figpath, figfile, *args):
filename = os.path.join(figpath, figfile)
Miguel Valdez
Se corrigio el calculo de limites de tiempo en la clase Figura (Timezone restado del resultado final)
r248
fullpath = os.path.split(filename)[0]
if not os.path.exists(fullpath):
Miguel Valdez
Creacion automatica del directorio donde se almacenará los archivos gráficos
r326 subpath = os.path.split(fullpath)[0]
if not os.path.exists(subpath):
os.mkdir(subpath)
Miguel Valdez
Se corrigio el calculo de limites de tiempo en la clase Figura (Timezone restado del resultado final)
r248 os.mkdir(fullpath)
Miguel Valdez
Se mejora el metodo para grabar graficos de RTI y Spectra....
r212 self.__driver.saveFigure(self.fig, filename, *args)
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
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 def save(self, figpath, figfile=None, save=True, ftp=False, wr_period=1, thisDatetime=None, update_figfile=True):
Miguel Valdez
r577 self.counter_imagwr += 1
if self.counter_imagwr < wr_period:
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 return
Miguel Valdez
r577 self.counter_imagwr = 0
if save:
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573
Miguel Valdez
r577 if figfile == None:
if not thisDatetime:
raise ValueError, "Saving figure: figfile or thisDatetime should be defined"
return
str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
figfile = self.getFilename(name = str_datetime)
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573
Miguel Valdez
r577 if self.figfile == None:
self.figfile = figfile
if update_figfile:
self.figfile = figfile
# store png plot to local folder
self.saveFigure(figpath, self.figfile)
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573
if not ftp:
return
if not thisDatetime:
return
# store png plot to FTP server according to RT-Web format
Miguel Valdez
Signal Chain GUI v2.1
r596 ftp_filename = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS)
# ftp_filename = os.path.join(figpath, name)
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.saveFigure(figpath, ftp_filename)
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
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 getNameToFtp(self, thisDatetime, FTP_WEI, EXP_CODE, SUB_EXP_CODE, PLOT_CODE, PLOT_POS):
YEAR_STR = '%4.4d'%thisDatetime.timetuple().tm_year
DOY_STR = '%3.3d'%thisDatetime.timetuple().tm_yday
FTP_WEI = '%2.2d'%FTP_WEI
EXP_CODE = '%3.3d'%EXP_CODE
SUB_EXP_CODE = '%2.2d'%SUB_EXP_CODE
PLOT_CODE = '%2.2d'%PLOT_CODE
PLOT_POS = '%2.2d'%PLOT_POS
name = YEAR_STR + DOY_STR + FTP_WEI + EXP_CODE + SUB_EXP_CODE + PLOT_CODE + PLOT_POS
return name
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 def draw(self):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
self.__driver.draw(self.fig)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
def run(self):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
raise ValueError, "This method is not implemented"
Miguel Valdez
Signal Chain GUI updated:...
r587 def close(self, show=False):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Miguel Valdez
Signal Chain GUI updated:...
r587 self.__driver.closeFigure(show=show, fig=self.fig)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 axesList = property(getAxesObjList)
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190
class Axes:
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
__driver = mpldriver
fig = None
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 ax = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 plot = None
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 __missing = 1E30
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 __firsttime = None
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 __showprofile = False
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 xmin = None
xmax = None
ymin = None
ymax = None
zmin = None
zmax = None
Daniel Valdez
Adicion de la clase RTIPlot
r207
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 x_buffer = None
z_buffer = None
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 decimationx = None
decimationy = 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 __MAXNUMX = 300
__MAXNUMY = 150
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def __init__(self, *args):
"""
Input:
*args : Los parametros necesarios son
fig, nrow, ncol, xpos, ypos, colspan, rowspan
"""
ax = self.__driver.createAxes(*args)
self.fig = args[0]
Daniel Valdez
Se agrega el folder "graphics" que contiene figure.py y mpldriver.py...
r190 self.ax = ax
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 self.plot = None
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.__firsttime = True
Daniel Valdez
Se agrega el metodo deflip a jroprocessing.py....
r239 self.idlineList = []
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
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 self.x_buffer = numpy.array([])
self.z_buffer = numpy.array([])
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def setText(self, text):
self.__driver.setAxesText(self.ax, text)
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 def setXAxisAsTime(self):
pass
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def pline(self, x, y,
xmin=None, xmax=None,
ymin=None, ymax=None,
xlabel='', ylabel='',
title='',
**kwargs):
"""
Input:
x :
y :
xmin :
xmax :
ymin :
ymax :
xlabel :
ylabel :
title :
**kwargs : Los parametros aceptados son
ticksize
Miguel Valdez
-Se agrego el perfil de potencia al grafico de espectros
r204 ytick_visible
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 """
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 if self.__firsttime:
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)
self.plot = self.__driver.createPline(self.ax, x, y,
xmin, xmax,
ymin, ymax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
**kwargs)
Daniel Valdez
Se agrega el metodo deflip a jroprocessing.py....
r239
self.idlineList.append(0)
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.__firsttime = False
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 return
self.__driver.pline(self.plot, x, y, xlabel=xlabel,
ylabel=ylabel,
title=title)
Daniel Valdez
Se agrega el metodo deflip a jroprocessing.py....
r239
def addpline(self, x, y, idline, **kwargs):
lines = self.ax.lines
if idline in self.idlineList:
self.__driver.set_linedata(self.ax, x, y, idline)
if idline not in(self.idlineList):
self.__driver.addpline(self.ax, x, y, **kwargs)
self.idlineList.append(idline)
return
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 def pmultiline(self, x, y,
xmin=None, xmax=None,
ymin=None, ymax=None,
xlabel='', ylabel='',
title='',
**kwargs):
if self.__firsttime:
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.plot = self.__driver.createPmultiline(self.ax, x, y,
xmin, xmax,
ymin, ymax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
**kwargs)
self.__firsttime = False
return
self.__driver.pmultiline(self.plot, x, y, xlabel=xlabel,
ylabel=ylabel,
title=title)
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240
def pmultilineyaxis(self, x, y,
xmin=None, xmax=None,
ymin=None, ymax=None,
xlabel='', ylabel='',
title='',
**kwargs):
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 if self.__firsttime:
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.plot = self.__driver.createPmultilineYAxis(self.ax, x, y,
xmin, xmax,
ymin, ymax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
**kwargs)
Daniel Valdez
Adicion del factor de normalizacion en la clase Spectra....
r245 if self.xmin == None: self.xmin = xmin
if self.xmax == None: self.xmax = xmax
if self.ymin == None: self.ymin = ymin
if self.ymax == None: self.ymax = ymax
Daniel Valdez
Adicion de la carpeta test donde se encuentra la aplicacion de prueba para los experimentos EWDrifts y Faraday...
r240 self.__firsttime = False
return
self.__driver.pmultilineyaxis(self.plot, x, y, xlabel=xlabel,
ylabel=ylabel,
title=title)
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 def pcolor(self, x, y, z,
xmin=None, xmax=None,
ymin=None, ymax=None,
zmin=None, zmax=None,
xlabel='', ylabel='',
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 title='', rti = False, colormap='jet',
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 **kwargs):
"""
Input:
x :
y :
x :
xmin :
xmax :
ymin :
ymax :
zmin :
zmax :
xlabel :
ylabel :
title :
**kwargs : Los parametros aceptados son
ticksize=9,
cblabel=''
Daniel Valdez
Adicion de la clase RTIPlot
r207 rti = True or False
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 """
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 if self.__firsttime:
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)
if zmin == None: zmin = numpy.nanmin(z)
if zmax == None: zmax = numpy.nanmax(z)
Daniel Valdez
Adicion de la clase RTIPlot
r207
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 self.plot = self.__driver.createPcolor(self.ax, x, y, z,
xmin, xmax,
ymin, ymax,
zmin, zmax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 colormap=colormap,
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 **kwargs)
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210
if self.xmin == None: self.xmin = xmin
if self.xmax == None: self.xmax = xmax
if self.ymin == None: self.ymin = ymin
if self.ymax == None: self.ymax = ymax
if self.zmin == None: self.zmin = zmin
if self.zmax == None: self.zmax = zmax
self.__firsttime = False
Miguel Valdez
Testeado con datos de Imagenes (Espectros)...
r201 return
Daniel Valdez
Adicion de la clase RTIPlot
r207
if rti:
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.__driver.addpcolor(self.ax, x, y, z, self.zmin, self.zmax,
xlabel=xlabel,
ylabel=ylabel,
Daniel Valdez
Adicion de la clase ProfilePlot, CoherencePLot en el modulo jroplot.py...
r229 title=title,
colormap=colormap)
Daniel Valdez
Adicion de la clase RTIPlot
r207 return
Miguel Valdez
-Se agrego la funcionalidad de replotear el grafico de RTI, ademas de los parametros timerange, xmin, xmax...
r210 self.__driver.pcolor(self.plot, z,
xlabel=xlabel,
ylabel=ylabel,
title=title)
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
def pcolorbuffer(self, x, y, z,
xmin=None, xmax=None,
ymin=None, ymax=None,
zmin=None, zmax=None,
xlabel='', ylabel='',
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 title='', rti = True, colormap='jet',
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 maxNumX = None, maxNumY = None,
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 **kwargs):
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 if maxNumX == None:
maxNumX = self.__MAXNUMX
if maxNumY == None:
maxNumY = self.__MAXNUMY
Daniel Valdez
Adicion de la clase RTIPlot
r207
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 if self.__firsttime:
self.z_buffer = z
self.x_buffer = numpy.hstack((self.x_buffer, x))
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)
if zmin == None: zmin = numpy.nanmin(z)
if zmax == None: zmax = numpy.nanmax(z)
self.plot = self.__driver.createPcolor(self.ax, self.x_buffer, y, z,
xmin, xmax,
ymin, ymax,
zmin, zmax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
colormap=colormap,
**kwargs)
if self.xmin == None: self.xmin = xmin
if self.xmax == None: self.xmax = xmax
if self.ymin == None: self.ymin = ymin
if self.ymax == None: self.ymax = ymax
if self.zmin == None: self.zmin = zmin
if self.zmax == None: self.zmax = zmax
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 self.__firsttime = False
return
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 self.x_buffer = numpy.hstack((self.x_buffer, x[-1]))
self.z_buffer = numpy.hstack((self.z_buffer, z))
if self.decimationx == None:
Daniel Valdez
r444 deltax = float(self.xmax - self.xmin)/maxNumX
Daniel Valdez
Bug Fixed: Calculo del delta en rango, el valor debe ser un float
r436 deltay = float(self.ymax - self.ymin)/maxNumY
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 resolutionx = self.x_buffer[2]-self.x_buffer[0]
Daniel Valdez
Optimizacion de graficos RTI y CoherenMap, aun no se aplican los cambios a las otras clases de ploteo....
r395 resolutiony = y[1]-y[0]
self.decimationx = numpy.ceil(deltax / resolutionx)
self.decimationy = numpy.ceil(deltay / resolutiony)
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
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 z_buffer = self.z_buffer.reshape(-1,len(y))
x_buffer = self.x_buffer[::self.decimationx]
y_buffer = y[::self.decimationy]
z_buffer = z_buffer[::self.decimationx, ::self.decimationy]
#===================================================
x_buffer, y_buffer, z_buffer = self.__fillGaps(x_buffer, y_buffer, z_buffer)
self.__driver.addpcolorbuffer(self.ax, x_buffer, y_buffer, z_buffer, self.zmin, self.zmax,
xlabel=xlabel,
ylabel=ylabel,
title=title,
colormap=colormap)
Julio Valdez
Processing Modules added:...
r502
def polar(self, x, y,
title='', xlabel='',ylabel='',**kwargs):
if self.__firsttime:
self.plot = self.__driver.createPolar(self.ax, x, y, title = title, xlabel = xlabel, ylabel = ylabel)
self.__firsttime = False
self.x_buffer = x
self.y_buffer = y
return
self.x_buffer = numpy.hstack((self.x_buffer,x))
self.y_buffer = numpy.hstack((self.y_buffer,y))
self.__driver.polar(self.plot, self.x_buffer, self.y_buffer, xlabel=xlabel,
ylabel=ylabel,
title=title)
Daniel Valdez
Correccion del Bug: Insertar gaps
r396 def __fillGaps(self, x_buffer, y_buffer, z_buffer):
deltas = x_buffer[1:] - x_buffer[0:-1]
x_median = numpy.median(deltas)
index = numpy.where(deltas >= 2*x_median)
if len(index[0]) != 0:
z_buffer[index[0],::] = self.__missing
z_buffer = numpy.ma.masked_inside(z_buffer,0.99*self.__missing,1.01*self.__missing)
return x_buffer, y_buffer, z_buffer
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
Daniel Valdez
Adicion de la clase RTIPlot
r207