def main():
    args = parse_arguments()

    f = h5py.File(args.datafile, 'r')
    
    bend_coefs = np.loglinspace(args.bend_coef_init, args.bend_coeff_final, args.n_iter)

    for seg_name, seg_info in f.iteritems():
        if 'LU' not in seg_info:
            lu_group = seg_info.create_group('LU')
        else:
            lu_group = seg_info['LU']
        x_na = seg_info['cloud_xyz'][:]
        for bend_coeff in bend_coeffs:
            if str(bend_coeff) in lu_group:
                continue
            
            bend_coeff_g = lu_group.create_group(str(bend_coeff))
            _, res = get_lu_decomp(x_na, bend_coeff)
            for k, v in res.iteritems():
                bend_coeff_g[k] = v

            if args.verbose:
                print 'segment {}  bend_coeff {}'.format(seg_name, bend_coeff)

    f.close()
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/compute_decomps.py/main/original