Changeset 5250
- Timestamp:
- Apr 29, 2008, 5:19:37 PM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r5249 r5250 4403 4403 return long, lat, quantity 4404 4404 4405 #### END URS 2 SWW ### 4406 4407 #### URS UNGRIDDED 2 SWW ### 4408 4409 ### PRODUCING THE POINTS NEEDED FILE ### 4405 #### END URS 2 SWW ### 4406 4407 #### URS UNGRIDDED 2 SWW ### 4408 4409 ### PRODUCING THE POINTS NEEDED FILE ### 4410 4410 4411 # Ones used for FESA 2007 results 4411 4412 #LL_LAT = -50.0 … … 4440 4441 geo = URS_points_needed(boundary_polygon, zone, ll_lat, ll_long, 4441 4442 grid_spacing, 4442 lat_amount, long_amount,use_cache, verbose)4443 lat_amount, long_amount,use_cache, verbose) 4443 4444 if not file_name[-4:] == ".urs": 4444 4445 file_name += ".urs" … … 4449 4450 geo.export_points_file(file_name) 4450 4451 4451 def URS_points_needed(boundary_polygon, zone, ll_lat =LL_LAT,4452 ll_long =LL_LONG, grid_spacing=GRID_SPACING,4453 lat_amount =LAT_AMOUNT, long_amount=LONG_AMOUNT,4452 def URS_points_needed(boundary_polygon, zone, ll_lat, 4453 ll_long, grid_spacing, 4454 lat_amount, long_amount, 4454 4455 use_cache=False, verbose=False): 4455 4456 args = (boundary_polygon, … … 4477 4478 #geo = apply(_URS_points_needed, args, kwargs) 4478 4479 geo = _URS_points_needed(boundary_polygon, 4480 zone, ll_lat, 4481 ll_long, grid_spacing, 4482 lat_amount, long_amount) 4483 4484 return geo 4485 4486 def _URS_points_needed(boundary_polygon, 4479 4487 zone, ll_lat, 4480 4488 ll_long, grid_spacing, 4481 lat_amount, long_amount) 4482 4483 return geo 4484 def _URS_points_needed(boundary_polygon, 4485 zone, ll_lat=LL_LAT, 4486 ll_long=LL_LONG, grid_spacing=GRID_SPACING, 4487 lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT): 4489 lat_amount, long_amount): 4488 4490 """ 4489 4491 4490 4492 boundary_polygon - a list of points that describes a polygon. 4491 4493 The last point is assumed ot join the first point. 4492 This is in UTM (lat long would b ebetter though)4494 This is in UTM (lat long would b better though) 4493 4495 4494 4496 ll_lat - lower left latitude, in decimal degrees … … 4501 4503 4502 4504 msg = "grid_spacing can not be zero" 4503 assert not grid_spacing == 0, msg4505 assert not grid_spacing == 0, msg 4504 4506 a = boundary_polygon 4505 4507 # List of segments. Each segment is two points. -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5245 r5250 6119 6119 6120 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) 6121 # Values used for FESA 2007 results 6122 # domain in southern hemisphere zone 51 6123 LL_LAT = -50.0 6124 LL_LONG = 80.0 6125 GRID_SPACING = 2.0/60.0 6126 LAT_AMOUNT = 4800 6127 LONG_AMOUNT = 3600 6128 ZONE = 51 6129 6130 poly1 = [[296361.89, 8091928.62], 6131 [429495.07,8028278.82], 6132 [447230.56,8000674.05], 6133 [429661.2,7982177.6], 6134 [236945.9,7897453.16], 6135 [183493.44,7942782.27], 6136 [226583.04,8008058.96]] 6137 6138 URS_points_needed_to_file('test_example_poly2', poly1, 6139 ZONE, 6140 LL_LAT, LL_LONG, 6141 GRID_SPACING, 6142 LAT_AMOUNT, LONG_AMOUNT, 6143 verbose=self.verbose) 6144 6145 6146 def Xtest_URS_points_needed_poly2(self): 6147 # Values used for 2004 validation work 6148 # domain in northern hemisphere zone 47 6149 LL_LAT = 0.0 6150 LL_LONG = 90.0 6151 GRID_SPACING = 2.0/60.0 6152 LAT_AMOUNT = (15-LL_LAT)/GRID_SPACING 6153 LONG_AMOUNT = (100-LL_LONG)/GRID_SPACING 6154 ZONE = 47 6155 6156 poly2 = [[419336.424,810100.845], 6157 [342405.0281,711455.8026], 6158 [274649.9152,723352.9603], 6159 [272089.092,972393.0131], 6160 [347633.3754,968551.7784], 6161 [427979.2022,885965.2313], 6162 [427659.0993,875721.9386], 6163 [429259.6138,861317.3083], 6164 [436301.8775,840830.723]] 6165 6166 URS_points_needed_to_file('test_example_poly2', poly2, 6167 ZONE, 6168 LL_LAT, LL_LONG, 6169 GRID_SPACING, 6170 LAT_AMOUNT, LONG_AMOUNT, 6171 verbose=self.verbose) 6138 6172 6139 6173 #### END TESTS URS UNGRIDDED 2 SWW ###
Note: See TracChangeset
for help on using the changeset viewer.