Changeset 4107
- Timestamp:
- Dec 20, 2006, 3:53:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/quantity.py
r3956 r4107 18 18 argmax, allclose, take, reshape 19 19 from anuga.utilities.numerical_tools import ensure_numeric, is_scalar 20 from anuga.geospatial_data.geospatial_data import Geospatial_data 20 21 21 22 class Quantity: … … 219 220 220 221 filename: 221 Name of a .pts file containing data points and attributes for222 Name of a points file containing data points and attributes for 222 223 use with fit_interpolate.fit. 223 224 … … 718 719 verbose = False, 719 720 use_cache = False): 720 """Set quantity based on arbitrary points in .pts file721 """Set quantity based on arbitrary points in a points file 721 722 using attribute_name selects name of attribute 722 723 present in file. … … 736 737 # FIXME (Ole): This function should really return a 737 738 # Geospatial_data object. 738 points_dict = import_points_file(filename) 739 points = points_dict['pointlist'] 740 attributes = points_dict['attributelist'] 741 742 if attribute_name is None: 743 names = attributes.keys() 744 attribute_name = names[0] 745 746 msg = 'Attribute_name must be a text string' 747 assert type(attribute_name) == StringType, msg 739 geospatial_data = Geospatial_data(filename) 740 741 #points_dict = import_points_file(filename) 742 #points_dict['pointlist'] = None 743 #points_dict['attributelist'] = None 744 #points = points_dict['pointlist'] 745 #attributes = points_dict['attributelist'] 746 747 748 #Take care of georeferencing 749 # this doesn't do anything.... 750 #if points_dict.has_key('geo_reference') and \ 751 # points_dict['geo_reference'] is not None: 752 # data_georef = points_dict['geo_reference'] 753 #else: 754 # data_georef = None 755 756 # if there is no attribute name, use the 1st key? 757 # This isn't so good..., if there is more than 1 key 758 # since it will not always be the 1 column 759 # or anything predictable... 760 761 #if attribute_name is None: 762 # names = attributes.keys() 763 # attribute_name = names[0] 764 765 #msg = 'Attribute_name must be a text string' 766 #assert type(attribute_name) == StringType, msg 748 767 749 768 … … 758 777 # %(attribute_name, filename) 759 778 # raise msg 760 761 762 #Take care of georeferencing 763 if points_dict.has_key('geo_reference') and \ 764 points_dict['geo_reference'] is not None: 765 data_georef = points_dict['geo_reference'] 766 else: 767 data_georef = None 768 769 770 779 771 780 #Call underlying method for geospatial data 772 geospatial_data = points_dictionary2geospatial_data(points_dict)773 geospatial_data.set_default_attribute_name(attribute_name)781 #geospatial_data = points_dictionary2geospatial_data(points_dict) 782 # geospatial_data.set_default_attribute_name(attribute_name) 774 783 775 784 self.set_values_from_geospatial_data(geospatial_data,
Note: See TracChangeset
for help on using the changeset viewer.