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