def find_files_recursive(fdir, pattern='D*.r'):
    files = []
    for (dirpath, dirnames, filenames) in os.walk(fdir):
        for filename in fnmatch.filter(filenames, pattern):
            files.append(os.path.join(dirpath, filename))
    files.sort()
    return np.asarray(files)
def find_files_recursive(fdir, pattern='D*.r'):
    files = []
    for (dirpath, dirnames, filenames) in os.walk(fdir):
        for filename in fnmatch.filter(filenames, pattern):
            files.append(os.path.join(dirpath, filename))
    files.sort()
    return np.asarray(files)