Exemplo n.º 1
0
    def plot_bathymetry(self, path=None, save=True, show=False):
        """
        :type path: None or string
        :param string path: directory containing ``figs/`` folder
        :param boolean save: flag
        :param boolean show: flag
        :returns: See :meth:`~polyadcirc.pyADCIRC.plotADCIRC.bathymetry`

        """
        return plot.bathymetry(self, path, save, show)
Exemplo n.º 2
0
def plot_walls(run_set, domain, wall_points, save=True, show=False):
    """
    Plots the walls with dimenstions described in ``wall_points`` and saves
    the plots in ``self.save_dir``
    
    :param domain: :class:`~polyadcirc.run_framework.domain`
    :param wall_points: containts the box_limits, and wall_height for each
        wall [ximin, xmax, ymin, ymax, wall_height]
    :type wall_points: :class:`np.array` of size (5, ``num_of_walls``)
    :param boolean save: flag for whether or not to save plots
    :param boolean show: flag for whether or not to show plots

    """
    num_walls = wall_points.shape[1]
    for w in xrange(num_walls):
        # set walls
        wall_dim = wall_points[..., w]
        domain.read_spatial_grid()
        domain.add_wall(wall_dim[:4], wall_dim[-1])
        plot.bathymetry(domain, run_set.save_dir, save, show)
Exemplo n.º 3
0
def plot_walls(run_set, domain, wall_points, save=True, 
               show=False):
    """
    Plots the walls with dimenstions described in ``wall_points`` and saves
    the plots in ``self.save_dir``
    
    :param domain: :class:`~polyadcirc.run_framework.domain`
    :param wall_points: containts the box_limits, and wall_height for each
        wall [ximin, xmax, ymin, ymax, wall_height]
    :type wall_points: :class:`np.array` of size (5, ``num_of_walls``)
    :param boolean save: flag for whether or not to save plots
    :param boolean show: flag for whether or not to show plots

    """
    num_walls = wall_points.shape[1]
    for w in xrange(num_walls):
        # set walls
        wall_dim = wall_points[..., w]
        domain.read_spatial_grid()
        domain.add_wall(wall_dim[:4], wall_dim[-1])
        plot.bathymetry(domain, run_set.save_dir, save, show)
Exemplo n.º 4
0
# load in the small katrina mesh
domain = dom.domain(grid_dir)
domain.update()

# load in basis vectors for domain
bv_dict = tmm.get_basis_vectors(basis_dir)

# create and save images of the mesh with various manning's n values to
# visualize the location of different types of nodes
# show the location of the non default nodes
# show the location of the shelf nodes
# show the location of the default nodes
domain.get_Triangulation()
# convert basis vectors to an array
bv_array = np.zeros((domain.node_num, len(bv_dict)+1))
default_nodes = tmm.get_default_nodes(domain, bv_dict)
bv_array[default_nodes, -1] = 1.0
for i, b_vect in enumerate(bv_dict):
    ind = np.array(b_vect.keys())-1
    bv_array[ind, i] = 1
plotA.basis_functions(domain, bv_array)

# plot bathymetry contours (in a separate plot, but with contours where the
# shelf should be)
plotA.bathymetry(domain, contour=True)

# everything should look fine if it does then we're good :)


Exemplo n.º 5
0
save_dir = adcirc_dir + '/ADCIRC_landuse/Katrina_small/runs/output_test'
basis_dir = adcirc_dir + '/ADCIRC_landuse/Katrina_small/landuse_basis/gap/shelf_test'

# load in the small katrina mesh
domain = dom.domain(grid_dir)
domain.update()

# load in basis vectors for domain
bv_dict = tmm.get_basis_vectors(basis_dir)

# create and save images of the mesh with various manning's n values to
# visualize the location of different types of nodes
# show the location of the non default nodes
# show the location of the shelf nodes
# show the location of the default nodes
domain.get_Triangulation()
# convert basis vectors to an array
bv_array = np.zeros((domain.node_num, len(bv_dict) + 1))
default_nodes = tmm.get_default_nodes(domain, bv_dict)
bv_array[default_nodes, -1] = 1.0
for i, b_vect in enumerate(bv_dict):
    ind = np.array(b_vect.keys()) - 1
    bv_array[ind, i] = 1
plotA.basis_functions(domain, bv_array)

# plot bathymetry contours (in a separate plot, but with contours where the
# shelf should be)
plotA.bathymetry(domain, contour=True)

# everything should look fine if it does then we're good :)