##// END OF EJS Templates
Update README
Update README

File last commit:

r1285:7f395116f8a5
r1289:303db73c0c9d
Show More
jroplot_voltage.py
134 lines | 3.8 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
Daniel Valdez
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 @author: roj-idl71
'''
import os
Daniel Valdez
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 datetime
import numpy
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 from schainpy.model.graphics.jroplot_base import Plot, plt
George Yong
Multiprocessing for voltage (all operations) working
r1173
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285
class ScopePlot(Plot):
'''
Plot for Scope
'''
CODE = 'scope'
plot_name = 'Scope'
plot_type = 'scatter'
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 def setup(self):
self.xaxis = 'Range (Km)'
self.ncols = 1
self.nrows = 1
self.nplots = 1
self.ylabel = 'Intensity [dB]'
self.titles = ['Scope']
self.colorbar = False
self.width = 6
self.height = 4
def plot_iq(self, x, y, channelIndexList, thisDatetime, wintitle):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
yreal = y[channelIndexList,:].real
yimag = y[channelIndexList,:].imag
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 title = wintitle + " Scope: %s" %(thisDatetime.strftime("%d-%b-%Y"))
self.xlabel = "Range (Km)"
self.ylabel = "Intensity - IQ"
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 self.y = yreal
self.x = x
self.xmin = min(x)
self.xmax = max(x)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 self.titles[0] = title
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 for i,ax in enumerate(self.axes):
title = "Channel %d" %(i)
if ax.firsttime:
ax.plt_r = ax.plot(x, yreal[i,:], color='b')[0]
ax.plt_i = ax.plot(x, yimag[i,:], color='r')[0]
else:
ax.plt_r.set_data(x, yreal[i,:])
ax.plt_i.set_data(x, yimag[i,:])
def plot_power(self, x, y, channelIndexList, thisDatetime, wintitle):
Daniel Valdez
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 = y[channelIndexList,:] * numpy.conjugate(y[channelIndexList,:])
yreal = y.real
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 self.y = yreal
title = wintitle + " Scope: %s" %(thisDatetime.strftime("%d-%b-%Y"))
self.xlabel = "Range (Km)"
self.ylabel = "Intensity"
self.xmin = min(x)
self.xmax = max(x)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 self.titles[0] = title
for i,ax in enumerate(self.axes):
title = "Channel %d" %(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
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 ychannel = yreal[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
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 if ax.firsttime:
ax.plt_r = ax.plot(x, ychannel)[0]
else:
#pass
ax.plt_r.set_data(x, ychannel)
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 def plot(self):
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 if self.channels:
channels = self.channels
Daniel Valdez
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:
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 channels = self.data.channels
thisDatetime = datetime.datetime.utcfromtimestamp(self.data.times[-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
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 scope = self.data['scope']
Daniel Valdez
This is the new organization by packages and scripts for Signal Chain, this version contains new features and bugs fixed until August 2014
r487
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 if self.data.flagDataAsBlock:
Miguel Valdez
jroplot_voltage.py: New feature added. Support for plotting voltages when getByBlock is set.
r742
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 for i in range(self.data.nProfiles):
wintitle1 = " [Profile = %d] " %i
if self.type == "power":
self.plot_power(self.data.heights,
scope[:,i,:],
channels,
thisDatetime,
wintitle1
)
if self.type == "iq":
self.plot_iq(self.data.heights,
scope[:,i,:],
channels,
thisDatetime,
wintitle1
)
Miguel Valdez
jroplot_voltage.py: New feature added. Support for plotting voltages when getByBlock is set.
r742 else:
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 wintitle = " [Profile = %d] " %self.data.profileIndex
Miguel Valdez
jroplot_voltage.py: New feature added. Support for plotting voltages when getByBlock is set.
r742
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 if self.type == "power":
self.plot_power(self.data.heights,
scope,
channels,
thisDatetime,
wintitle
)
Miguel Valdez
jroplot_voltage.py: New feature added. Support for plotting voltages when getByBlock is set.
r742
Juan C. Espinoza
Update and fix plot modules #TODO: correlation & spectraheis
r1285 if self.type == "iq":
self.plot_iq(self.data.heights,
scope,
channels,
thisDatetime,
wintitle
)