Changeset 4318
- Timestamp:
- Mar 23, 2007, 3:35:36 PM (18 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
r4303 r4318 4400 4400 LAT_AMOUNT = 4800 4401 4401 LONG_AMOUNT = 3600 4402 def URS_points_needed_to_file(file_name, boundary_polygon, 4402 def URS_points_needed_to_file(file_name, boundary_polygon, zone, 4403 4403 ll_lat=LL_LAT, ll_long=LL_LONG, 4404 4404 grid_spacing=GRID_SPACING, 4405 4405 lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT, 4406 zone=None,export_csv=False, use_cache=False,4406 export_csv=False, use_cache=False, 4407 4407 verbose=False): 4408 4408 """ … … 4419 4419 Don't add the file extension. It will be added. 4420 4420 """ 4421 geo = URS_points_needed(boundary_polygon, ll_lat, ll_long, grid_spacing, 4422 lat_amount, long_amount, zone, use_cache, verbose) 4421 geo = URS_points_needed(boundary_polygon, zone, ll_lat, ll_long, 4422 grid_spacing, 4423 lat_amount, long_amount,use_cache, verbose) 4423 4424 if not file_name[-4:] == ".urs": 4424 4425 file_name += ".urs" … … 4429 4430 geo.export_points_file(file_name) 4430 4431 4431 def URS_points_needed(boundary_polygon, ll_lat=LL_LAT,4432 def URS_points_needed(boundary_polygon, zone, ll_lat=LL_LAT, 4432 4433 ll_long=LL_LONG, grid_spacing=GRID_SPACING, 4433 4434 lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT, 4434 zone=None, use_cache=False, verbose=False): 4435 args = (boundary_polygon) 4435 use_cache=False, verbose=False): 4436 args = (boundary_polygon, 4437 zone) 4436 4438 kwargs = {'ll_lat': ll_lat, 4437 4439 'll_long': ll_long, 4438 4440 'grid_spacing': grid_spacing, 4439 4441 'lat_amount': lat_amount, 4440 'long_amount': long_amount, 4441 'zone': zone} 4442 'long_amount': long_amount} 4442 4443 if use_cache is True: 4443 4444 try: … … 4456 4457 #I was getting 'got multiple values for keyword argument' errors 4457 4458 #geo = apply(_URS_points_needed, args, kwargs) 4458 geo = _URS_points_needed(boundary_polygon, ll_lat, 4459 geo = _URS_points_needed(boundary_polygon, 4460 zone, ll_lat, 4459 4461 ll_long, grid_spacing, 4460 lat_amount, long_amount, 4461 zone) 4462 lat_amount, long_amount) 4462 4463 4463 4464 return geo 4464 def _URS_points_needed(boundary_polygon, ll_lat=LL_LAT, 4465 def _URS_points_needed(boundary_polygon, 4466 zone, ll_lat=LL_LAT, 4465 4467 ll_long=LL_LONG, grid_spacing=GRID_SPACING, 4466 lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT, 4467 zone=None): 4468 lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT): 4468 4469 """ 4469 4470 … … 4488 4489 4489 4490 # convert the segs to Lat's and longs. 4490 if zone is None:4491 # Assume the zone of the segments is the same as the lower left4492 # corner of the lat long data4493 zone, _, _ = redfearn(ll_lat, ll_long)4491 4492 # Don't assume the zone of the segments is the same as the lower left 4493 # corner of the lat long data!! They can easily be in different zones 4494 4494 4495 lat_long_set = ImmutableSet() 4495 4496 for seg in segs: … … 5029 5030 5030 5031 #------------------------------------------------------------- 5031 if __name__ == "__main__": 5032 points=Urs_points('urs2sww_test/o_velocity-e-mux') 5033 for i in points: 5034 print 'i',i 5032 if __name__ == "__main__": 5035 5033 pass 5036 5034 -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r4303 r4318 5198 5198 lat_amount = 30 5199 5199 long_amount = 30 5200 zone = 50 5200 5201 5201 5202 boundary_polygon = [[250000,7660000],[280000,7660000], 5202 5203 [280000,7630000],[250000,7630000]] 5203 geo=URS_points_needed(boundary_polygon, 5204 geo=URS_points_needed(boundary_polygon, zone, 5204 5205 ll_lat, ll_long, grid_spacing, 5205 5206 lat_amount, long_amount) … … 5676 5677 time_step = 400 5677 5678 tide = -200000 5679 zone = 50 5678 5680 5679 5681 boundary_polygon = [[250000,7660000],[280000,7660000], 5680 5682 [280000,7630000],[250000,7630000]] 5681 geo=URS_points_needed(boundary_polygon, 5683 geo=URS_points_needed(boundary_polygon, zone, 5682 5684 ll_lat, ll_long, grid_spacing, 5683 5685 lat_amount, long_amount) … … 5699 5701 time_step = 400 5700 5702 tide = -200000 5703 zone = 50 5701 5704 5702 5705 boundary_polygon = [[250000,7660000],[270000,7650000], 5703 5706 [280000,7630000],[250000,7630000]] 5704 geo=URS_points_needed(boundary_polygon, 5707 geo=URS_points_needed(boundary_polygon, zone, 5705 5708 ll_lat, ll_long, grid_spacing, 5706 5709 lat_amount, long_amount, use_cache=True, … … 5717 5720 time_step = 400 5718 5721 tide = -200000 5722 zone = 50 5719 5723 5720 5724 boundary_polygon = [[250000,7660000],[270000,7650000], 5721 5725 [280000,7630000],[250000,7630000]] 5722 geo=URS_points_needed(boundary_polygon, 5726 geo=URS_points_needed(boundary_polygon, zone, 5723 5727 ll_lat, ll_long, grid_spacing, 5724 5728 lat_amount, long_amount)
Note: See TracChangeset
for help on using the changeset viewer.