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