##// END OF EJS Templates
Hot fix
Hot fix

File last commit:

r1136:11af635bee3e
r1166:ce0987c48654
Show More
jroplot_spectra.py
1542 lines | 48.6 KiB | text/x-python | PythonLexer
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 '''
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 Created on Jul 9, 2014
@author: roj-idl71
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 '''
import os
import datetime
import numpy
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 from figure import Figure, isRealtime, isTimeInHourRange
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 from plotting_codes import *
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
José Chávez
algunos cambios en roj
r953
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class SpectraPlot(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 isConfig = None
__nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'spc'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = False
self.__nsubplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
size of spectra plots = 250 again
r1136 self.WIDTH = 250
self.HEIGHT = 250
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = SPEC_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.__xfilter_ena = False
self.__yfilter_ena = False
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncol = int(numpy.sqrt(self.nplots)+0.9)
nrow = int(self.nplots*1./ncol + 0.9)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, showprofile=True, show=True):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 3
colspan = 2
self.__nsubplots = 2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
heightplot = self.HEIGHT + self.HEIGHTPROF,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter = 0
for y in range(nrow):
for x in range(ncol):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if counter >= self.nplots:
break
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter += 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 run(self, dataOut, id, wintitle="", channelList=None, showprofile=True,
xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 server=None, folder=None, username=None, password=None,
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, realtime=False,
ebocanegra
first commit
r965 xaxis="frequency", colormap='jet', normFactor=None):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 """
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 Input:
dataOut :
id :
wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
if realtime:
if not(isRealtime(utcdatatime = dataOut.utctime)):
print 'Skipping this plot function'
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if channelList == None:
channelIndexList = dataOut.channelIndexList
else:
channelIndexList = []
for channel in channelList:
if channel not in dataOut.channelList:
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 raise ValueError, "Channel %d is not in dataOut.channelList" %channel
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 channelIndexList.append(dataOut.channelList.index(channel))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
ebocanegra
first commit
r965 if normFactor is None:
factor = dataOut.normFactor
else:
factor = normFactor
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 if xaxis == "frequency":
x = dataOut.getFreqRange(1)/1000.
Miguel Valdez
r825 xlabel = "Frequency (kHz)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 elif xaxis == "time":
x = dataOut.getAcfRange(1)
xlabel = "Time (ms)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 else:
x = dataOut.getVelRange(1)
xlabel = "Velocity (m/s)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 ylabel = "Range (Km)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 y = dataOut.getHeiRange()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 z = dataOut.data_spc/factor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 zdB = 10*numpy.log10(z)
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568
Miguel Valdez
Bug fixed in SchainGUI: figures were not been loaded
r583 avg = numpy.average(z, axis=1)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 avgdB = 10*numpy.log10(avg)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 noise = dataOut.getNoise()/factor
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 noisedB = 10*numpy.log10(noise)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 title = wintitle + " Spectra"
Daniel Valdez
Filtering AMISR files for Datetime Range...
r499 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = len(channelIndexList)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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)
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3
if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for i in range(self.nplots):
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 index = channelIndexList[i]
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 title = "Channel %d: %4.2fdB: %s" %(dataOut.channelList[index], noisedB[index], str_datetime)
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501 if len(dataOut.beam.codeList) != 0:
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 title = "Ch%d:%4.2fdB,%2.2f,%2.2f:%s" %(dataOut.channelList[index], noisedB[index], dataOut.beam.azimuthList[index], dataOut.beam.zenithList[index], str_datetime)
Daniel Valdez
ProfileToChannels this is a new Operation to get data with dimensions [nchannels,nsamples]
r501
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes = self.axesList[i*self.__nsubplots]
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 axes.pcolor(x, y, zdB[index,:,:],
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 xlabel=xlabel, ylabel=ylabel, title=title, colormap=colormap,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ticksize=9, cblabel='')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.__showprofile:
axes = self.axesList[i*self.__nsubplots +1]
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 axes.pline(avgdB[index,:], y,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
xlabel='dB', ylabel='', title='',
ytick_visible=False,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 noiseline = numpy.repeat(noisedB[index], len(y))
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 if figfile == None:
str_datetime = thisDatetime.strftime("%Y%m%d_%H%M%S")
name = str_datetime
if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 name = name + '_az' + '_%2.2f'%(dataOut.azimuth) + '_zn' + '_%2.2f'%(dataOut.zenith)
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 figfile = self.getFilename(name)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime)
Daniel Valdez
new utils package:jroutils, jroutils_ftp...
r488
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class CrossSpectraPlot(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 isConfig = None
__nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 WIDTH = None
HEIGHT = None
WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'cspc'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = False
self.__nsubplots = 4
self.counter_imagwr = 0
self.WIDTH = 250
self.HEIGHT = 250
self.WIDTHPROF = 0
self.HEIGHTPROF = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = CROSS_CODE
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncol = 4
nrow = self.nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, showprofile=True, show=True):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 1
colspan = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
heightplot = self.HEIGHT + self.HEIGHTPROF,
show=True)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter = 0
for y in range(nrow):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 for x in range(ncol):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter += 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
def run(self, dataOut, id, wintitle="", pairsList=None,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Miguel Valdez
Signal Chain GUI...
r600 coh_min=None, coh_max=None, phase_min=None, phase_max=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, ftp=False, wr_period=1,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True,
server=None, folder=None, username=None, password=None,
ebocanegra
first commit
r965 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, normFactor=None,
Miguel Valdez
r825 xaxis='frequency'):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 """
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 Input:
dataOut :
id :
wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if pairsList == None:
pairsIndexList = dataOut.pairsIndexList
else:
pairsIndexList = []
for pair in pairsList:
if pair not in dataOut.pairsList:
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 raise ValueError, "Pair %s is not in dataOut.pairsList" %str(pair)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 pairsIndexList.append(dataOut.pairsList.index(pair))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Signal Chain GUI updated:...
r587 if not pairsIndexList:
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if len(pairsIndexList) > 4:
pairsIndexList = pairsIndexList[0:4]
ebocanegra
first commit
r965
if normFactor is None:
factor = dataOut.normFactor
else:
factor = normFactor
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 x = dataOut.getVelRange(1)
y = dataOut.getHeiRange()
z = dataOut.data_spc[:,:,:]/factor
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed: crossSpectraPlot, noise variable was called as method "noise()"
r525 noise = dataOut.noise/factor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 zdB = 10*numpy.log10(z)
noisedB = 10*numpy.log10(noise)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Signal Chain GUI...
r600 if coh_min == None:
coh_min = 0.0
if coh_max == None:
coh_max = 1.0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Signal Chain GUI...
r600 if phase_min == None:
phase_min = -180
if phase_max == None:
phase_max = 180
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 #thisDatetime = dataOut.datatime
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = wintitle + " Cross-Spectra: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Miguel Valdez
r825 # xlabel = "Velocity (m/s)"
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ylabel = "Range (Km)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r825 if xaxis == "frequency":
x = dataOut.getFreqRange(1)/1000.
xlabel = "Frequency (kHz)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r825 elif xaxis == "time":
x = dataOut.getAcfRange(1)
xlabel = "Time (ms)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r825 else:
x = dataOut.getVelRange(1)
xlabel = "Velocity (m/s)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = len(pairsIndexList)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=False,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 avg = numpy.abs(numpy.average(z, axis=1))
avgdB = 10*numpy.log10(avg)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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)
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3
if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for i in range(self.nplots):
pair = dataOut.pairsList[pairsIndexList[i]]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 chan_index0 = dataOut.channelList.index(pair[0])
chan_index1 = dataOut.channelList.index(pair[1])
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S"))
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 title = "Ch%d: %4.2fdB: %s" %(pair[0], noisedB[chan_index0], str_datetime)
zdB = 10.*numpy.log10(dataOut.data_spc[chan_index0,:,:]/factor)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes0 = self.axesList[i*self.__nsubplots]
axes0.pcolor(x, y, zdB,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title,
ticksize=9, colormap=power_cmap, cblabel='')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 title = "Ch%d: %4.2fdB: %s" %(pair[1], noisedB[chan_index1], str_datetime)
zdB = 10.*numpy.log10(dataOut.data_spc[chan_index1,:,:]/factor)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes0 = self.axesList[i*self.__nsubplots+1]
axes0.pcolor(x, y, zdB,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title,
ticksize=9, colormap=power_cmap, cblabel='')
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 coherenceComplex = dataOut.data_cspc[pairsIndexList[i],:,:]/numpy.sqrt(dataOut.data_spc[chan_index0,:,:]*dataOut.data_spc[chan_index1,:,:])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 coherence = numpy.abs(coherenceComplex)
# phase = numpy.arctan(-1*coherenceComplex.imag/coherenceComplex.real)*180/numpy.pi
phase = numpy.arctan2(coherenceComplex.imag, coherenceComplex.real)*180/numpy.pi
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = "Coherence Ch%d * Ch%d" %(pair[0], pair[1])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes0 = self.axesList[i*self.__nsubplots+2]
axes0.pcolor(x, y, coherence,
Miguel Valdez
Signal Chain GUI...
r600 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=coh_min, zmax=coh_max,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xlabel=xlabel, ylabel=ylabel, title=title,
ticksize=9, colormap=coherence_cmap, cblabel='')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = "Phase Ch%d * Ch%d" %(pair[0], pair[1])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes0 = self.axesList[i*self.__nsubplots+3]
axes0.pcolor(x, y, phase,
Miguel Valdez
Signal Chain GUI...
r600 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xlabel=xlabel, ylabel=ylabel, title=title,
ticksize=9, colormap=phase_cmap, cblabel='')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 thisDatetime=thisDatetime)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Daniel Valdez
Fixing PNG File Storage...
r494
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class RTIPlot(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Julio Valdez
Bug fixed in RTI and Wind Profiler Plots, when data time exceeded the xmax, the new plot generated was overwriting the first one.
r509 __isConfig = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 __nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'rti'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 Figure.__init__(self, **kwargs)
Miguel Valdez
r577 self.timerange = None
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = False
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__nsubplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTH = 800
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 self.HEIGHT = 180
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = RTI_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 self.tmin = None
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.tmax = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.xmin = None
self.xmax = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
rti png filename is defined by self.figfile
r490 self.figfile = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncol = 1
nrow = self.nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, showprofile=True, show=True):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 7
colspan = 6
self.__nsubplots = 2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
heightplot = self.HEIGHT + self.HEIGHTPROF,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter = 0
for y in range(nrow):
for x in range(ncol):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if counter >= self.nplots:
break
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter += 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
ebocanegra
first commit
r965 timerange=None, colormap='jet',
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', lastone=0,figfile=None, ftp=False, wr_period=1, show=True,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 server=None, folder=None, username=None, password=None,
ebocanegra
15/08/2017
r1001 ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, normFactor=None, HEIGHT=None):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 """
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 Input:
dataOut :
id :
wintitle :
channelList :
showProfile :
xmin : None,
xmax : None,
ymin : None,
ymax : None,
zmin : None,
zmax : None
"""
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
ebocanegra
15/08/2017
r1001 #colormap = kwargs.get('colormap', 'jet')
if HEIGHT is not None:
self.HEIGHT = HEIGHT
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
ebocanegra
first commit
r965 if normFactor is None:
Julio Valdez
-Parameters Plot corrected...
r832 factor = dataOut.normFactor
else:
ebocanegra
first commit
r965 factor = normFactor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Julio Valdez
-Parameters Plot corrected...
r832 # factor = dataOut.normFactor
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
ebocanegra
first commit
r965 z = dataOut.data_spc/factor
z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
avg = numpy.average(z, axis=1)
avgdB = 10.*numpy.log10(avg)
# avgdB = dataOut.getPower()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 thisDatetime = dataOut.datatime
# thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = wintitle + " RTI" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = ""
ylabel = "Range (Km)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = False
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Time-window option added to GUI
r816 if dataOut.ltctime >= self.xmax:
self.counter_imagwr = wr_period
self.isConfig = False
update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = len(channelIndexList)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange != None:
self.timerange = timerange
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 noise = dataOut.noise/factor
noisedB = 10*numpy.log10(noise)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if zmin == None: zmin = numpy.floor(numpy.nanmin(noisedB)) - 3
if zmax == None: zmax = numpy.ceil(numpy.nanmax(avgdB)) + 3
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = True
Daniel Valdez
rti png filename is defined by self.figfile
r490 self.figfile = figfile
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for i in range(self.nplots):
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 index = channelIndexList[i]
title = "Channel %d: %s" %(dataOut.channelList[index], thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
Daniel Valdez
Filtering AMISR files for Datetime Range...
r499 if ((dataOut.azimuth!=None) and (dataOut.zenith!=None)):
title = title + '_' + 'azimuth,zenith=%2.2f,%2.2f'%(dataOut.azimuth, dataOut.zenith)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes = self.axesList[i*self.__nsubplots]
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 zdB = avgdB[index].reshape((1,-1))
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes.pcolorbuffer(x, y, zdB,
xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 ticksize=9, cblabel='', cbsize="1%", colormap=colormap)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.__showprofile:
axes = self.axesList[i*self.__nsubplots +1]
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 axes.pline(avgdB[index], y,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
xlabel='dB', ylabel='', title='',
ytick_visible=False,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime,
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile=update_figfile)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
class CoherenceMap(Figure):
isConfig = None
__nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'cmap'
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.timerange = 2*60*60
self.isConfig = False
self.__nsubplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTH = 800
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 self.HEIGHT = 180
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = COH_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.xmin = None
self.xmax = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
ncol = 1
nrow = self.nplots*2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, showprofile=True, show=True):
self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 1
colspan = 1
if showprofile:
ncolspan = 7
colspan = 6
self.__nsubplots = 2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH + self.WIDTHPROF,
heightplot = self.HEIGHT + self.HEIGHTPROF,
show=True)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for y in range(nrow):
for x in range(ncol):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if showprofile:
self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan+colspan, 1, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 timerange=None, phase_min=None, phase_max=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, ftp=False, wr_period=1,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 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):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if pairsIndexList == []:
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if len(pairsIndexList) > 4:
pairsIndexList = pairsIndexList[0:4]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 if phase_min == None:
phase_min = -180
if phase_max == None:
phase_max = 180
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 x = dataOut.getTimeRange()
y = dataOut.getHeiRange()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 thisDatetime = dataOut.datatime
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = wintitle + " CoherenceMap" #: %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = ""
ylabel = "Range (Km)"
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = False
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
if not self.isConfig:
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = len(pairsIndexList)
self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange != None:
self.timerange = timerange
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug plotting RTI fixed for jroplot_heispectra, jroplot_parameters, jroplot_spectra
r567 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
if zmin == None: zmin = 0.
if zmax == None: zmax = 1.
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = True
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 for i in range(self.nplots):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 pair = dataOut.pairsList[pairsIndexList[i]]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 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)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 avgcoherenceComplex = ccf/numpy.sqrt(powa*powb)
coherence = numpy.abs(avgcoherenceComplex)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 z = coherence.reshape((1,-1))
counter = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = "Coherence Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes = self.axesList[i*self.__nsubplots*2]
axes.pcolorbuffer(x, y, z,
xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax,
xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
ticksize=9, cblabel='', colormap=coherence_cmap, cbsize="1%")
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.__showprofile:
counter += 1
axes = self.axesList[i*self.__nsubplots*2 + counter]
axes.pline(coherence, y,
xmin=zmin, xmax=zmax, ymin=ymin, ymax=ymax,
xlabel='', ylabel='', title='', ticksize=7,
ytick_visible=False, nxticks=5,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter += 1
Daniel Valdez
new utils package:jroutils, jroutils_ftp...
r488
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi
Daniel Valdez
new utils package:jroutils, jroutils_ftp...
r488
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 z = phase.reshape((1,-1))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = "Phase Ch%d * Ch%d: %s" %(pair[0], pair[1], thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes = self.axesList[i*self.__nsubplots*2 + counter]
axes.pcolorbuffer(x, y, z,
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=phase_min, zmax=phase_max,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,
ticksize=9, cblabel='', colormap=phase_cmap, cbsize="1%")
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if self.__showprofile:
counter += 1
axes = self.axesList[i*self.__nsubplots*2 + counter]
axes.pline(phase, y,
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 xmin=phase_min, xmax=phase_max, ymin=ymin, ymax=ymax,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xlabel='', ylabel='', title='', ticksize=7,
ytick_visible=False, nxticks=4,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if dataOut.ltctime >= self.xmax:
Daniel Valdez
new utils package:jroutils, jroutils_ftp...
r488 self.counter_imagwr = wr_period
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = False
update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime,
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile=update_figfile)
Daniel Valdez
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
r577 class PowerProfilePlot(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 isConfig = None
__nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'spcprofile'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.isConfig = False
self.__nsubplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = POWER_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTH = 300
self.HEIGHT = 500
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
ncol = 1
nrow = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, show):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 1
colspan = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH,
heightplot = self.HEIGHT,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 counter = 0
for y in range(nrow):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 for x in range(ncol):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 run(self, dataOut, id, wintitle="", channelList=None,
xmin=None, xmax=None, ymin=None, ymax=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, show=True,
ftp=False, wr_period=1, server=None,
folder=None, username=None, password=None):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 factor = dataOut.normFactor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 y = dataOut.getHeiRange()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 #for 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)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 #for spectra
if dataOut.type == 'Spectra':
x = dataOut.data_spc[channelIndexList,:,:]/factor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 x = numpy.where(numpy.isfinite(x), x, numpy.NAN)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 x = numpy.average(x, axis=1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xdB = 10*numpy.log10(x)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = wintitle + " Power Profile %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = "dB"
ylabel = "Range (Km)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if ymin == None: ymin = numpy.nanmin(y)
if ymax == None: ymax = numpy.nanmax(y)
if xmin == None: xmin = numpy.nanmin(xdB)*0.9
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if xmax == None: xmax = numpy.nanmax(xdB)*1.1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = "Power Profile: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
axes = self.axesList[0]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 legendlabels = ["channel %d"%x for x in channelList]
axes.pmultiline(xdB, y,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels,
ytick_visible=True, nxticks=5,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime)
Daniel Valdez
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
SpectraCutPlot added to jrospectra_plot....
r766 class SpectraCutPlot(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 isConfig = None
__nsubplots = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 WIDTHPROF = None
HEIGHTPROF = None
PREFIX = 'spc_cut'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.isConfig = False
self.__nsubplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.PLOT_CODE = POWER_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.WIDTH = 700
self.HEIGHT = 500
self.counter_imagwr = 0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 def getSubplots(self):
ncol = 1
nrow = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 def setup(self, id, nplots, wintitle, show):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 ncolspan = 1
colspan = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH,
heightplot = self.HEIGHT,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 counter = 0
for y in range(nrow):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 for x in range(ncol):
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.addAxes(nrow, ncol*ncolspan, y, x*ncolspan, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 def run(self, dataOut, id, wintitle="", channelList=None,
xmin=None, xmax=None, ymin=None, ymax=None,
save=False, figpath='./', figfile=None, show=True,
ftp=False, wr_period=1, server=None,
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 folder=None, username=None, password=None,
Miguel Valdez
r825 xaxis="frequency"):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 factor = dataOut.normFactor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 y = dataOut.getHeiRange()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 z = dataOut.data_spc/factor
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
Ivan Valdez
r788 hei_index = numpy.arange(25)*3 + 20
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 if xaxis == "frequency":
x = dataOut.getFreqRange()/1000.
zdB = 10*numpy.log10(z[0,:,hei_index])
Ivan Valdez
r788 xlabel = "Frequency (kHz)"
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 ylabel = "Power (dB)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 elif xaxis == "time":
x = dataOut.getAcfRange()
zdB = z[0,:,hei_index]
xlabel = "Time (ms)"
ylabel = "ACF"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 else:
x = dataOut.getVelRange()
zdB = 10*numpy.log10(z[0,:,hei_index])
xlabel = "Velocity (m/s)"
ylabel = "Power (dB)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0])
Miguel Valdez
jroplot_spectra: xaxis can be frequency, velocity or time.
r777 title = wintitle + " Range Cuts %s" %(thisDatetime.strftime("%d-%b-%Y"))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 nplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 if xmin == None: xmin = numpy.nanmin(x)*0.9
if xmax == None: xmax = numpy.nanmax(x)*1.1
if ymin == None: ymin = numpy.nanmin(zdB)
if ymax == None: ymax = numpy.nanmax(zdB)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.isConfig = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 title = "Spectra Cuts: %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
axes = self.axesList[0]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 legendlabels = ["Range = %dKm" %y[i] for i in hei_index]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 axes.pmultilineyaxis( x, zdB,
xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels,
ytick_visible=True, nxticks=5,
grid='x')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
SpectraCutPlot added to jrospectra_plot....
r766 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 class Noise(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 isConfig = None
__nsubplots = None
PREFIX = 'noise'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
ebocanegra
first commit
r965
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.timerange = 24*60*60
self.isConfig = False
self.__nsubplots = 1
self.counter_imagwr = 0
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.WIDTH = 800
self.HEIGHT = 400
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.xdata = None
self.ydata = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = NOISE_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Daniel Valdez
Fixing PNG File Storage...
r494 self.figfile = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.xmin = None
self.xmax = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 getSubplots(self):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncol = 1
nrow = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 openfile(self, filename):
Miguel Valdez
r577 dirname = os.path.dirname(filename)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r577 if not os.path.exists(dirname):
os.mkdir(dirname)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
f = open(filename,'w+')
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 f.write('\n\n')
f.write('JICAMARCA RADIO OBSERVATORY - Noise \n')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 f.write('DD MM YYYY HH MM SS Channel0 Channel1 Channel2 Channel3\n\n' )
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 f.close()
def save_data(self, filename_phase, data, data_datetime):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 f=open(filename_phase,'a')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 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)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r577 data_msg = ''
for i in range(len(data)):
data_msg += str(data[i]) + ' '
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
r577 f.write(day+' '+month+' '+year+' '+hour+' '+minute+' '+second+' ' + data_msg + '\n')
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 f.close()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 setup(self, id, nplots, wintitle, showprofile=True, show=True):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 ncolspan = 7
colspan = 6
self.__nsubplots = 2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH+self.WIDTHPROF,
heightplot = self.HEIGHT+self.HEIGHTPROF,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
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 run(self, dataOut, id, wintitle="", channelList=None, showprofile='True',
xmin=None, xmax=None, ymin=None, ymax=None,
timerange=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 x = dataOut.getTimeRange()
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 #y = dataOut.getHeiRange()
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 factor = dataOut.normFactor
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 noise = dataOut.noise[channelIndexList]/factor
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 noisedB = 10*numpy.log10(noise)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 thisDatetime = dataOut.datatime
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = wintitle + " Noise" # : %s" %(thisDatetime.strftime("%d-%b-%Y"))
xlabel = ""
ylabel = "Intensity (dB)"
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = False
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 nplots = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange != None:
self.timerange = timerange
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if ymin == None: ymin = numpy.floor(numpy.nanmin(noisedB)) - 10.0
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if ymax == None: ymax = numpy.nanmax(noisedB) + 10.0
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
self.isConfig = True
Daniel Valdez
Fixing PNG File Storage...
r494 self.figfile = figfile
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.xdata = numpy.array([])
self.ydata = numpy.array([])
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 #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)
Miguel Valdez
Bug fixed: Error saving noise data, noise_path was not being created.
r647
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 title = "Noise %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Channel title was fixed in plots
r713 legendlabels = ["channel %d"%(idchannel) for idchannel in channelList]
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes = self.axesList[0]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.xdata = numpy.hstack((self.xdata, x[0:1]))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 if len(self.ydata)==0:
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 self.ydata = noisedB.reshape(-1,1)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 else:
Miguel Valdez
Bugs fixed selecting channels in jroplot_spectra.py
r731 self.ydata = numpy.hstack((self.ydata, noisedB.reshape(-1,1)))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax,
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid",
XAxisAsTime=True, grid='both'
)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if dataOut.ltctime >= self.xmax:
Daniel Valdez
Fixing PNG File Storage...
r494 self.counter_imagwr = wr_period
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = False
update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime,
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile=update_figfile)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed: Error saving noise data, noise_path was not being created.
r647 #store data beacon phase
if save:
self.save_data(self.filename_noise, noisedB, thisDatetime)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 class BeaconPhase(Figure):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 __isConfig = None
__nsubplots = None
PREFIX = 'beacon_phase'
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
José Chávez
cambiados los kwargs para cada operacion/unidad de procesamiento
r897 def __init__(self, **kwargs):
Figure.__init__(self, **kwargs)
Daniel Valdez
Fixing PNG File Storage...
r494 self.timerange = 24*60*60
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = False
Daniel Valdez
Fixing PNG File Storage...
r494 self.__nsubplots = 1
self.counter_imagwr = 0
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.WIDTH = 800
self.HEIGHT = 400
Daniel Valdez
Fixing PNG File Storage...
r494 self.WIDTHPROF = 120
self.HEIGHTPROF = 0
self.xdata = None
self.ydata = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.PLOT_CODE = BEACON_CODE
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.FTP_WEI = None
self.EXP_CODE = None
self.SUB_EXP_CODE = None
self.PLOT_POS = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.filename_phase = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.figfile = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.xmin = None
self.xmax = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 def getSubplots(self):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 ncol = 1
nrow = 1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 return nrow, ncol
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 def setup(self, id, nplots, wintitle, showprofile=True, show=True):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.__showprofile = showprofile
self.nplots = nplots
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 ncolspan = 7
colspan = 6
self.__nsubplots = 2
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.createFigure(id = id,
wintitle = wintitle,
widthplot = self.WIDTH+self.WIDTHPROF,
heightplot = self.HEIGHT+self.HEIGHTPROF,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 nrow, ncol = self.getSubplots()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.addAxes(nrow, ncol*ncolspan, 0, 0, colspan, 1)
def save_phase(self, filename_phase):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 f = open(filename_phase,'w+')
Daniel Valdez
Fixing PNG File Storage...
r494 f.write('\n\n')
f.write('JICAMARCA RADIO OBSERVATORY - Beacon Phase \n')
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858 f.write('DD MM YYYY HH MM SS pair(2,0) pair(2,1) pair(2,3) pair(2,4)\n\n' )
Daniel Valdez
Fixing PNG File Storage...
r494 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()
def run(self, dataOut, id, wintitle="", pairsList=None, showprofile='True',
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 xmin=None, xmax=None, ymin=None, ymax=None, hmin=None, hmax=None,
Daniel Valdez
Fixing PNG File Storage...
r494 timerange=None,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 save=False, figpath='./', figfile=None, show=True, ftp=False, wr_period=1,
Daniel Valdez
Fixing PNG File Storage...
r494 server=None, folder=None, username=None, password=None,
ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0):
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 if pairsList == None:
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 pairsIndexList = dataOut.pairsIndexList[:10]
Daniel Valdez
Fixing PNG File Storage...
r494 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))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 if pairsIndexList == []:
return
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 # if len(pairsIndexList) > 4:
# pairsIndexList = pairsIndexList[0:4]
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760
hmin_index = None
hmax_index = None
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if hmin != None and hmax != None:
indexes = numpy.arange(dataOut.nHeights)
hmin_list = indexes[dataOut.heightList >= hmin]
hmax_list = indexes[dataOut.heightList <= hmax]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if hmin_list.any():
hmin_index = hmin_list[0]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if hmax_list.any():
hmax_index = hmax_list[-1]+1
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 x = dataOut.getTimeRange()
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 #y = dataOut.getHeiRange()
Daniel Valdez
Fixing PNG File Storage...
r494
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 thisDatetime = dataOut.datatime
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = wintitle + " Signal Phase" # : %s" %(thisDatetime.strftime("%d-%b-%Y"))
Daniel Valdez
Fixing PNG File Storage...
r494 xlabel = "Local Time"
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 ylabel = "Phase (degrees)"
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = False
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 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]]
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 ccf = numpy.average(dataOut.data_cspc[pairsIndexList[i], :, hmin_index:hmax_index], axis=0)
powa = numpy.average(dataOut.data_spc[pair[0], :, hmin_index:hmax_index], axis=0)
powb = numpy.average(dataOut.data_spc[pair[1], :, hmin_index:hmax_index], axis=0)
Daniel Valdez
Fixing PNG File Storage...
r494 avgcoherenceComplex = ccf/numpy.sqrt(powa*powb)
phase = numpy.arctan2(avgcoherenceComplex.imag, avgcoherenceComplex.real)*180/numpy.pi
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 #print "Phase %d%d" %(pair[0], pair[1])
#print phase[dataOut.beacon_heiIndexList]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if dataOut.beacon_heiIndexList:
phase_beacon[i] = numpy.average(phase[dataOut.beacon_heiIndexList])
else:
phase_beacon[i] = numpy.average(phase)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if not self.isConfig:
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 nplots = len(pairsIndexList)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.setup(id=id,
nplots=nplots,
wintitle=wintitle,
showprofile=showprofile,
show=show)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 if timerange != None:
self.timerange = timerange
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 self.xmin, self.xmax = self.getTimeLim(x, xmin, xmax, timerange)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if ymin == None: ymin = 0
if ymax == None: ymax = 360
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.FTP_WEI = ftp_wei
self.EXP_CODE = exp_code
self.SUB_EXP_CODE = sub_exp_code
self.PLOT_POS = plot_pos
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.name = thisDatetime.strftime("%Y%m%d_%H%M%S")
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = True
Daniel Valdez
Fixing PNG File Storage...
r494 self.figfile = figfile
self.xdata = numpy.array([])
self.ydata = numpy.array([])
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 #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)
#self.save_phase(self.filename_phase)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 #store data beacon phase
#self.save_data(self.filename_phase, phase_beacon, thisDatetime)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.setWinTitle(title)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 title = "Phase Plot %s" %(thisDatetime.strftime("%Y/%m/%d %H:%M:%S"))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 legendlabels = ["Pair (%d,%d)"%(pair[0], pair[1]) for pair in dataOut.pairsList]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 axes = self.axesList[0]
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.xdata = numpy.hstack((self.xdata, x[0:1]))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 if len(self.ydata)==0:
self.ydata = phase_beacon.reshape(-1,1)
else:
self.ydata = numpy.hstack((self.ydata, phase_beacon.reshape(-1,1)))
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 axes.pmultilineyaxis(x=self.xdata, y=self.ydata,
Miguel Valdez
Merge with branch schain_julia_drifts from rev. 803 to 995....
r568 xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax,
Daniel Valdez
Fixing PNG File Storage...
r494 xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='x', markersize=8, linestyle="solid",
XAxisAsTime=True, grid='both'
)
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Daniel Valdez
Fixing PNG File Storage...
r494 self.draw()
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 if dataOut.ltctime >= self.xmax:
Daniel Valdez
Fixing PNG File Storage...
r494 self.counter_imagwr = wr_period
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 self.isConfig = False
update_figfile = True
Juan C. Valdez
Add colormap parameter for spectra and RTI, create jro colormap, plot masked arrays
r858
Miguel Valdez
A new SendToServer Unit has been created to upload files to a remote server....
r573 self.save(figpath=figpath,
figfile=figfile,
save=save,
ftp=ftp,
wr_period=wr_period,
thisDatetime=thisDatetime,
Miguel Valdez
Bug fixed plotting RTI, CoherenceMap, Noise and BeaconPhase: It were not working properly when xmin and xmax were defined and more than one day selected.
r760 update_figfile=update_figfile)