Changeset 1071
- Timestamp:
- Mar 14, 2005, 10:11:37 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
r1059 r1071 51 51 52 52 from string import find, rfind 53 from Numeric import array, Float, Int16, Int32, Character,reshape, concatenate 53 from Numeric import array, Float, Int16, Int32, Character,reshape, concatenate, take 54 54 from os.path import splitext 55 55 … … 1182 1182 return xya_dict 1183 1183 1184 #FIXME(dsg), turn this dict plus methods into a class? 1185 def take_points(dict,indices_to_keep): 1186 dict = point_atts2array(dict) 1187 #FIXME maybe the points data structure should become a class? 1188 dict['pointlist'] = take(dict['pointlist'],indices_to_keep) 1189 1190 for key in dict['attributelist'].keys(): 1191 dict['attributelist'][key]= take(dict['attributelist'][key], 1192 indices_to_keep) 1193 return dict 1194 1195 def add_point_dictionaries (dict1, dict2): 1196 """ 1197 """ 1198 dict1 = point_atts2array(dict1) 1199 dict2 = point_atts2array(dict2) 1200 1201 combined = {} 1202 combined['pointlist'] = concatenate((dict2['pointlist'], 1203 dict1['pointlist']),axis=0) 1204 atts = {} 1205 for key in dict2['attributelist'].keys(): 1206 atts[key]= concatenate((dict2['attributelist'][key], 1207 dict1['attributelist'][key]), axis=0) 1208 combined['attributelist']=atts 1209 combined['geo_reference'] = dict1['geo_reference'] 1210 return combined 1211 1184 1212 #FIXME (DSG) need an export_points_file method.. 1185 1213 def export_xya_file( file_name, xya_dict, title, delimiter = ','):
Note: See TracChangeset
for help on using the changeset viewer.