Changeset 1099
- Timestamp:
- Mar 17, 2005, 11:01:08 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
r1092 r1099 1018 1018 return dic.keys(), point_attributes 1019 1019 1020 def read_pts(filename ):1020 def read_pts(filename, verbose = False): 1021 1021 """Read .pts NetCDF file 1022 1022 … … 1033 1033 from Scientific.IO.NetCDF import NetCDFFile 1034 1034 1035 #print 'Reading ', filename1035 if verbose: print 'Reading ', filename 1036 1036 fid = NetCDFFile(filename, 'r') 1037 1037 … … 1040 1040 point_atts['pointlist'] = array(fid.variables['points']) 1041 1041 keys = fid.variables.keys() 1042 #print "keys",keys1042 if verbose: print 'Got %d variables: %s' %(len(keys), keys) 1043 1043 try: 1044 1044 keys.remove('points') … … 1051 1051 # This is an issue with a file that has been caught, 1052 1052 # not a bug. 1053 raise IOError, msg 1053 #(Ole): I see, this is true. Let's remove this conversation:-) 1054 raise IOError, msg 1055 1054 1056 attributes = {} 1055 1057 for key in keys: 1058 if verbose: print "reading attribute '%s'" %key 1059 1056 1060 attributes[key] = array(fid.variables[key]) 1057 1061 … … 1126 1130 elif ofile[-4:]== ".pts": 1127 1131 try: 1128 points_dict = read_pts(ofile )1132 points_dict = read_pts(ofile, verbose) 1129 1133 except IOError, e: 1130 1134 msg = 'Could not open file %s ' %ofile
Note: See TracChangeset
for help on using the changeset viewer.