Commit 98d0f3d7 authored by Brad Covey's avatar Brad Covey
Browse files

Added a new function

parent 2877a90b
Loading
Loading
Loading
Loading
+58 −39
Original line number Diff line number Diff line
@@ -26,6 +26,25 @@ def webb_to_decdeg(webb_latlon):
    else:
        return -1 * (abs(deg) + minute)

def parse_fileopen_time(fileopen_time):
    res = re.match(r'([a-zA-Z]*)_*([a-zA-Z]*)_*([0-9]*)_*([0-9]*):([0-9]*):([0-9]*)_([0-9]*)', fileopen_time)

    month = time.strptime(res.group(2), '%b').tm_mon
    day = int(res.group(3))
    hour = int(res.group(4))
    minute = int(res.group(5))
    second = int(res.group(6))
    year = int(res.group(7))

    dt = datetime.datetime(
        year,
        month,
        day,
        hour,
        minute,
        second
    )
    return dt

def get_cached_sensorlist(filename, meta, cacheDirName='dbdcache'):
    # Check and see if the folder has a cache subfolder.
@@ -270,7 +289,9 @@ def parse_dbd2asc_result(dbdascname, returntype='tuple', column_output=[]):
                primHeader.append(line) # add pre-segment_filename lines to the meta header.
            elif fread_stage == 'header':
                for primRow in primHeader:
                    meta[primRow.split(':', 2)[0]] = primRow.split(':',2)[1].strip()
                    # print "Splitting: %s" % primRow
                    # print "Split result: %s" % primRow.split(':',1)
                    meta[primRow.split(':', 1)[0]] = primRow.split(':',1)[1].strip()
                fread_stage = 'segments'
            if fread_stage == 'segments' and "segment_filename" in line:
                meta['filename_list'].append(line.split(":")[1].strip())
@@ -424,5 +445,3 @@ if __name__ == "__main__":

    tight_layout()
    show()
    
    
 No newline at end of file