##// END OF EJS Templates
metodo selectChannels agreagado
Miguel Valdez -
r157:e184df9026b3
parent child
Show More
@@ -96,7 +96,7 class VoltageProcessor:
96 thisdatetime = datetime.datetime.fromtimestamp(self.dataOutObj.utctime)
96 thisdatetime = datetime.datetime.fromtimestamp(self.dataOutObj.utctime)
97 dateTime = "%s"%(thisdatetime.strftime("%d-%b-%Y %H:%M:%S"))
97 dateTime = "%s"%(thisdatetime.strftime("%d-%b-%Y %H:%M:%S"))
98 date = "%s"%(thisdatetime.strftime("%d-%b-%Y"))
98 date = "%s"%(thisdatetime.strftime("%d-%b-%Y"))
99
99 print thisdatetime
100 figuretitle = "RTI Plot Radar Data" #+ date
100 figuretitle = "RTI Plot Radar Data" #+ date
101
101
102 plotObj = self.plotObjList[self.plotObjIndex]
102 plotObj = self.plotObjList[self.plotObjIndex]
@@ -168,7 +168,7 class VoltageProcessor:
168 dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
168 dateTime = "%s"%(thisDatetime.strftime("%d-%b-%Y %H:%M:%S"))
169 date = "%s"%(thisDatetime.strftime("%d-%b-%Y"))
169 date = "%s"%(thisDatetime.strftime("%d-%b-%Y"))
170
170
171 figureTitle = "Scope Plot Radar Data: " + date
171 figuretitle = "Scope Plot Radar Data: " + date
172
172
173 plotObj = self.plotObjList[self.plotObjIndex]
173 plotObj = self.plotObjList[self.plotObjIndex]
174
174
@@ -179,7 +179,7 class VoltageProcessor:
179 xmax=xmax,
179 xmax=xmax,
180 minvalue=minvalue,
180 minvalue=minvalue,
181 maxvalue=maxvalue,
181 maxvalue=maxvalue,
182 figureTitle=figureTitle,
182 figuretitle=figuretitle,
183 save=save,
183 save=save,
184 gpath=gpath)
184 gpath=gpath)
185
185
@@ -219,12 +219,51 class VoltageProcessor:
219 myCohIntObj = self.integratorObjList[self.integratorObjIndex]
219 myCohIntObj = self.integratorObjList[self.integratorObjIndex]
220 myCohIntObj.exe(data = self.dataOutObj.data, datatime=None)
220 myCohIntObj.exe(data = self.dataOutObj.data, datatime=None)
221
221
222 self.dataOutObj.timeInterval *= nCohInt
222 self.dataOutObj.flagNoData = True
223 self.dataOutObj.flagNoData = True
223
224
224 if myCohIntObj.isReady:
225 if myCohIntObj.isReady:
225 self.dataOutObj.flagNoData = False
226 self.dataOutObj.flagNoData = False
227
228 def selectChannels(self, channelList):
229
230 self.selectChannelsByIndex(channelList)
231
232 def selectChannelsByIndex(self, channelIndexList):
233 """
234 Selecciona un bloque de datos en base a canales segun el channelIndexList
226
235
236 Input:
237 channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7]
238
239 Affected:
240 self.dataOutObj.data
241 self.dataOutObj.channelIndexList
242 self.dataOutObj.nChannels
243 self.dataOutObj.m_ProcessingHeader.totalSpectra
244 self.dataOutObj.systemHeaderObj.numChannels
245 self.dataOutObj.m_ProcessingHeader.blockSize
246
247 Return:
248 None
249 """
250 if self.dataOutObj.flagNoData:
251 return 0
227
252
253 for channel in channelIndexList:
254 if channel not in self.dataOutObj.channelIndexList:
255 raise ValueError, "The value %d in channelIndexList is not valid" %channel
256
257 nChannels = len(channelIndexList)
258
259 data = self.dataOutObj.data[channelIndexList,:]
260
261 self.dataOutObj.data = data
262 self.dataOutObj.channelIndexList = channelIndexList
263 self.dataOutObj.channelList = [self.dataOutObj.channelList[i] for i in channelIndexList]
264 self.dataOutObj.nChannels = nChannels
265
266 return 1
228
267
229 class CoherentIntegrator:
268 class CoherentIntegrator:
230
269
General Comments 0
You need to be logged in to leave comments. Login now