Changeset 5250


Ignore:
Timestamp:
Apr 29, 2008, 5:19:37 PM (17 years ago)
Author:
ole
Message:

Fixed references to old 'default' values for LL_LAT, LL_LONG etc
Updated tests to use those values explicitly
Disabled test that still fails in regard to the northern hemisphere example (see ticket:277)

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  
    44034403    return long, lat, quantity
    44044404
    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
    44104411# Ones used for FESA 2007 results
    44114412#LL_LAT = -50.0
     
    44404441    geo = URS_points_needed(boundary_polygon, zone, ll_lat, ll_long,
    44414442                            grid_spacing,
    4442                       lat_amount, long_amount,use_cache, verbose)
     4443                            lat_amount, long_amount,use_cache, verbose)
    44434444    if not file_name[-4:] == ".urs":
    44444445        file_name += ".urs"
     
    44494450        geo.export_points_file(file_name)
    44504451
    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,
     4452def URS_points_needed(boundary_polygon, zone, ll_lat,
     4453                      ll_long, grid_spacing,
     4454                      lat_amount, long_amount,
    44544455                      use_cache=False, verbose=False):
    44554456    args = (boundary_polygon,
     
    44774478        #geo = apply(_URS_points_needed, args, kwargs)
    44784479        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
     4486def _URS_points_needed(boundary_polygon,
    44794487                      zone, ll_lat,
    44804488                      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):
    44884490    """
    44894491
    44904492    boundary_polygon - a list of points that describes a polygon.
    44914493                      The last point is assumed ot join the first point.
    4492                       This is in UTM (lat long would be better though)
     4494                      This is in UTM (lat long would b better though)
    44934495
    44944496    ll_lat - lower left latitude, in decimal degrees
     
    45014503   
    45024504    msg = "grid_spacing can not be zero"
    4503     assert not grid_spacing ==0, msg
     4505    assert not grid_spacing == 0, msg
    45044506    a = boundary_polygon
    45054507    # List of segments.  Each segment is two points.
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r5245 r5250  
    61196119
    61206120    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)
    61386172       
    61396173    #### END TESTS URS UNGRIDDED 2 SWW ###
Note: See TracChangeset for help on using the changeset viewer.