Changeset 5245
- Timestamp:
- Apr 28, 2008, 8:00:14 AM (17 years ago)
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/geospatial_data/geospatial_data.py
r5222 r5245 910 910 raise ValueError, msg 911 911 lats_longs = ensure_numeric(data_points) 912 print 'hello', lats_longs 912 913 latitudes = ravel(lats_longs[:,0:1]) 913 914 longitudes = ravel(lats_longs[:,1:]) -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5226 r5245 6117 6117 lat_amount, long_amount, 6118 6118 verbose=self.verbose) 6119 6120 def test_URS_points_needed_poly1(self): 6121 # domain in southern hemisphere zone 51 6122 grid_spacing = 2./60. 6123 poly1 = [[296361.89, 8091928.62],[429495.07,8028278.82], [447230.56,8000674.05], 6124 [429661.2,7982177.6],[236945.9,7897453.16],[183493.44,7942782.27], 6125 [226583.04,8008058.96]] 6126 URS_points_needed_to_file('test_example_poly1',poly1,51, 6127 grid_spacing,verbose=self.verbose) 6128 6129 def test_URS_points_needed_poly2(self): 6130 # domain in northern hemisphere zone 47 6131 grid_spacing = 2./60. 6132 poly2 = [[419336.424,810100.845],[342405.0281,711455.8026],[274649.9152,723352.9603], 6133 [272089.092,972393.0131],[347633.3754,968551.7784], 6134 [427979.2022,885965.2313],[427659.0993,875721.9386], 6135 [429259.6138,861317.3083],[436301.8775,840830.723]] 6136 URS_points_needed_to_file('test_example_poly2',poly2,47, 6137 grid_spacing,verbose=self.verbose) 6119 6138 6120 6139 #### END TESTS URS UNGRIDDED 2 SWW ### -
anuga_work/development/MISG_2008/sensitivity_study.py
r5066 r5245 136 136 tri_id2 = domain.get_triangle_containing_point([-c/m-20,y_extent*0.5]) 137 137 tri_id3 = domain.get_triangle_containing_point([-c/m+50,y_extent*0.5]) 138 138 139 print 'hello', -c/m, -c/m-10, -c/m-20, -c/m+50 140 139 141 stage_centroid = domain.quantities['stage'].centroid_values 140 142 xmom_centroid = domain.quantities['xmomentum'].centroid_values … … 146 148 elev3 = elevation_centroid[tri_id3] 147 149 150 print 'hello again', elev0, elev1, elev2, elev3 148 151 import time 149 152 t0 = time.time() -
anuga_work/production/broome/run_boundary_points.py
r5001 r5245 21 21 from anuga.shallow_water.data_manager import URS_points_needed_to_file, \ 22 22 urs_ungridded2sww 23 import project # Definition of file names and polygons23 import project_urs # Definition of file names and polygons 24 24 25 25 #------------------------------------------------------------------------------ … … 27 27 # output to file 28 28 #------------------------------------------------------------------------------ 29 poly = project .poly_all29 poly = project_urs.poly_all 30 30 print "poly", poly 31 print "project .boundaries_in_dir_name",project.boundaries_in_dir_name32 URS_points_needed_to_file(project .boundaries_in_dir_name,poly, export_csv=True, zone=51)31 print "project_urs.boundaries_in_dir_name",project_urs.boundaries_in_dir_name 32 URS_points_needed_to_file(project_urs.boundaries_in_dir_name,poly, export_csv=True, zone=51) 33 33 #URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True, zone=50) 34 34 #URS_points_needed_to_file(project.boundaries_dir_name5,poly, export_csv=True) -
anuga_work/production/exmouth_2006/plot_contour_data.py
r4949 r5245 3 3 4 4 import project 5 from pylab import plot, xlabel, ylabel, savefig, ion, close, axis, title, legend, grid 5 from pylab import plot, xlabel, ylabel, savefig, ion, close, axis, title, legend, grid, figure 6 6 from os import sep 7 7 … … 56 56 #Magnitude 9.0 event (Sumba) at Exmouth') 57 57 legend(['ANUGA','Green\'s law']) 58 axis([-5,85,min(stage_max)*0.9,max(stage_max)*1.1]) 58 #axis([-5,85,min(stage_max)*0.9,max(stage_max)*1.1]) 59 axis([-5,85,3.5,max(stage_max)*1.1]) 59 60 grid(True) 60 61 #savefig('stratification_onslow_gun') … … 62 63 #savefig('stratification_dampier_gun') 63 64 65 depthv2 = [0,5,20,80] 66 datav2 = [8.2,6,4,h1] 67 figure(2) 68 plot(d2,green,'g-',depthv2,datav2,'bo-') 69 xlabel('depth (m)') 70 ylabel('stage (m)') 71 title('ANUGA modelled maximum stage versus Green\'s approximation \n \ 72 Magnitude 9.3 event (Java) at Exmouth') 73 legend(['ANUGA','Green\'s law']) 74 axis([-5,85,3.5,max(stage_max)*1.1]) 75 grid(True) 76 savefig('strat_exmouth_gun_v2') 64 77 close('all') 65 78 -
anuga_work/production/onslow_2006/convert_db_points.py
r4580 r5245 13 13 14 14 fid_out = open(filenameout, 'w') 15 s = '%s,%s \n' %('easting','northing')15 s = '%s,%s,%s\n' %('easting','northing','zone') 16 16 fid_out.write(s) 17 17 for line in lines[1:]: 18 18 fields = line.split(',') 19 x = float(fields[1]) 20 y = float(fields[0]) 19 #x = float(fields[1]) 20 #y = float(fields[0]) 21 x = float(fields[0]) 22 y = float(fields[1]) 21 23 zone, easting, northing = redfearn(x,y) 22 s = '%f,%f \n' %(easting,northing)24 s = '%f,%f,%f\n' %(easting,northing,zone) 23 25 fid_out.write(s) 24 26 … … 29 31 import project 30 32 31 filename = project.gaugedir + 'db_points.txt' 32 filename_out = project.gaugedir + 'db_points_convert.txt' 33 #filename = project.gaugedir + 'db_points.txt' 34 #filename_out = project.gaugedir + 'db_points_convert.txt' 35 filename = project.gaugedir + 'aus_hazard_pts.txt' 36 filename_out = project.gaugedir + 'aus_hazard_pts_en.txt' 33 37 alter_file(filename,filename_out) 38 -
anuga_work/production/shark_bay_2007/export_results.py
r4856 r5245 71 71 reduction = max, 72 72 verbose = True, 73 format = ' asc')73 format = 'txt') -
anuga_work/production/west_tas_2008/convert2eastnorth.py
r4968 r5245 31 31 #filename = project_smf.polygondir + 'domain.txt' 32 32 #filename = project_smf.polygondir + 'local.txt' 33 filename = project_smf.polygondir + 'region.txt' 33 #filename = project_smf.polygondir + 'region.txt' 34 #filename = project_smf.datadir + 'Sorell_Basin_150m_DD_Interp.txt' 35 #filename = project_smf.datadir + 'S_Tasman_Rise_150m_DD_Interp.txt' 36 filename = project_smf.polygondir + 'origin.txt' 34 37 #filename_out = project_smf.polygondir + 'domain.csv' 35 38 #filename_out = project_smf.polygondir + 'local.csv' 36 filename_out = project_smf.polygondir + 'region.csv' 39 #filename_out = project_smf.polygondir + 'region.csv' 40 #filename_out = project_smf.datadir + 'Sorell_Basin_150m_EN_Interp.txt' 41 #filename_out = project_smf.datadir + 'S_Tasman_Rise_150m_EN_Interp.txt' 42 filename_out = project_smf.polygondir + 'origin_EN.csv' 37 43 alter_file(filename,filename_out) -
anuga_work/production/west_tas_2008/project_smf.py
r4968 r5245 24 24 state = 'tasmania' 25 25 scenario_dir_name = 'smf_scenario_2008' 26 ''' 27 # onshore data provided by NSW LPI, Krishna merged with existing 28 # PMD data to make 100m DEM 29 on_offshore_name100 = 'bathyland100' 26 27 # onshore data sourced from 250m grid 28 onshore_name250 = 'bathyland250' 29 30 # coastline from GA 31 coast_line_name = 'aus_cst' 30 32 31 33 # survey data 32 offshore_name1 = ' surveyAreaA'33 offshore_name2 = ' surveyAreaB'34 offshore_name3 = ' surveyAreaC'34 offshore_name1 = 'S_Tasman_Rise_150m_EN_Interp' 35 offshore_name2 = 'Sorell_Basin_150m_EN_Interp' 36 offshore_name3 = 'West_Tas_EastNorth_z' 35 37 36 # AHO data37 offshore_name4 = '1000003611export'38 offshore_name5 = '1000003613export'39 offshore_name6 = '1000003614export'40 offshore_name7 = '1000003627export'41 offshore_name8 = '1000003628export'42 offshore_name9 = 'AHDexport'43 '''44 38 #swollen/ all data output 45 39 basename = 'source' … … 61 55 codedirname = codedir + 'project_smf.py' 62 56 meshname = outputtimedir + 'mesh_' + basename 63 ''' 57 64 58 # Necessary if using point datasets, rather than grid 65 on _offshore100_dem_name = datadir + on_offshore_name10059 onshore_250_dem_name = datadir + onshore_name250 66 60 offshore_dem_name1 = datadir + offshore_name1 67 61 offshore_dem_name2 = datadir + offshore_name2 68 62 offshore_dem_name3 = datadir + offshore_name3 63 coast_line = datadir + coast_line_name 69 64 70 65 combined_dem_name = datadir + 'west_tas_combined_elevation' 71 ''' 66 72 67 ############################### 73 68 # Domain definitions … … 94 89 ################################################################### 95 90 96 97 91 # exporting asc grid 98 92 eastingmin = 333000 … … 107 101 108 102 # historical slides 109 #slide_origin = [,]103 slide_origin = [338270.5407, 5217273.89] 110 104 111 105 depth = 1750.0 -
anuga_work/production/west_tas_2008/run_west_tas_smf.py
r4968 r5245 54 54 55 55 # filenames 56 on _offshore25_dem_name = project_smf.on_offshore25_dem_name56 onshore_250_dem_name = project_smf.onshore_250_dem_name 57 57 meshname = project_smf.meshname+'.msh' 58 58 59 59 # creates DEM from asc data 60 convert_dem_from_ascii2netcdf(on _offshore25_dem_name, use_cache=True, verbose=True)60 convert_dem_from_ascii2netcdf(onshore_250_dem_name, use_cache=True, verbose=True) 61 61 62 62 #creates pts file for onshore DEM 63 dem2pts(on_offshore25_dem_name, 64 easting_min=project_smf.eastingmin25, 65 easting_max=project_smf.eastingmax25, 66 northing_min=project_smf.northingmin25, 67 northing_max= project_smf.northingmax25, 68 use_cache=True, verbose=True) 63 dem2pts(onshore_250_dem_name, use_cache=True, verbose=True) 69 64 70 65 print 'create offshore' 71 G1 = Geospatial_data(file_name = project_smf.offshore_dem_name1 + '. xya')+\72 Geospatial_data(file_name = project_smf.offshore_dem_name2 + '. xya')+\73 Geospatial_data(file_name = project_smf.offshore_dem_name3 + '. xya')66 G1 = Geospatial_data(file_name = project_smf.offshore_dem_name1 + '.txt')+\ 67 Geospatial_data(file_name = project_smf.offshore_dem_name2 + '.txt')+\ 68 Geospatial_data(file_name = project_smf.offshore_dem_name3 + '.txt') 74 69 75 70 print 'create onshore' 76 G2 = Geospatial_data(file_name = project_smf.on_offshore25_dem_name + '.pts') 71 G2 = Geospatial_data(file_name = project_smf.onshore_250_dem_name + '.pts') 72 73 print 'create coastline' 74 G3 = Geospatial_data(file_name = project_smf.coast_line + '.txt') 77 75 78 76 print 'add' 79 G = G1 + G277 G = G1.clip(Geospatial_data(project_smf.polyAll)) + G2 + G3 80 78 81 79 print 'export points'
Note: See TracChangeset
for help on using the changeset viewer.