@@ -171,16 +171,18 class HDFReader(Reader, ProcessingUnit): | |||||
171 | startTime = self.startTime |
|
171 | startTime = self.startTime | |
172 | endTime = self.endTime |
|
172 | endTime = self.endTime | |
173 | thisUtcTime = self.data['utctime'] + self.utcoffset |
|
173 | thisUtcTime = self.data['utctime'] + self.utcoffset | |
|
174 | ||||
174 | self.interval = numpy.min(thisUtcTime[1:] - thisUtcTime[:-1]) |
|
175 | self.interval = numpy.min(thisUtcTime[1:] - thisUtcTime[:-1]) | |
175 | thisDatetime = datetime.datetime.utcfromtimestamp(thisUtcTime[0]) |
|
176 | thisDatetime = datetime.datetime.utcfromtimestamp(thisUtcTime[0]) | |
176 |
|
177 | |||
177 | thisDate = thisDatetime.date() |
|
178 | thisDate = thisDatetime.date() | |
178 | thisTime = thisDatetime.time() |
|
179 | thisTime = thisDatetime.time() | |
179 |
|
||||
180 | startUtcTime = (datetime.datetime.combine(thisDate, startTime) - datetime.datetime(1970, 1, 1)).total_seconds() |
|
180 | startUtcTime = (datetime.datetime.combine(thisDate, startTime) - datetime.datetime(1970, 1, 1)).total_seconds() | |
181 | endUtcTime = (datetime.datetime.combine(thisDate, endTime) - datetime.datetime(1970, 1, 1)).total_seconds() |
|
181 | endUtcTime = (datetime.datetime.combine(thisDate, endTime) - datetime.datetime(1970, 1, 1)).total_seconds() | |
182 |
|
182 | |||
183 | ind = numpy.where(numpy.logical_and(thisUtcTime >= startUtcTime, thisUtcTime < endUtcTime))[0] |
|
183 | ind = numpy.where(numpy.logical_and(thisUtcTime >= startUtcTime, thisUtcTime < endUtcTime))[0] | |
|
184 | if len(ind)==0: | |||
|
185 | raise schainpy.admin.SchainError("[Reading] Date time selected invalid [%s - %s]: No *%s files in %s)" % (startTime, endTime, self.ext, self.path)) | |||
184 |
|
186 | |||
185 | self.blockList = ind |
|
187 | self.blockList = ind | |
186 | self.blocksPerFile = len(ind) |
|
188 | self.blocksPerFile = len(ind) |
General Comments 0
You need to be logged in to leave comments.
Login now