Ejemplo n.º 1
0
    low_density_coords = ps.paths_in_shape(np.column_stack((Hmaxx, Hmaxy)))

    #N_cluster_points = kmeans(low_density_coords, N)[0]

    density_coords = DENSITY.select_points()
    # make sure that your density coords are within the boundary shape
    density_coords = INPOLY.points_in(density_coords)
    #cluster = True

    if counter == 0:
        grad_ideal = 1e6
        avg_ideal = 0

    if grad_check1 < grad_ideal and avg_ideal < H_avg1:

        with open(u'ideal_coordinates.pickle', 'wb') as f:
            print "\nExporting new ideal coordinates."
            pickle.dump(coords, f, protocol=2)

        DENSITY.plot_field()  #nodes=POLY_NODES)#SHAPE=UNIQUE_SHAPE)

        grad_ideal = grad_check1
        avg_ideal = H_avg1

    coords = COORDS.del_N(N=N, inputs=coords)
    paths = COORDS.del_N(N=N, inputs=paths)
    paths = list(paths)

    counter += 1
    t1 = datetime.datetime.now()
    print "That loop took: ", t1 - t0
Ejemplo n.º 2
0
    #N_cluster_points = kmeans(low_density_coords, N)[0]
    
    
    density_coords = DENSITY.select_points()
    # make sure that your density coords are within the boundary shape        
    density_coords = INPOLY.points_in(density_coords)
    #cluster = True
    
    if counter == 0:
        grad_ideal = 1e6
        avg_ideal = 0  

    if grad_check1 < grad_ideal and avg_ideal < H_avg1:     

        with open(u'ideal_coordinates.pickle', 'wb') as f:
            print "\nExporting new ideal coordinates."
            pickle.dump(coords, f, protocol=2)
        
        DENSITY.plot_field(SHAPE=UNIQUE_SHAPE)

        grad_ideal = grad_check1
        avg_ideal = H_avg1

    coords = COORDS.del_N(N=n_stations, inputs=coords)
    paths = COORDS.del_N(N=n_stations, inputs=paths)
    paths=list(paths)

    counter+=1
    t1 = datetime.datetime.now()
    print "That loop took: ", t1-t0
Ejemplo n.º 3
0
    
    #N_cluster_points = kmeans(low_density_coords, N)[0]
    
    
    density_coords = DENSITY.select_points()
    # make sure that your density coords are within the boundary shape        
    density_coords = INPOLY.points_in(density_coords)
    #cluster = True
    
    if counter == 0:
        grad_ideal = 1e6
        avg_ideal = 0  

    if grad_check1 < grad_ideal and avg_ideal < H_avg1:     

        with open(u'ideal_coordinates.pickle', 'wb') as f:
            print "\nExporting new ideal coordinates."
            pickle.dump(coords, f, protocol=2)
        
        DENSITY.plot_field(SHAPE=UNIQUE_SHAPE)

        grad_ideal = grad_check1
        avg_ideal = H_avg1

    coords = COORDS.del_N(N=N, inputs=coords)
    paths = COORDS.del_N(N=N, inputs=paths)
    paths=list(paths)

    counter+=1
    t1 = datetime.datetime.now()
    print "That loop took: ", t1-t0
Ejemplo n.º 4
0
    #N_cluster_points = kmeans(low_density_coords, N)[0]

    density_coords = DENSITY.select_points()
    # make sure that your density coords are within the boundary shape
    density_coords = INPOLY.points_in(density_coords)
    #cluster = True

    if counter == 0:
        grad_ideal = 1e6
        avg_ideal = 0

    if grad_check1 < grad_ideal and avg_ideal < H_avg1:

        with open(u'ideal_coordinates.pickle', 'wb') as f:
            print "\nExporting new ideal coordinates."
            pickle.dump(coords, f, protocol=2)

        DENSITY.plot_field(SHAPE=UNIQUE_SHAPE)

        grad_ideal = grad_check1
        avg_ideal = H_avg1

    coords = COORDS.del_N(N=n_stations, inputs=coords)
    paths = COORDS.del_N(N=n_stations, inputs=paths)
    paths = list(paths)

    counter += 1
    t1 = datetime.datetime.now()
    print "That loop took: ", t1 - t0