Changeset 2624
- Timestamp:
- Mar 29, 2006, 8:42:34 AM (17 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/geospatial_data/geospatial_data.py
r2594 r2624 20 20 geo_reference = None, 21 21 default_attribute_name = None, 22 file_name = None ):23 22 file_name = None, 23 absolute = True): 24 24 25 25 """Create instance from data points and associated attributes … … 47 47 file_name: Name of input file..... 48 48 49 absolute: is the data point absolute or relative to a xll and yll 50 in a zone 51 49 52 """ 50 53 … … 56 59 self.set_geo_reference(geo_reference) 57 60 self.set_default_attribute_name(default_attribute_name) 61 self.set_absolute(absolute) 58 62 59 63 … … 152 156 self.file_name = file_name 153 157 print 'file name from set', self.file_name 154 158 159 def set_absolute(self, absolute = True): 160 if absolute is False: 161 self.absolute = False 162 else: 163 self.absolute = True 164 165 ''' 155 166 def set_self_from_file(self, file_name = None): 156 167 # check if file_name is a string and also that the file exists … … 162 173 self = self.import_points_file(file_name) 163 174 return self 164 175 ''' 165 176 166 177 def get_geo_reference(self): … … 202 213 return self.attributes[attribute_name] 203 214 215 def get_all_attributes(self): 216 """ 217 Return values for all attributes. 218 """ 219 220 return self.attributes 204 221 205 222 def __add__(self, other): 206 """223 ''' 207 224 returns the addition of 2 geospatical objects, 208 225 objects are concatencated to the end of each other … … 210 227 NOTE: doesn't add if objects contain different 211 228 attributes 212 """ 229 230 Always return relative points! 231 ''' 213 232 214 233 … … 237 256 238 257 xll = yll = 0. 239 relative_points1 = self.get_data_points(absolute=False) 240 relative_points2 = other.get_data_points(absolute=False) 241 242 #print 'R1', relative_points1 243 #print 'R2', relative_points2 258 259 relative_points1 = self.get_data_points(absolute = False) 260 relative_points2 = other.get_data_points(absolute = False) 244 261 245 262 246 263 new_relative_points1 = new_geo_ref.change_points_geo_ref(relative_points1, geo_ref1) 247 264 new_relative_points2 = new_geo_ref.change_points_geo_ref(relative_points2, geo_ref2) 248 249 #print 'NR1', new_relative_points1250 #print 'NR2', new_relative_points2251 265 252 266 #Now both point sets are relative to new_geo_ref and zones have been reconciled … … 256 270 new_points = concatenate((new_relative_points1, 257 271 new_relative_points2), 258 axis = 0) 272 axis = 0) 273 # print 'new points:', new_points 259 274 260 275 … … 277 292 return Geospatial_data(new_points, 278 293 new_attributes, 279 new_geo_ref) 280 281 282 294 new_geo_ref, 295 absolute = False) 296 297 298 ''' 283 299 def xxx__add__(self, other): 284 300 """ … … 339 355 raise msg 340 356 341 342 343 ### 344 # IMPORT/EXPORT POINTS FILES 345 ### 357 ''' 358 359 ### 360 # IMPORT/EXPORT POINTS FILES 361 ### 362 def new_import_points_file(self, ofile, delimiter = None, verbose = False): 363 """ load an .xya or .pts file 364 Note: will throw an IOError if it can't load the file. 365 Catch these! 366 """ 367 368 all_data = {} 369 if ofile[-4:]== ".xya": 370 try: 371 if delimiter == None: 372 try: 373 fd = open(ofile) 374 all_data = _read_xya_file(fd, ',') 375 except SyntaxError: 376 fd.close() 377 fd = open(ofile) 378 all_data = _read_xya_file(fd, ' ') 379 else: 380 fd = open(ofile) 381 all_data = _read_xya_file(fd, delimiter) 382 fd.close() 383 except (IndexError,ValueError,SyntaxError): 384 fd.close() 385 msg = 'Could not open file %s ' %ofile 386 raise IOError, msg 387 except IOError, e: 388 # Catch this to add an error message 389 msg = 'Could not open file or incorrect file format %s:%s' %(ofile, e) 390 raise IOError, msg 391 392 elif ofile[-4:]== ".pts": 393 try: 394 # print 'hi from import_points_file' 395 all_data = _read_pts_file(ofile, verbose) 396 # print 'hi1 from import_points_file', all_data 397 except IOError, e: 398 msg = 'Could not open file %s ' %ofile 399 raise IOError, msg 400 else: 401 msg = 'Extension %s is unknown' %ofile[-4:] 402 raise IOError, msg 403 404 return all_data 405 406 def new_export_points_file(self, ofile): 407 """ 408 write a points file, ofile, as a text (.xya) or binary (.pts) file 409 410 ofile is the file name, including the extension 411 412 The point_dict is defined at the top of this file. 413 """ 414 #this was done for all keys in the mesh file. 415 #if not mesh_dict.has_key('points'): 416 # mesh_dict['points'] = [] 417 if (ofile[-4:] == ".xya"): 418 _new_write_xya_file(ofile, self.get_data_points(self.absolute), 419 self.get_all_attributes(), 420 self.get_geo_reference()) 421 elif (ofile[-4:] == ".pts"): 422 _new_write_pts_file(ofile, self.get_data_points(self.absolute), 423 self.get_all_attributes(), 424 self.get_geo_reference()) 425 else: 426 msg = 'Unknown file type %s ' %ofile 427 raise IOError, msg 428 346 429 347 430 def import_points_file( ofile, delimiter = None, verbose = False): … … 388 471 389 472 return all_data 390 473 ''' 391 474 def export_points_file(ofile, point_dict): 392 475 """ … … 407 490 msg = 'Unknown file type %s ' %ofile 408 491 raise IOError, msg 409 492 ''' 410 493 def _read_pts_file(file_name, verbose = False): 411 494 """Read .pts NetCDF file … … 520 603 521 604 522 605 def _new_write_pts_file(file_name, write_data_points, 606 write_attributes, 607 write_geo_reference = None): 608 """Write .pts NetCDF file 609 610 WARNING: This function mangles the point_atts data structure 611 """ 612 #FIXME: (DSG)This format has issues. 613 # There can't be an attribute called points 614 # consider format change 615 # method changed by NB not sure if above statement is correct 616 617 ''' should create new test for this 618 legal_keys = ['pointlist', 'attributelist', 'geo_reference'] 619 for key in point_atts.keys(): 620 msg = 'Key %s is illegal. Valid keys are %s' %(key, legal_keys) 621 assert key in legal_keys, msg 622 ''' 623 from Scientific.IO.NetCDF import NetCDFFile 624 # NetCDF file definition 625 outfile = NetCDFFile(file_name, 'w') 626 627 #Create new file 628 outfile.institution = 'Geoscience Australia' 629 outfile.description = 'NetCDF format for compact and portable storage ' +\ 630 'of spatial point data' 631 632 # dimension definitions 633 shape = write_data_points.shape[0] 634 outfile.createDimension('number_of_points', shape) 635 outfile.createDimension('number_of_dimensions', 2) #This is 2d data 636 637 # variable definition 638 outfile.createVariable('points', Float, ('number_of_points', 639 'number_of_dimensions')) 640 641 #create variables 642 outfile.variables['points'][:] = write_data_points #.astype(Float32) 643 644 for key in write_attributes.keys(): 645 outfile.createVariable(key, Float, ('number_of_points',)) 646 outfile.variables[key][:] = write_attributes[key] #.astype(Float32) 647 648 if write_geo_reference is not None: 649 write_geo_reference.write_NetCDF(outfile) 650 651 outfile.close() 652 653 654 655 def _new_write_xya_file( file_name, write_data_points, 656 write_attributes, 657 write_geo_reference = None, 658 delimiter = ','): 659 """ 660 export a file, ofile, with the xya format 661 662 """ 663 points = write_data_points 664 pointattributes = write_attributes 665 666 fd = open(file_name,'w') 667 titlelist = "" 668 for title in pointattributes.keys(): 669 titlelist = titlelist + title + delimiter 670 titlelist = titlelist[0:-len(delimiter)] # remove the last delimiter 671 fd.write(titlelist+"\n") 672 #<vertex #> <x> <y> [attributes] 673 for i,vert in enumerate( points): 674 675 attlist = "," 676 for att in pointattributes.keys(): 677 attlist = attlist + str(pointattributes[att][i])+ delimiter 678 attlist = attlist[0:-len(delimiter)] # remove the last delimiter 679 attlist.strip() 680 fd.write( str(vert[0]) + delimiter 681 + str(vert[1]) 682 + attlist + "\n") 683 ''' 684 # geo_reference info 685 if xya_dict.has_key('geo_reference') and \ 686 not xya_dict['geo_reference'] is None: 687 xya_dict['geo_reference'].write_ASCII(fd) 688 ''' 689 if write_geo_reference is not None: 690 write_geo_reference.write_ASCII(fd) 691 fd.close() 692 ''' 523 693 def _write_pts_file(file_name, point_atts): 524 694 """Write .pts NetCDF file … … 600 770 xya_dict['geo_reference'].write_ASCII(fd) 601 771 fd.close() 602 772 ''' 603 773 def _point_atts2array(point_atts): 604 774 point_atts['pointlist'] = array(point_atts['pointlist']).astype(Float) … … 682 852 683 853 #FIXME remove dependance on points to dict in export only! 684 G_points_dict = geospatial_data2points_dictionary(G) 685 export_points_file(results_file, G_points_dict) 854 # G_points_dict = geospatial_data2points_dictionary(G) 855 # export_points_file(results_file, G_points_dict) 856 857 # G_points_dict = geospatial_data2points_dictionary(G) 858 859 G.new_export_points_file(results_file) 686 860 687 861 -
inundation/geospatial_data/test_geospatial_data.py
r2594 r2624 301 301 points = [[1.0, 2.1], [3.0, 5.3], [5.0, 6.1], [6.0, 3.3]] 302 302 attributes = [2, 4, 5, 76] 303 303 ''' 304 304 # Use old pointsdict format 305 305 pointsdict = {'pointlist': points, 306 306 'attributelist': {'att1': attributes, 307 307 'att2': array(attributes) + 1}} 308 308 ''' 309 att_dict = {'att1': attributes, 310 'att2': array(attributes) +1} 311 309 312 # Create points as an xya file 310 313 FN = 'test_points.xya' 311 export_points_file(FN, pointsdict) 312 314 G1 = Geospatial_data(points, att_dict) 315 G1.new_export_points_file(FN) 316 # G1.new_export_points_file(ofile) 313 317 314 318 #Create object from file … … 397 401 'imaginary file did not raise error!') 398 402 399 def Xtest_read_write_points_file_bad(self):400 #not used yet as i'm uncertain if "tri_dict" is nesscessary to geospatial_data401 dict = self.tri_dict.copy()402 fileName = tempfile.mktemp(".xxx")403 try:404 export_points_file(fileName,dict)405 except IOError:406 pass407 else:408 self.failUnless(0 ==1,409 'bad points file extension did not raise error!')410 411 403 def test_read_write_points_file_bad2(self): 412 dict = {}404 # dict = {} 413 405 att_dict = {} 414 dict['pointlist']= array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])406 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 415 407 att_dict['elevation'] = array([10.0, 0.0, 10.4]) 416 408 att_dict['brightness'] = array([10.0, 0.0, 10.4]) 417 dict['attributelist'] = att_dict 418 dict['geo_reference'] = Geo_reference(56,1.9,1.9) 419 try: 420 export_points_file("_???/yeah.xya",dict) 409 # dict['attributelist'] = att_dict 410 geo_reference = Geo_reference(56,1.9,1.9) 411 412 G = Geospatial_data(pointlist, att_dict, geo_reference) 413 414 try: 415 # export_points_file("_???/yeah.xya",dict) 416 G.new_export_points_file("_???/yeah.xya") 417 421 418 except IOError: 422 419 pass 423 420 else: 424 self.failUnless(0 == 1,421 self.failUnless(0 == 1, 425 422 'bad points file extension did not raise error!') 426 423 … … 573 570 574 571 def test_export_xya_file(self): 575 dict = {}572 # dict = {} 576 573 att_dict = {} 577 dict['pointlist']= array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])574 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 578 575 att_dict['elevation'] = array([10.0, 0.0, 10.4]) 579 576 att_dict['brightness'] = array([10.0, 0.0, 10.4]) 580 dict['attributelist'] = att_dict 581 dict['geo_reference'] = Geo_reference(56,1.9,1.9) 582 583 584 fileName = tempfile.mktemp(".xya") 585 export_points_file(fileName, dict) 577 # dict['attributelist'] = att_dict 578 geo_reference = Geo_reference(56,1.9,1.9) 579 580 581 fileName = tempfile.mktemp(".xya") 582 G = Geospatial_data( pointlist, att_dict, geo_reference, absolute = False) 583 G.new_export_points_file(fileName) 586 584 dict2 = import_points_file(fileName) 587 585 #print "fileName",fileName … … 594 592 assert allclose(dict2['attributelist']['brightness'], answer) 595 593 #print "dict2['geo_reference']",dict2['geo_reference'] 596 self.failUnless( dict['geo_reference']== dict2['geo_reference'],594 self.failUnless(geo_reference == dict2['geo_reference'], 597 595 'test_writepts failed. Test geo_reference') 598 596 599 597 def test_export_xya_file2(self): 600 dict = {}598 # dict = {} 601 599 att_dict = {} 602 dict['pointlist']= array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])600 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 603 601 att_dict['elevation'] = array([10.0, 0.0, 10.4]) 604 602 att_dict['brightness'] = array([10.0, 0.0, 10.4]) 605 dict['attributelist'] = att_dict606 607 608 fileName = tempfile.mktemp(".xya")609 export_points_file(fileName, dict)603 # dict['attributelist'] = att_dict 604 605 fileName = tempfile.mktemp(".xya") 606 G = Geospatial_data(pointlist, att_dict) 607 G.new_export_points_file(fileName) 610 608 dict2 = import_points_file(fileName) 611 609 #print "fileName",fileName … … 616 614 assert allclose(dict2['attributelist']['elevation'], [10.0, 0.0, 10.4]) 617 615 answer = [10.0, 0.0, 10.4] 616 assert allclose(dict2['attributelist']['brightness'], answer) 617 618 def test_new_export_xya_file2(self): 619 dict = {} 620 att_dict = {} 621 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 622 att_dict['elevation'] = array([10.1, 0.0, 10.4]) 623 att_dict['brightness'] = array([10.0, 1.0, 10.4]) 624 625 fileName = tempfile.mktemp(".xya") 626 627 G = Geospatial_data(pointlist, att_dict) 628 629 G.new_export_points_file(fileName) 630 631 dict2 = import_points_file(fileName) 632 633 os.remove(fileName) 634 635 assert allclose(dict2['pointlist'],[[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 636 assert allclose(dict2['attributelist']['elevation'], [10.1, 0.0, 10.4]) 637 answer = [10.0, 1.0, 10.4] 638 assert allclose(dict2['attributelist']['brightness'], answer) 639 640 def test_new_export_pts_file(self): 641 att_dict = {} 642 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 643 att_dict['elevation'] = array([10.1, 0.0, 10.4]) 644 att_dict['brightness'] = array([10.0, 1.0, 10.4]) 645 646 fileName = tempfile.mktemp(".pts") 647 648 G = Geospatial_data(pointlist, att_dict) 649 650 G.new_export_points_file(fileName) 651 652 dict2 = import_points_file(fileName) 653 654 os.remove(fileName) 655 656 assert allclose(dict2['pointlist'],[[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 657 assert allclose(dict2['attributelist']['elevation'], [10.1, 0.0, 10.4]) 658 answer = [10.0, 1.0, 10.4] 618 659 assert allclose(dict2['attributelist']['brightness'], answer) 619 660 … … 658 699 659 700 def test_writepts(self): 660 dict = {}701 # dict = {} 661 702 att_dict = {} 662 dict['pointlist']= array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])703 pointlist = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 663 704 att_dict['elevation'] = array([10.0, 0.0, 10.4]) 664 705 att_dict['brightness'] = array([10.0, 0.0, 10.4]) 665 dict['attributelist'] = att_dict 666 dict['geo_reference'] = Geo_reference(56,1.9,1.9) 667 706 # dict['attributelist'] = att_dict 707 geo_reference = Geo_reference(56,1.9,1.9) 668 708 669 709 fileName = tempfile.mktemp(".pts") 670 export_points_file(fileName, dict) 710 711 G = Geospatial_data(pointlist, att_dict, geo_reference, absolute = False) 712 713 G.new_export_points_file(fileName) 714 671 715 dict2 = import_points_file(fileName) 672 #print "fileName",fileName 673 os.remove(fileName) 674 #print "dict2",dict2 675 716 717 os.remove(fileName) 718 676 719 assert allclose(dict2['pointlist'],[[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 677 720 assert allclose(dict2['attributelist']['elevation'], [10.0, 0.0, 10.4]) … … 682 725 #print "dict2['geo_reference']",dict2['geo_reference'] 683 726 684 self.failUnless( dict['geo_reference']== dict2['geo_reference'],727 self.failUnless(geo_reference == dict2['geo_reference'], 685 728 'test_writepts failed. Test geo_reference') 686 729 … … 705 748 706 749 from Scientific.IO.NetCDF import NetCDFFile 707 708 750 709 751 # fileName = tempfile.mktemp(".pts") … … 738 780 assert allclose(G.get_geo_reference().get_xllcorner(), 0.0) 739 781 assert allclose(G.get_geo_reference().get_yllcorner(), 0.0) 740 741 782 742 783 assert allclose(G.get_data_points(), [[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) … … 749 790 750 791 from Scientific.IO.NetCDF import NetCDFFile 751 752 792 753 793 FN = 'test_points.pts' … … 761 801 geo_reference.write_NetCDF(outfile) 762 802 763 764 803 # dimension definitions 765 804 outfile.createDimension('number_of_points', 3) … … 775 814 elevation = outfile.variables['elevation'] 776 815 777 778 816 points[0, :] = [1.0,0.0] 779 817 elevation[0] = 10.0 … … 787 825 G = Geospatial_data(file_name = FN) 788 826 789 790 791 827 assert allclose(G.get_geo_reference().get_xllcorner(), xll) 792 828 assert allclose(G.get_geo_reference().get_yllcorner(), yll) 793 794 829 795 830 assert allclose(G.get_data_points(), [[1.0+xll, 0.0+yll], … … 801 836 802 837 803 def xtest_add_points_files(self):838 def test_add_points_files(self): 804 839 '''adds an xya and pts files and checks resulting file is correct 805 840 ''' … … 808 843 809 844 # create files 810 dict1 = {}845 # dict1 = {} 811 846 att_dict1 = {} 812 dict1['pointlist']= array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]])847 pointlist1 = array([[1.0, 0.0],[0.0, 1.0],[1.0, 0.0]]) 813 848 att_dict1['elevation'] = array([-10.0, 0.0, 10.4]) 814 849 att_dict1['brightness'] = array([10.0, 0.0, 10.4]) 815 dict1['attributelist'] = att_dict1816 dict1['geo_reference'] = Geo_reference(56, 1.9, 1.9)817 818 dict2 = {}850 # dict1['attributelist'] = att_dict1 851 geo_reference1 = Geo_reference(56, 2.0, 1.0) 852 853 # dict2 = {} 819 854 att_dict2 = {} 820 dict2['pointlist']= array([[2.0, 1.0],[1.0, 2.0],[2.0, 1.0]])855 pointlist2 = array([[2.0, 1.0],[1.0, 2.0],[2.0, 1.0]]) 821 856 att_dict2['elevation'] = array([1.0, 15.0, 1.4]) 822 857 att_dict2['brightness'] = array([14.0, 1.0, -12.4]) 823 dict2['attributelist'] = att_dict2824 dict2['geo_reference'] = Geo_reference(56, 1.0, 1.0) #FIXME (Ole): I changed this, why does it still pass858 # dict2['attributelist'] = att_dict2 859 geo_reference2 = Geo_reference(56, 1.0, 2.0) #FIXME (Ole): I changed this, why does it still pass 825 860 #OK - it fails now, after the fix revealed by test_create_from_pts_file_with_geo') 861 862 G1 = Geospatial_data(pointlist1, att_dict1, geo_reference1) 863 G2 = Geospatial_data(pointlist2, att_dict2, geo_reference2) 826 864 827 865 fileName1 = tempfile.mktemp(".xya") 828 866 fileName2 = tempfile.mktemp(".pts") 829 867 830 export_points_file(fileName1, dict1)831 export_points_file(fileName2, dict2)868 # G1.new_export_points_file(fileName1) 869 # G2.new_export_points_file(fileName2) 832 870 833 871 results_file = 'resulting_points.pts' 834 872 835 873 # add files 836 add_points_files(fileName1, fileName2, results_file ) 874 875 G = G1 + G2 876 877 G.new_export_points_file(results_file) 878 # add_points_files(fileName1, fileName2, results_file ) 837 879 838 880 #read results 839 881 results_dict = import_points_file(results_file) 882 # print 'results points:', results_dict['pointlist'] 883 # print 'results geo_ref:', results_dict['geo_reference'] 840 884 841 885 assert allclose(results_dict['pointlist'], 842 [[ 1.0, 0.0],[0.0, 1.0],843 [ 1.0, 0.0],[2.0, 1.0],844 [1.0, 2.0],[2.0, 1.0]])886 [[2.0, 0.0],[1.0, 1.0], 887 [2.0, 0.0],[2.0, 2.0], 888 [1.0, 3.0],[2.0, 2.0]]) 845 889 assert allclose(results_dict['attributelist']['elevation'], 846 890 [-10.0, 0.0, 10.4, 1.0, 15.0, 1.4]) … … 849 893 assert allclose(results_dict['attributelist']['brightness'], answer) 850 894 851 self.failUnless(results_dict['geo_reference'] == dict2['geo_reference'],895 self.failUnless(results_dict['geo_reference'] == geo_reference1, 852 896 'test_writepts failed. Test geo_reference') 853 897 854 os.remove(fileName1)855 os.remove(fileName2)898 # os.remove(fileName1) 899 # os.remove(fileName2) 856 900 os.remove(results_file) 857 901 -
production/onslow_2006/project.py
r2616 r2624 47 47 polygondir = home+sep+scenario_dir_name+sep+'polygons'+sep 48 48 boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep 49 print'bound', boundarydir 50 51 # boundary source data 52 MOST_dir = 'f:'+sep+'3'+sep+'ehn'+sep+'users'+sep+'davidb'+sep+'tsunami'+sep+'WA_project'+sep+'SU-AU_90'+sep+'most_2'+sep+'detailed'+sep 49 53 50 54 codedir = getcwd()+sep -
production/onslow_2006/run_onslow.py
r2616 r2624 55 55 source_dir = project.boundarydir 56 56 57 # creates copy of code in output dir 57 # creates copy of code in output dir if dir doesn't exist 58 58 if access(project.outputdir,F_OK) == 0 : 59 59 mkdir (project.outputdir) 60 60 copy (project.codedirname, project.outputdir + project.codename) 61 61 copy (project.codedir + 'run_onslow.py', project.outputdir + 'run_onslow.py') 62 62 print'hello' 63 print' most file', project.MOST_dir + project.boundary_basename+'_ha.nc' 64 if access(project.MOST_dir + project.boundary_basename+'_ha.nc',F_OK) == 1 : 65 print' most file', project.MOST_dir + project.boundary_basename 63 66 64 67 ''' … … 79 82 80 83 ''' 84 ''' 81 85 print'create G1' 82 86 G1 = Geospatial_data(file_name = project.offshore_dem_name + '.xya') … … 91 95 G.new_export_points_file(project.combined_dem_name + '.pts') 92 96 93 '''94 add_points_files(95 project.offshore_dem_name + '.xya',96 project.onshore_dem_name + '.pts',97 project.combined_dem_name + '.pts')98 97 ''' 99 98 #------------------------------------------------------------------------------- … … 106 105 107 106 # original 108 interior_res = 5000 107 interior_res = 50000 109 108 interior_regions = [[project.poly_onslow, interior_res], 110 109 [project.poly_thevenard, interior_res], … … 119 118 'left': [2], 'bottom': [3], 120 119 'bottomright': [4], 'topright': [5]}, 121 'maximum_triangle_area': 100000 ,120 'maximum_triangle_area': 1000000, 122 121 'filename': meshname, 123 122 'interior_regions': interior_regions}, … … 167 166 domain.set_quantity('friction', 0.0) 168 167 print 'hi and file',project.combined_dem_name + '.pts' 168 169 169 domain.set_quantity('elevation', 170 170 # 0. … … 176 176 alpha = 0.1 177 177 ) 178 178 179 print 'hi1' 179 180 … … 190 191 191 192 cache(ferret2sww, 192 (source_dir + project.boundary_basename, 193 # (source_dir + project.boundary_basename, 194 # source_dir + project.boundary_basename), 195 (project.MOST_dir + project.boundary_basename, 193 196 source_dir + project.boundary_basename), 194 197 {'verbose': True,
Note: See TracChangeset
for help on using the changeset viewer.