##// END OF EJS Templates
Add mode to PedestalñInformation
Juan C. Espinoza -
r1478:89192dbc1ee0
parent child
Show More
@@ -4182,28 +4182,27 class PedestalInformation(Operation):
4182 4182 def get_values(self):
4183 4183
4184 4184 if self.flagNoData:
4185 print("get_value_1")
4186 4185 return numpy.nan, numpy.nan, numpy.nan #Should be self.mode?
4187 4186 else:
4188 4187 index = int((self.utctime-self.utcfile)/self.interval)
4189 4188
4190 #if self.flagAskMode:
4191 # mode = self.find_mode(index)
4192 #else:
4193 # mode = self.mode
4194 mode = 'PPI'
4189 if self.flagAskMode:
4190 mode = self.find_mode(index)
4191 else:
4192 mode = self.mode
4193
4195 4194 if mode is not None:
4196 4195 return self.fp['Data']['azi_pos'][index], self.fp['Data']['ele_pos'][index], mode
4197 4196 else:
4198 print("get_value_2")
4199 4197 return numpy.nan, numpy.nan, numpy.nan
4200 4198
4201 def setup(self, dataOut, path, conf, samples, interval, az_offset):
4199 def setup(self, dataOut, path, conf, samples, interval, mode):
4202 4200
4203 4201 self.path = path
4204 4202 self.conf = conf
4205 4203 self.samples = samples
4206 4204 self.interval = interval
4205 self.mode = mode
4207 4206 filelist = self.find_file(dataOut.utctime)
4208 4207
4209 4208 if not filelist:
@@ -4215,26 +4214,22 class PedestalInformation(Operation):
4215 4214 log.log('Opening file: {}'.format(self.filename), self.name)
4216 4215 self.fp = h5py.File(self.filename, 'r')
4217 4216
4218 def run(self, dataOut, path, conf=None, samples=1500, interval=0.04, az_offset=0, time_offset=0):
4217 def run(self, dataOut, path, conf=None, samples=1500, interval=0.04, az_offset=0, time_offset=0, mode=None):
4219 4218
4220 4219 if not self.isConfig:
4221 self.setup(dataOut, path, conf, samples, interval, az_offset)
4222 #self.flagAskMode = True
4220 self.setup(dataOut, path, conf, samples, interval, mode)
4223 4221 self.isConfig = True
4224 4222
4225 4223 self.utctime = dataOut.utctime + time_offset
4226 4224
4227 4225 if hasattr(dataOut, 'flagAskMode'):
4228 4226 self.flagAskMode = dataOut.flagAskMode
4229 #print("inside",self.flagAskMode)
4230 4227 else:
4231 #print("nooooooo")
4232 4228 self.flagAskMode = True
4233 4229
4234 4230 self.find_next_file()
4235 4231
4236 az, el, self.mode = self.get_values()
4237 print("after get_values",az,el,self.mode)
4232 az, el, scan = self.get_values()
4238 4233 dataOut.flagNoData = False
4239 4234 if numpy.isnan(az) or numpy.isnan(el) :
4240 4235 dataOut.flagNoData = True
@@ -4245,7 +4240,7 class PedestalInformation(Operation):
4245 4240 if dataOut.azimuth < 0:
4246 4241 dataOut.azimuth += 360
4247 4242 dataOut.elevation = el
4248 dataOut.mode_op = self.mode[:]
4243 dataOut.mode_op = scan
4249 4244
4250 4245 return dataOut
4251 4246
General Comments 0
You need to be logged in to leave comments. Login now