def load_data(self, start_limit=None, stop_limit=None): return_records = DataCollection() for trace in self.trace_files: log.info("Loading file: " + trace.loc) if start_limit and trace.get_date() < start_limit: continue if stop_limit and trace.get_date() > stop_limit: continue return_records.append(trace.get_data()) return return_records
def get_data_tuples(self, start_limit=None, stop_limit=None): """Retrieve data and timestamps from the data collection. start_limit and stop_limit are optional arguments that describe the subsection of the trace to operate on. If these options are not provided, then any arguments provided on object intialization will be used.""" start_limit, stop_limit = self.get_limits(start_limit, stop_limit) data = self.load_data(start_limit, stop_limit) self.trace_data = DataCollection(start_limit, stop_limit) self.trace_data.append(data) return self.trace_data.get_data_tuples(start_limit, stop_limit)
def __init__(self, sensor_name, start_limit=None, stop_limit=None): self.name = sensor_name self.trace_data = DataCollection(start_limit, stop_limit) self.start_limit = start_limit self.stop_limit = stop_limit self.initialize()
def get_data(self): data = DataCollection() for line in open(self.loc, 'r'): parts = line.split(',') data.append(DataRecord(parts[4], parts[1], parts[2])) return data