Changeset 5150


Ignore:
Timestamp:
Mar 10, 2008, 4:00:52 PM (17 years ago)
Author:
nick
Message:

update geraldton

Location:
anuga_work/production/geraldton
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/geraldton/build_geraldton.py

    r5012 r5150  
    3636#------------------------------------------------------------------------------
    3737
    38 
    3938print 'time stamp: ',project.build_time
    40 print 'USER: ', project.user
    41 
    4239
    4340copy_code_files(project.output_build_time_dir,__file__,
     
    4542
    4643start_screen_catcher(project.output_build_time_dir)
     44
     45print 'time stamp: ',project.build_time
     46print 'USER: ', project.user, project.host
    4747
    4848
     
    8181
    8282print'create Geospatial data1 objects from topographies'
    83 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
     83G1 = Geospatial_data(file_name = onshore_dir_name + '.pts',verbose=True)
    8484print'finished reading in %s.pts' %onshore_dir_name
    85 G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt')
    86 G3 = Geospatial_data(file_name = island_dir_name + '.pts')
    87 G4 = Geospatial_data(file_name = offshore_in_dir_name + '.txt')
     85G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt',verbose=True)
     86G3 = Geospatial_data(file_name = island_dir_name + '.pts',verbose=True)
     87G4 = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True)
    8888print'finished reading in files'
    8989
    90 G_onshore_clip = G1.clip(project.poly_all, verbose=True)
    91 print 'finished clip'
    92 G_onshore_clip_clipout=G_onshore_clip.clip_outside(project.poly_cbd, verbose=True)
    93 print 'finished clipout'
    94 # reduce resolution by 9 time (1/9) of the original file. This was determined
    95 # as the resolution for this region is going to be 20000 and the asc grid cellsize is
    96 # 30m there (900). The sqrt of 20000 is about 140 or 150, a 150m x150m grid would contain
    97 # 36 points at a 30m grid spacing and we only need 4. So 4/36 is 1/9 or 0.11111
    98 G_onshore_clip_clipout_reduced=G_onshore_clip_clipout.split(0.111, verbose=True)
     90#G_onshore_clip = G1.clip(project.poly_all, verbose=True)
     91#print 'finished clip'
     92#G_onshore_clip_clipout=G_onshore_clip.clip_outside(project.poly_cbd, verbose=True)
     93#print 'finished clipout'
     94## reduce resolution by 10 time (1/10) of the original file. This was determined
     95## as the resolution for this region is going to be 20000 and the asc grid cellsize is
     96## 10m there (100). There is 2 20000m triangles in a 200m x 200m grid sqrt of 40000 is about 200,
     97## a 200m x 200m area would contain 400 points at a 10m grid spacing and we only need 4. So 4/400 is 1/100 or 0.01
     98## 1/100 reduction is possible but a 1/10 is enough to help with file size and loading
     99#G_onshore_clip_clipout_reduced=G_onshore_clip_clipout.split(0.1, verbose=True)
     100#
     101#G_cbd = G1.clip(projec.poly_cbd,verbose=True)
     102##G_cbd_reduced = G_cbd.split(0.25, verbose=True)
     103#
     104#G_bathy = G4.clip(project.poly_all)
     105#G_island = G3.clip(project.poly_all)
     106#G_coast = G2.clip(project.poly_all)
     107#
     108#print'add all geospatial objects'
     109#G = G_onshore_clip_clipout_reduced + G_cbd_reduced + G_bathy + G_island + G_coast
    99110
    100 G_cbd = G1.clip(projec.poly_cbd,verbose=True)
    101 G_cbd_reduced = G_cbd.split(0.25, verbose=True)
     111G = G1 + G2 + G3 + G4
    102112
    103 G_bathy = G4.clip(project.poly_all)
    104 G_island = G3.clip(project.poly_all)
    105 G_coast = G2.clip(project.poly_all)
    106 
    107 print'add all geospatial objects'
    108 G = G_onshore_clip_clipout_reduced + G_cbd_reduced + G_bathy + G_island + G_coast
     113G_clip = G.clip(project.poly_all, verbose=True)
    109114
    110115print'clip combined geospatial object by bounding polygon'
     
    116121if access(project.topographies_dir,F_OK) == 0:
    117122    mkdir (project.topographies_dir)
    118 G.export_points_file(project.combined_dir_name + '.txt')
     123G_clip.export_points_file(project.combined_dir_name + '.txt')
    119124#G_clipped.export_points_file(project.combined_dir_name + '.xya')
    120 G_small, = G.split(0.1, verbose)
     125G_small,G_other = G_clip.split(0.01, verbose=True)
    121126G_small.export_points_file(project.combined_dir_name_small + '.txt')
    122127
  • anuga_work/production/geraldton/project.py

    r5012 r5150  
    3939starttime=10000
    4040midtime=21600
    41 finaltime=25000
     41#finaltime=25000
     42finaltime=10000
    4243export_cellsize=50
    43 setup='trial'
     44setup='final'
    4445source='other'
    4546
     
    7374
    7475#final topo name
    75 combined_name ='geraldton_combined_elevation.pts'
    76 combined_smaller_name = 'geraldton_combined_elevation_smaller'
     76combined_name ='geraldton_combined_elevation'
     77combined_name_small = 'geraldton_combined_elevation_small'
    7778
    7879anuga_dir = home+state+sep+scenario+sep+'anuga'+sep
    7980
    80 topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
    81 topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
     81topographies_in_dir = home+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
     82topographies_dir = home+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
    8283
    8384#input topo file location
     
    9596#final topo files
    9697combined_dir_name = topographies_dir + combined_name
    97 combined_smaller_dir_name = topographies_dir + combined_smaller_name
     98combined_dir_name_small = topographies_dir + combined_name_small
    9899
    99100meshes_dir = anuga_dir+'meshes'+sep
     
    127128#output locations
    128129output_dir = anuga_dir+'outputs'+sep
    129 output_build_time_dir = output_dir+build_time+'_'+source+sep
     130output_build_time_dir = output_dir+build_time+dir_comment+sep
    130131output_run_time_dir = output_dir +run_time+dir_comment+sep
    131132#output_run_time_dir = output_dir+sep+run_time+sep
     
    134135#gauges
    135136gauge_name = '???.csv'
    136 gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
     137gauges_dir = home+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
    137138gauges_dir_name = gauges_dir + gauge_name
    138139
     
    171172
    172173poly_neg20_pos20 = read_polygon(polygons_dir+'neg20_pos20_points.csv')
    173 res_neg20_pos20 = 25000*res_factor
     174res_neg20_pos20 = 20000*res_factor
    174175
    175176poly_neg10_pos10= read_polygon(polygons_dir+'neg10_pos10_points.csv')
    176 res_neg10_pos10 = 5000*res_factor
     177res_neg10_pos10 = 2000*res_factor
    177178
    178179poly_cbd = read_polygon(polygons_dir+'cbd_points.csv')
     
    180181
    181182poly_wallabi = read_polygon(polygons_dir+'island_wallabi_poly_points.csv')
    182 res_wallabi = 25000*res_factor
     183res_wallabi = 20000*res_factor
     184
    183185poly_dingiville = read_polygon(polygons_dir+'island_dingiville_poly_points.csv')
    184 res_dingiville = 25000*res_factor
     186res_dingiville = 20000*res_factor
     187
    185188poly_pelsaert = read_polygon(polygons_dir+'island_pelsaert_poly_points.csv')
    186 res_pelsaert = 25000*res_factor
     189res_pelsaert = 20000*res_factor
    187190
    188191
  • anuga_work/production/geraldton/run_geraldton.py

    r5007 r5150  
    168168    print 'domain id', id(domain)
    169169    #print 'Reading Boundary file',project.boundaries_dir_namea + '.sww'
     170    print'set_boundary'
     171
     172    Br = Reflective_boundary(domain)
     173    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
     174    Bo = Dirichlet_boundary([kwargs['tide']+5.0,0,0])
    170175
    171176    if project.source != 'other':
     
    173178                    domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    174179                    use_cache=True, verbose=True)
    175                    
    176     kwargs['input_start_time']=domain.starttime
    177 
    178     print 'finished reading boundary file'
    179 
    180     Br = Reflective_boundary(domain)
    181     Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    182     Bo = Dirichlet_boundary([kwargs['tide']+5.0,0,0])
    183 
    184 
    185     print'set_boundary'
    186 
    187     domain.set_boundary({'back': Br,
    188                          'side': Bd,
    189                          'ocean': Bf})
     180        print 'finished reading boundary file'
     181        domain.set_boundary({'back': Br,
     182                             'side': Bd,
     183                             'ocean': Bf})
     184    else:
     185        print 'set ocean'               
     186        domain.set_boundary({'back': Br,
     187                             'side': Bd,
     188                             'ocean': Bd})
     189
     190#    kwargs['input_start_time']=domain.starttime
     191
     192
     193
    190194    print'finish set boundary'
    191195
     
    195199    t0 = time.time()
    196200
    197     for t in domain.evolve(yieldstep = 240, finaltime = kwargs['starttime']):
     201    for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']):
    198202        domain.write_time()
    199203        domain.write_boundary_statistics(tags = 'ocean')     
    200204
    201         if allclose(t, 120):
     205        if allclose(t, 240):
    202206            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
    203207
    204         if allclose(t, 720):
     208        if allclose(t, 1440):
    205209            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
    206210
     
    274278   
    275279    kwargs['output_dir']=project.output_run_time_dir
    276     kwargs['bathy_file']=project.combined_dir_name
    277 #    kwargs['bathy_file']=project.combined_small_dir_name + '.pts'
     280#    kwargs['bathy_file']=project.combined_dir_name+'.txt'
     281    kwargs['bathy_file']=project.combined_dir_name_small + '.txt'
    278282    kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww'
    279283    kwargs['file_name']=project.home+'detail.csv'
Note: See TracChangeset for help on using the changeset viewer.