Changeset 4318


Ignore:
Timestamp:
Mar 23, 2007, 3:35:36 PM (17 years ago)
Author:
duncan
Message:

bug fix in new urs2sww

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  
    44004400LAT_AMOUNT = 4800
    44014401LONG_AMOUNT = 3600
    4402 def URS_points_needed_to_file(file_name, boundary_polygon,
     4402def URS_points_needed_to_file(file_name, boundary_polygon, zone,
    44034403                              ll_lat=LL_LAT, ll_long=LL_LONG,
    44044404                              grid_spacing=GRID_SPACING,
    44054405                              lat_amount=LAT_AMOUNT, long_amount=LONG_AMOUNT,
    4406                               zone=None, export_csv=False, use_cache=False,
     4406                              export_csv=False, use_cache=False,
    44074407                              verbose=False):
    44084408    """
     
    44194419    Don't add the file extension.  It will be added.
    44204420    """
    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)
    44234424    if not file_name[-4:] == ".urs":
    44244425        file_name += ".urs"
     
    44294430        geo.export_points_file(file_name)
    44304431
    4431 def URS_points_needed(boundary_polygon, ll_lat=LL_LAT,
     4432def URS_points_needed(boundary_polygon, zone, ll_lat=LL_LAT,
    44324433                      ll_long=LL_LONG, grid_spacing=GRID_SPACING,
    44334434                      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)
    44364438    kwargs = {'ll_lat': ll_lat,
    44374439              'll_long': ll_long,
    44384440              'grid_spacing': grid_spacing,
    44394441              'lat_amount': lat_amount,
    4440               'long_amount': long_amount,
    4441               'zone': zone} 
     4442              'long_amount': long_amount} 
    44424443    if use_cache is True:
    44434444        try:
     
    44564457        #I was getting 'got multiple values for keyword argument' errors
    44574458        #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,
    44594461                      ll_long, grid_spacing,
    4460                       lat_amount, long_amount,
    4461                       zone)
     4462                      lat_amount, long_amount)
    44624463
    44634464    return geo   
    4464 def _URS_points_needed(boundary_polygon, ll_lat=LL_LAT,
     4465def _URS_points_needed(boundary_polygon,
     4466                      zone, ll_lat=LL_LAT,
    44654467                      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):
    44684469    """
    44694470
     
    44884489
    44894490    # 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 left
    4492         # corner of the lat long data
    4493         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   
    44944495    lat_long_set = ImmutableSet()
    44954496    for seg in segs:
     
    50295030
    50305031#-------------------------------------------------------------
    5031 if __name__ == "__main__":
    5032     points=Urs_points('urs2sww_test/o_velocity-e-mux')
    5033     for i in points:
    5034         print 'i',i
     5032if __name__ == "__main__":   
    50355033        pass
    50365034
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4303 r4318  
    51985198        lat_amount = 30
    51995199        long_amount = 30
     5200        zone = 50
    52005201
    52015202        boundary_polygon = [[250000,7660000],[280000,7660000],
    52025203                             [280000,7630000],[250000,7630000]]
    5203         geo=URS_points_needed(boundary_polygon,
     5204        geo=URS_points_needed(boundary_polygon, zone,
    52045205                              ll_lat, ll_long, grid_spacing,
    52055206                              lat_amount, long_amount)
     
    56765677        time_step = 400
    56775678        tide = -200000
     5679        zone = 50
    56785680
    56795681        boundary_polygon = [[250000,7660000],[280000,7660000],
    56805682                             [280000,7630000],[250000,7630000]]
    5681         geo=URS_points_needed(boundary_polygon,
     5683        geo=URS_points_needed(boundary_polygon, zone,
    56825684                              ll_lat, ll_long, grid_spacing,
    56835685                              lat_amount, long_amount)
     
    56995701        time_step = 400
    57005702        tide = -200000
     5703        zone = 50
    57015704
    57025705        boundary_polygon = [[250000,7660000],[270000,7650000],
    57035706                             [280000,7630000],[250000,7630000]]
    5704         geo=URS_points_needed(boundary_polygon,
     5707        geo=URS_points_needed(boundary_polygon, zone,
    57055708                              ll_lat, ll_long, grid_spacing,
    57065709                              lat_amount, long_amount, use_cache=True,
     
    57175720        time_step = 400
    57185721        tide = -200000
     5722        zone = 50
    57195723
    57205724        boundary_polygon = [[250000,7660000],[270000,7650000],
    57215725                             [280000,7630000],[250000,7630000]]
    5722         geo=URS_points_needed(boundary_polygon,
     5726        geo=URS_points_needed(boundary_polygon, zone,
    57235727                              ll_lat, ll_long, grid_spacing,
    57245728                              lat_amount, long_amount)
Note: See TracChangeset for help on using the changeset viewer.