Changeset 6223
- Timestamp:
- Jan 21, 2009, 4:37:45 PM (16 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/interpolate.py
r6194 r6223 794 794 795 795 if verbose is True: 796 print 'Interpolation_function: thinning '796 print 'Interpolation_function: thinning by %d' % time_thinning 797 797 798 798 … … 915 915 self.precomputed_values[name] = num.zeros((p, m), num.Float) 916 916 917 if verbose is True: 918 print 'Build interpolator' 919 920 917 921 # Build interpolator 918 if verbose:919 if triangles is not None and vertex_coordinates is not None:922 if triangles is not None and vertex_coordinates is not None: 923 if verbose: 920 924 msg = 'Building interpolation matrix from source mesh ' 921 925 msg += '(%d vertices, %d triangles)' \ 922 926 % (vertex_coordinates.shape[0], 923 927 triangles.shape[0]) 924 elif triangles is None and vertex_coordinates is not None: 925 msg = 'Building interpolation matrix from source points' 928 print msg 926 929 927 print msg 928 929 # FIXME(Ole): This one is no longer needed for STS files 930 interpol = Interpolate(vertex_coordinates, 931 triangles, 932 verbose=verbose) 930 # This one is no longer needed for STS files 931 interpol = Interpolate(vertex_coordinates, 932 triangles, 933 verbose=verbose) 934 935 elif triangles is None and vertex_coordinates is not None: 936 if verbose: 937 msg = 'Interpolation from STS file' 938 print msg 939 940 933 941 934 942 if verbose: -
anuga_core/source/anuga/utilities/polygon.py
r6189 r6223 661 661 """ 662 662 663 def __init__(self, regions, default=0.0, geo_reference=None): 663 def __init__(self, 664 regions, 665 default=0.0, 666 geo_reference=None): 664 667 665 668 try: … … 702 705 for polygon, value in regions: 703 706 P = geo_reference.change_points_geo_ref(polygon) 704 self.regions.append( (P, value))707 self.regions.append((P, value)) 705 708 706 709 … … 714 717 assert len(y) == N 715 718 716 points = num.concatenate((num.reshape(x, (N, 1)),717 num.reshape(y, (N, 1))), axis=1)719 points = num.concatenate((num.reshape(x, (N, 1)), 720 num.reshape(y, (N, 1))), axis=1) 718 721 719 722 if callable(self.default): … … 735 738 z[i] = value 736 739 740 if len(z) == 0: 741 msg = 'Warning: points provided to Polygon function did not fall within' 742 msg += 'its regions' 743 msg += 'x in [%.2f, %.2f], y in [%.2f, %.2f]' % (min(x), max(x), 744 min(y), max(y)) 745 print msg 746 747 737 748 return z 738 749
Note: See TracChangeset
for help on using the changeset viewer.