def process_files(filepaths): filepaths.sort() for fpath in filepaths: try: print(fpath) sensors, src = parse_master(fpath) # TODO log cache failures except: continue #skips the rest of this loop iteration store2mongo(src.platformID, [sensors,src] ) if any([fnmatch(fpath, '*.?bd') for fpath in filepaths]): pass # trigger report on data completeness/ statistics. elif any([fnmatch(fpath, '*.log') for fpath in filepaths]): pass # trigger kml creation/updating elif any([fnmatch(fpath, '*.mdr') for fpath in filepaths]): pass # trigger report creation
def thru_test(): #src = SourceFile('cp_376-2016-148-3-96.sbd') src = find_glider_files(filename='cp_376-2016-148-3-90.sbd')[0] print(src) sensors, parsed_src = parse_master(src) m_depth = filter(lambda x: x.name=='m_depth', sensors).__next__() print(parsed_src) m_depth.xy[-1] = (m_depth.xy[-1][0] + 27, m_depth.xy[-1][1]) print(m_depth) print();print('MSENSORing') mm_depth = MSensor.from_sensor(m_depth) print(mm_depth) for s in mm_depth: print(s) res = store2mongo('cp_376',m_depth) res = store2mongo('cp_376',parsed_src) print(res)