Changeset 4852


Ignore:
Timestamp:
Nov 22, 2007, 5:51:01 PM (17 years ago)
Author:
sexton
Message:

more updates to plotting points inside and outside boundary polygon

Location:
anuga_core/source/anuga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/interpolate.py

    r4851 r4852  
    552552                msg += 'outside specified mesh. '
    553553                msg += 'Offending points:\n'
     554                out_interp_pts = []
    554555                for i in indices:
    555556                    msg += '%d: %s\n' %(i, interpolation_points[i])
    556 
    557                 #from anuga.utilities.polygon import plot_polygons_points
    558                 #in_interp_pts =
     557                    out_interp_pts.append(ensure_numeric(interpolation_points[i]))
     558
     559                from anuga.utilities.polygon import plot_polygons_points
    559560                #out_interp_pts = take(interpolation_points,[indices])
    560                 #title = 'Interpolation points fall outside specified mesh'
    561                 #plot_polygons_points([mesh_boundary_polygon,in_interp_pts,out_interp_pts],
    562                 #                     ['line','point','outside'],label=title,verbose=verbose)
     561                title = 'Interpolation points fall outside specified mesh'
     562                plot_polygons_points([mesh_boundary_polygon,interpolation_points,out_interp_pts],
     563                                     ['line','point','outside'],figname='points_boundary_out',label=title,verbose=verbose)
    563564
    564565                # Joaquim Luis suggested this as an Exception, so
     
    575576                title = 'Interpolation function: Polygon and interpolation points'
    576577                plot_polygons_points([mesh_boundary_polygon,interpolation_points],
    577                                      ['line','point'],label=title,verbose=verbose)
     578                                     ['line','point'],figname='points_boundary',label=title,verbose=verbose)
    578579
    579580            m = len(self.interpolation_points)
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r4845 r4852  
    51035103        #                              domain2)
    51045104        Bf = Field_boundary(domain1.get_name() + '.' + domain1.format,
    5105                             domain2, mean_stage=1, verbose=True)
     5105                            domain2, mean_stage=1, verbose=False)
    51065106       
    51075107        domain2.set_boundary({'right':Br, 'bottom':Br, 'diagonal':Bf})
  • anuga_core/source/anuga/utilities/polygon.py

    r4851 r4852  
    378378
    379379    if label is None: label = ''
    380    
     380
    381381    n = len(polygons_points)
    382382    colour = []
     
    389389    else:
    390390        for s in style:
    391             if s == 'line':
    392                 colour.append('b-')           
    393             if s == 'outside':
    394                 colour.append('r.')
    395             else:
    396                 colour.append('g.')
     391            if s == 'line': colour.append('b-')           
     392            if s == 'outside': colour.append('r.')
     393            if s <> 'line':
     394                if s <> 'outside':
     395                    colour.append('g.')
    397396           
    398397    for i, item in enumerate(polygons_points):
    399         x, y = poly_xy(item) 
     398        x, y = poly_xy(item)
    400399        if min(x) < minx: minx = min(x)
    401400        if max(x) > maxx: maxx = max(x)
     
    406405        ylabel('y')
    407406        title(label)
    408 
     407       
     408    if minx <> 0:
     409        axis([minx*0.9,maxx*1.1,miny*0.9,maxy*1.1])
     410    else:
     411        if miny == 0:
     412            axis([-maxx*.01,maxx*1.1,-maxy*0.01,maxy*1.1])
     413        else:
     414            axis([-maxx*.01,maxx*1.1,miny*0.9,maxy*1.1])
     415   
    409416    if figname is not None:
    410417        savefig(figname)
Note: See TracChangeset for help on using the changeset viewer.