@@ -96,19 +96,19 def createPline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='' | |||||
96 | printLabels(ax, xlabel, ylabel, title) |
|
96 | printLabels(ax, xlabel, ylabel, title) | |
97 |
|
97 | |||
98 | ###################################################### |
|
98 | ###################################################### | |
99 | if (xmax-xmin)<=1: |
|
99 | # if (xmax-xmin)<=1: | |
100 | xtickspos = numpy.linspace(xmin,xmax,nxticks) |
|
100 | # xtickspos = numpy.linspace(xmin,xmax,nxticks) | |
101 | xtickspos = numpy.array([float("%.1f"%i) for i in xtickspos]) |
|
101 | # xtickspos = numpy.array([float("%.1f"%i) for i in xtickspos]) | |
102 | ax.set_xticks(xtickspos) |
|
102 | # ax.set_xticks(xtickspos) | |
103 | else: |
|
103 | # else: | |
104 | xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin) |
|
104 | # xtickspos = numpy.arange(nxticks)*int((xmax-xmin)/(nxticks)) + int(xmin) | |
105 | ax.set_xticks(xtickspos) |
|
105 | # ax.set_xticks(xtickspos) | |
106 |
|
106 | # | ||
107 | for tick in ax.get_xticklabels(): |
|
107 | # for tick in ax.get_xticklabels(): | |
108 | tick.set_visible(xtick_visible) |
|
108 | # tick.set_visible(xtick_visible) | |
109 |
|
109 | # | ||
110 | for tick in ax.xaxis.get_major_ticks(): |
|
110 | # for tick in ax.xaxis.get_major_ticks(): | |
111 | tick.label.set_fontsize(ticksize) |
|
111 | # tick.label.set_fontsize(ticksize) | |
112 |
|
112 | |||
113 | ###################################################### |
|
113 | ###################################################### | |
114 | for tick in ax.get_yticklabels(): |
|
114 | for tick in ax.get_yticklabels(): | |
@@ -300,7 +300,7 def pmultiline(iplot, x, y, xlabel='', ylabel='', title=''): | |||||
300 |
|
300 | |||
301 | def createPmultilineYAxis(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
|
301 | def createPmultilineYAxis(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, | |
302 | ticksize=9, xtick_visible=True, ytick_visible=True, |
|
302 | ticksize=9, xtick_visible=True, ytick_visible=True, | |
303 |
nxticks=4, nyticks=10, marker=' |
|
303 | nxticks=4, nyticks=10, marker='+', markersize=8, linestyle="solid", | |
304 | grid=None, XAxisAsTime=False): |
|
304 | grid=None, XAxisAsTime=False): | |
305 |
|
305 | |||
306 | """ |
|
306 | """ | |
@@ -311,7 +311,8 def createPmultilineYAxis(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='' | |||||
311 |
|
311 | |||
312 | matplotlib.pyplot.ioff() |
|
312 | matplotlib.pyplot.ioff() | |
313 |
|
313 | |||
314 | lines = ax.plot(x, y.T, marker=marker,markersize=markersize,linestyle=linestyle) |
|
314 | # lines = ax.plot(x, y.T, marker=marker,markersize=markersize,linestyle=linestyle) | |
|
315 | lines = ax.plot(x, y.T, 'o', markersize=5) | |||
315 | leg = ax.legend(lines, legendlabels, loc='upper left', bbox_to_anchor=(1.01, 1.00), numpoints=1, handlelength=1.5, \ |
|
316 | leg = ax.legend(lines, legendlabels, loc='upper left', bbox_to_anchor=(1.01, 1.00), numpoints=1, handlelength=1.5, \ | |
316 | handletextpad=0.5, borderpad=0.5, labelspacing=0.5, borderaxespad=0.) |
|
317 | handletextpad=0.5, borderpad=0.5, labelspacing=0.5, borderaxespad=0.) | |
317 |
|
318 |
@@ -1022,6 +1022,7 class SpectraHeisScope(Figure): | |||||
1022 | self.HEIGHT = 250 |
|
1022 | self.HEIGHT = 250 | |
1023 | self.WIDTHPROF = 120 |
|
1023 | self.WIDTHPROF = 120 | |
1024 | self.HEIGHTPROF = 0 |
|
1024 | self.HEIGHTPROF = 0 | |
|
1025 | self.counterftp = 0 | |||
1025 |
|
1026 | |||
1026 | def getSubplots(self): |
|
1027 | def getSubplots(self): | |
1027 |
|
1028 | |||
@@ -1092,7 +1093,7 class SpectraHeisScope(Figure): | |||||
1092 |
|
1093 | |||
1093 | def run(self, dataOut, idfigure, wintitle="", channelList=None, |
|
1094 | def run(self, dataOut, idfigure, wintitle="", channelList=None, | |
1094 | xmin=None, xmax=None, ymin=None, ymax=None, save=False, |
|
1095 | xmin=None, xmax=None, ymin=None, ymax=None, save=False, | |
1095 | figpath='./', figfile=None): |
|
1096 | figpath='./', figfile=None, ftp=False, ftpratio=1): | |
1096 |
|
1097 | |||
1097 | """ |
|
1098 | """ | |
1098 |
|
1099 | |||
@@ -1165,6 +1166,12 class SpectraHeisScope(Figure): | |||||
1165 |
|
1166 | |||
1166 | self.saveFigure(figpath, figfile) |
|
1167 | self.saveFigure(figpath, figfile) | |
1167 |
|
1168 | |||
|
1169 | self.counterftp += 1 | |||
|
1170 | if (ftp and (self.counterftp==ftpratio)): | |||
|
1171 | figfilename = os.path.join(figpath,figfile) | |||
|
1172 | self.sendByFTP(figfilename) | |||
|
1173 | self.counterftp = 0 | |||
|
1174 | ||||
1168 |
|
1175 | |||
1169 | class RTIfromSpectraHeis(Figure): |
|
1176 | class RTIfromSpectraHeis(Figure): | |
1170 |
|
1177 | |||
@@ -1183,6 +1190,7 class RTIfromSpectraHeis(Figure): | |||||
1183 | self.HEIGHT = 200 |
|
1190 | self.HEIGHT = 200 | |
1184 | self.WIDTHPROF = 120 |
|
1191 | self.WIDTHPROF = 120 | |
1185 | self.HEIGHTPROF = 0 |
|
1192 | self.HEIGHTPROF = 0 | |
|
1193 | self.counterftp = 0 | |||
1186 | self.xdata = None |
|
1194 | self.xdata = None | |
1187 | self.ydata = None |
|
1195 | self.ydata = None | |
1188 |
|
1196 | |||
@@ -1215,7 +1223,7 class RTIfromSpectraHeis(Figure): | |||||
1215 | def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', |
|
1223 | def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True', | |
1216 | xmin=None, xmax=None, ymin=None, ymax=None, |
|
1224 | xmin=None, xmax=None, ymin=None, ymax=None, | |
1217 | timerange=None, |
|
1225 | timerange=None, | |
1218 | save=False, figpath='./', figfile=None): |
|
1226 | save=False, figpath='./', figfile=None, ftp=False, ftpratio=1): | |
1219 |
|
1227 | |||
1220 | if channelList == None: |
|
1228 | if channelList == None: | |
1221 | channelIndexList = dataOut.channelIndexList |
|
1229 | channelIndexList = dataOut.channelIndexList | |
@@ -1271,7 +1279,8 class RTIfromSpectraHeis(Figure): | |||||
1271 | self.setWinTitle(title) |
|
1279 | self.setWinTitle(title) | |
1272 |
|
1280 | |||
1273 |
|
1281 | |||
1274 | title = "RTI %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
1282 | # title = "RTI %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
|
1283 | title = "RTI-Noise - %s" %(thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |||
1275 |
|
1284 | |||
1276 | legendlabels = ["channel %d"%idchannel for idchannel in channelList] |
|
1285 | legendlabels = ["channel %d"%idchannel for idchannel in channelList] | |
1277 | axes = self.axesList[0] |
|
1286 | axes = self.axesList[0] | |
@@ -1286,7 +1295,7 class RTIfromSpectraHeis(Figure): | |||||
1286 |
|
1295 | |||
1287 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, |
|
1296 | axes.pmultilineyaxis(x=self.xdata, y=self.ydata, | |
1288 | xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, |
|
1297 | xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, | |
1289 |
xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker=' |
|
1298 | xlabel=xlabel, ylabel=ylabel, title=title, legendlabels=legendlabels, marker='.', markersize=8, linestyle="solid", | |
1290 | XAxisAsTime=True |
|
1299 | XAxisAsTime=True | |
1291 | ) |
|
1300 | ) | |
1292 |
|
1301 | |||
@@ -1299,6 +1308,12 class RTIfromSpectraHeis(Figure): | |||||
1299 |
|
1308 | |||
1300 | self.saveFigure(figpath, figfile) |
|
1309 | self.saveFigure(figpath, figfile) | |
1301 |
|
1310 | |||
|
1311 | self.counterftp += 1 | |||
|
1312 | if (ftp and (self.counterftp==ftpratio)): | |||
|
1313 | figfilename = os.path.join(figpath,figfile) | |||
|
1314 | self.sendByFTP(figfilename) | |||
|
1315 | self.counterftp = 0 | |||
|
1316 | ||||
1302 | if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax: |
|
1317 | if x[1] + (x[1]-x[0]) >= self.axesList[0].xmax: | |
1303 | self.__isConfig = False |
|
1318 | self.__isConfig = False | |
1304 | del self.xdata |
|
1319 | del self.xdata |
@@ -5,20 +5,22 sys.path.append(path) | |||||
5 |
|
5 | |||
6 | from controller import * |
|
6 | from controller import * | |
7 |
|
7 | |||
8 |
desc = " |
|
8 | desc = "Sun Experiment Test" | |
9 |
filename = " |
|
9 | filename = "sunexp.xml" | |
10 |
|
10 | |||
11 | controllerObj = Project() |
|
11 | controllerObj = Project() | |
12 |
|
12 | |||
13 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
13 | controllerObj.setup(id = '191', name='test01', description=desc) | |
14 |
|
14 | #/Users/dsuarez/Documents/RadarData/SunExperiment | ||
|
15 | #/Volumes/data_e/PaseDelSol/Raw/100KHZ | |||
15 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
16 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
16 |
path='/ |
|
17 | path='/Users/dsuarez/Documents/RadarData/SunExperiment', | |
17 | startDate='2013/02/06', |
|
18 | startDate='2013/02/06', | |
18 | endDate='2013/12/31', |
|
19 | endDate='2013/12/31', | |
19 |
startTime=' |
|
20 | startTime='00:30:00', | |
20 | endTime='17:40:59', |
|
21 | endTime='17:40:59', | |
21 | online=0, |
|
22 | online=0, | |
|
23 | delay=3, | |||
22 | walk=1) |
|
24 | walk=1) | |
23 |
|
25 | |||
24 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
26 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
@@ -31,27 +33,31 opObj11.addParameter(name='timeInterval', value='5', format='float') | |||||
31 | opObj11 = procUnitConfObj1.addOperation(name='SpectraHeisScope', optype='other') |
|
33 | opObj11 = procUnitConfObj1.addOperation(name='SpectraHeisScope', optype='other') | |
32 | opObj11.addParameter(name='idfigure', value='10', format='int') |
|
34 | opObj11.addParameter(name='idfigure', value='10', format='int') | |
33 | opObj11.addParameter(name='wintitle', value='SpectraHeisPlot', format='str') |
|
35 | opObj11.addParameter(name='wintitle', value='SpectraHeisPlot', format='str') | |
34 | opObj11.addParameter(name='ymin', value='125', format='int') |
|
36 | #opObj11.addParameter(name='ymin', value='125', format='int') | |
35 | opObj11.addParameter(name='ymax', value='140', format='int') |
|
37 | #opObj11.addParameter(name='ymax', value='140', format='int') | |
36 | #opObj11.addParameter(name='channelList', value='0,1,2', format='intlist') |
|
38 | #opObj11.addParameter(name='channelList', value='0,1,2', format='intlist') | |
37 | #opObj11.addParameter(name='showprofile', value='1', format='int') |
|
39 | #opObj11.addParameter(name='showprofile', value='1', format='int') | |
38 | opObj11.addParameter(name='save', value='1', format='bool') |
|
40 | opObj11.addParameter(name='save', value='1', format='bool') | |
|
41 | opObj11.addParameter(name='figfile', value='spc-noise.png', format='str') | |||
39 | opObj11.addParameter(name='figpath', value='/Users/dsuarez/Pictures/sun_pics', format='str') |
|
42 | opObj11.addParameter(name='figpath', value='/Users/dsuarez/Pictures/sun_pics', format='str') | |
40 |
|
43 | opObj11.addParameter(name='ftp', value='1', format='int') | ||
41 |
|
44 | opObj11.addParameter(name='ftpratio', value='10', format='int') | ||
42 | #opObj11 = procUnitConfObj1.addOperation(name='RTIfromSpectraHeis', optype='other') |
|
45 | ||
43 | #opObj11.addParameter(name='idfigure', value='6', format='int') |
|
46 | opObj11 = procUnitConfObj1.addOperation(name='RTIfromSpectraHeis', optype='other') | |
44 |
|
|
47 | opObj11.addParameter(name='idfigure', value='6', format='int') | |
45 |
|
|
48 | opObj11.addParameter(name='wintitle', value='RTIPLot', format='str') | |
46 |
|
|
49 | #opObj11.addParameter(name='zmin', value='10', format='int') | |
47 |
#opObj11.addParameter(name=' |
|
50 | #opObj11.addParameter(name='zmax', value='40', format='int') | |
48 |
|
|
51 | opObj11.addParameter(name='ymin', value='60', format='int') | |
49 |
|
|
52 | opObj11.addParameter(name='ymax', value='85', format='int') | |
|
53 | #opObj11.addParameter(name='channelList', value='0,1,2,3', format='intlist') | |||
50 | #opObj11.addParameter(name='timerange', value='600', format='int') |
|
54 | #opObj11.addParameter(name='timerange', value='600', format='int') | |
51 |
|
|
55 | #opObj11.addParameter(name='showprofile', value='0', format='int') | |
52 |
|
|
56 | opObj11.addParameter(name='save', value='1', format='bool') | |
53 |
|
|
57 | opObj11.addParameter(name='figfile', value='rti-noise.png', format='str') | |
54 |
|
58 | opObj11.addParameter(name='figpath', value='/Users/dsuarez/Pictures/sun_pics', format='str') | ||
|
59 | opObj11.addParameter(name='ftp', value='1', format='int') | |||
|
60 | opObj11.addParameter(name='ftpratio', value='10', format='int') | |||
55 |
|
61 | |||
56 |
|
62 | |||
57 | print "Escribiendo el archivo XML" |
|
63 | print "Escribiendo el archivo XML" |
General Comments 0
You need to be logged in to leave comments.
Login now