Changeset 5404


Ignore:
Timestamp:
Jun 13, 2008, 3:50:07 PM (15 years ago)
Author:
ole
Message:

Fixed clipping of polygons.
Updated polygon files
Played with resolutions.

Location:
anuga_work/development/boxingday08
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/boxingday08/combine_good_data.py

    r5393 r5404  
    11from anuga.geospatial_data.geospatial_data import *
     2from anuga.utilities.numerical_tools import ensure_numeric
    23import project
    34from os.path import exists
     
    7273
    7374dir='data'
    74 print 'Converting .xya files to .csv format'
     75print 'Converting .xyz files to .csv format'
    7576for filename in filenames:
    7677    if not exists(dir+sep+filename+'.csv'):
    7778        xyz2csv(dir+sep+filename)
    7879    else:
    79         print dir+sep+filename+'.csv already exists ensure the .xya changed has not changed'
     80        print dir+sep+filename+'.csv already exists ensure the .xyz changed has not changed'
    8081
    8182print 'Clipping .csv files'
     
    8788
    8889print 'Creating geospatial data'
    89 if exists(project.good_combined_dir_name +'.pts'):
    90     print project.good_combined_dir_name +'.pts'+' already exists ensure the input .csv files have not changed'
    91 else:
    92     G0 = Geospatial_data(file_name=dir+sep+filenames[0]+'.csv')
    93     print 'read bay'
    94     G1=Geospatial_data(file_name=dir+sep+filenames[1]+'_clipped.csv')
    95     print 'read andaman'
    96     G1.clip(project.bounding_polygon)
    97     print 'clipped andaman'
    98     G1.clip_outside(G0)
     90G0 = Geospatial_data(file_name=dir+sep+filenames[0]+'.csv')
     91print 'read bay'
     92G1 = Geospatial_data(file_name=dir+sep+filenames[1]+'_clipped.csv')
     93print 'read andaman'
     94bounding_polygon=ensure_numeric(project.bounding_polygon)
     95G1 = G1.clip(bounding_polygon)
     96print 'clipped andaman'
     97bay_grid_poly=ensure_numeric(project.bay_grid_poly)
     98G1 = G1.clip_outside(bay_grid_poly)
    9999
    100     G = G0 + G1
     100# Plot the two point sets
     101data_3s=G1.get_data_points()
     102data_1s=G0.get_data_points()
    101103
    102     print 'Creating .pts file'
    103     G.export_points_file(project.good_combined_dir_name +'.pts')
     104from pylab import *
     105hold(True)
     106plot(data_3s[:,0],data_3s[:,1],'r.')
     107#plot(data_1s[:,0],data_1s[:,1],'b.')
     108#plot(bounding_polygon[:,0],bounding_polygon[:,1],'k-')
     109show()
     110
     111
     112G = G0 + G1
     113
     114print 'Creating .pts file'
     115G.export_points_file(project.good_combined_dir_name +'.pts')
  • anuga_work/development/boxingday08/export_results.py

    r5393 r5404  
    44from anuga.shallow_water.data_manager import sww2dem
    55from os import sep
     6import project
    67
    78#name='good_simulation/good_simulation_polylinefriction20080529_115703'
     
    3637        quantity = quantityname,
    3738        cellsize = 20,
    38         easting_min = 417348,
    39         easting_max = 425656,
    40         northing_min = 870565,
    41         northing_max = 877008,   
     39        easting_min = project.bay_west,
     40        easting_max = project.bay_east,
     41        northing_min = project.bay_south,
     42        northing_max = project.bay_borth,   
    4243        reduction = max,
    4344        verbose = True,
  • anuga_work/development/boxingday08/mesh_polygons/20m.csv

    r5247 r5404  
    1 419517.9812,889806.5043
    2 422812.9129,886474.9623
    31422520.03,882374.603
    42422666.4714,879262.7231
     
    75424423.7683,869194.8766
    86424057.6648,865607.0622
    9 423691.5613,862824.6755
    107424643.4304,859310.0817
    11 427425.8171,854184.6326
    12 429036.6726,846359.013
    13 425961.4031,841892.5501
    14 417467.8016,850450.3768
    158409999.2899,866851.8141
    169407070.4618,879299.3335
    17 406411.4755,891380.7494
    18 405972.1513,898776.0403
    19 404214.8544,903791.6584
  • anuga_work/development/boxingday08/mesh_polygons/extent.csv

    r5247 r5404  
    1 419336.424,810100.845
    2 342405.0281,711455.8026
    31274649.9152,723352.9603
    4 272089.092,972393.0131
    5 347633.3754,968551.7784
     2272089.092,922393.0131
    63427979.2022,885965.2313
    74427659.0993,875721.9386
    85429259.6138,861317.3083
    9 436301.8775,840830.723
  • anuga_work/development/boxingday08/project.py

    r5402 r5404  
    126126south = 5.9
    127127
     128
     129bay_west = 417348.0
     130bay_east = 425656.0
     131bay_south = 870565.0
     132bay_north = 877008.0
     133
     134bay_grid_poly=[[bay_west,bay_south],[bay_west,bay_north],[bay_east,bay_north],[bay_east,bay_south]]
     135
    128136check_ferret_extent=False
    129137if check_ferret_extent:
  • anuga_work/development/boxingday08/run_boxingday_most.py

    r5401 r5404  
    112112          #, evaluate=True
    113113          )
    114 
    115114
    116115#------------------------------------------------------------------------------
     
    197196
    198197print 'Available boundary tags', domain.get_boundary_tags()
    199 Bf = File_boundary(project.boundary_most_out+'.sww',
    200                     domain, time_thinning=1, use_cache=True,verbose = True)
     198#Bf = File_boundary(project.boundary_most_out+'.sww',
     199#                    domain, time_thinning=1, use_cache=True,verbose = True)
    201200Br = Reflective_boundary(domain)
    202201Bd = Dirichlet_boundary([tide,0.0,0.0])
    203202
    204 domain.set_boundary({'ocean': Bf,
     203domain.set_boundary({'ocean': Bd,
    205204                     'otherocean': Bd,
    206205                     'land': Br,
Note: See TracChangeset for help on using the changeset viewer.