Ignore:
Timestamp:
Sep 15, 2006, 12:30:30 PM (18 years ago)
Author:
duncan
Message:
 
Location:
anuga_work/production/MOST_example/MOST_example
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/MOST_example/MOST_example/project.py

    r3578 r3601  
    77#from anuga.utilities.polygon import read_polygon
    88import sys
    9 from anuga.pmesh.create_mesh import convert_points_from_latlon_to_utm
    109from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
    1110from time import localtime, strftime
     
    5251#Derive subdirectories and filenames
    5352time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
    54 outputtimedir = home+sep+state+sep+scenario_dir_name+sep+'anuga'+sep+'outputs'+sep+time+sep
     53outputtimedir = time+sep
    5554
    5655#print 'outputtimedir', outputtimedir
     
    8079tidal_filename = tidedir + 'pt_hedland_tide.txt'
    8180
    82 meshname = meshdir + basename
     81meshname = basename+time
     82mesh_elevname = basename+time+'_elev'
    8383#onshore_dem_name = datadir + onshore_name_dted
    8484onshore_dem_name = datadir + onshore_name_dli
     
    8686offshore_dem_name2 = datadir + offshore_name2
    8787coast_dem_name = datadir + coast_name
    88 combined_dem_name = datadir + 'pt_hedland_combined_elevation'
     88combined_dem_name = 'pt_hedland_combined_elevation'
    8989outputname = outputtimedir + basename  #Used by post processing
    9090
  • anuga_work/production/MOST_example/MOST_example/run_pt_hedland.py

    r3576 r3601  
    3131from anuga.pyvolution.util import Screen_Catcher
    3232
     33from anuga.fit_interpolate.fit import fit_to_mesh_file
     34
    3335# Application specific imports
    3436import project                 # Definition of file names and polygons
     
    4749
    4850# normal screen output is stored in
    49 screen_output_name = project.outputtimedir + "screen_output.txt"
    50 screen_error_name = project.outputtimedir + "screen_error.txt"
     51#screen_output_name = project.outputtimedir + "screen_output.txt"
     52#screen_error_name = project.outputtimedir + "screen_error.txt"
    5153
    5254# used to catch screen output to file
    53 sys.stdout = Screen_Catcher(screen_output_name)
    54 sys.stderr = Screen_Catcher(screen_error_name)
     55#sys.stdout = Screen_Catcher(screen_output_name)
     56#sys.stderr = Screen_Catcher(screen_error_name)
    5557print 'USER:    ', project.user
    5658
     
    6466
    6567# filenames
    66 meshname = project.meshname+'.msh'
     68meshname = project.meshname + '.tsh'
     69mesh_elevname = project.mesh_elevname  + '.tsh'
    6770source_dir = project.boundarydir
    6871
    69 # fine data (clipping the points file to smaller area)
    70 # creates DEM from asc data
    71 convert_dem_from_ascii2netcdf(project.onshore_dem_name, use_cache=True, verbose=True)
    72 
    73 #creates pts file from DEM
    74 dem2pts(project.onshore_dem_name,
    75         easting_min=project.eastingmin,
    76         easting_max=project.eastingmax,
    77         northing_min=project.northingmin,
    78         northing_max= project.northingmax,
    79         use_cache=True,
    80         verbose=True)
    81 
    82 print 'create G1'
    83 G1 = Geospatial_data(file_name = project.offshore_dem_name1 + '.xya')
    84 print 'create G2'
    85 G2 = Geospatial_data(file_name = project.offshore_dem_name2 + '.xya')
    86 print 'create G3'
    87 G3 = Geospatial_data(file_name = project.onshore_dem_name + '.pts')
    88 print 'create G4'
    89 G4 = Geospatial_data(file_name = project.coast_dem_name + '.xya')
    90 print 'add G1+G2+G3+G4'
    91 G = G1 + G2 + G3 + G4
    92 print 'export G'
    93 G.export_points_file(project.combined_dem_name + '.pts')
    9472
    9573#-------------------------------------------------------------------------------                                 
     
    10179from anuga.pmesh.mesh_interface import create_mesh_from_regions
    10280
    103 region_res = 500000
    104 coast_res = 500
    105 pt_hedland_res = 5000
     81region_res = 5000000
     82coast_res = 500000
     83pt_hedland_res = 500000
    10684interior_regions = [[project.poly_pt_hedland, pt_hedland_res],
    10785                    [project.poly_region, region_res]]
    10886
    10987print 'number of interior regions', len(interior_regions)
    110 
    111 from anuga.utilities.polygon import plot_polygons
    112 if sys.platform == 'win32':
    113     #figname = project.outputtimedir + 'pt_hedland_polys'
    114     figname = 'pt_hedland_polys_test'
    115     plot_polygons([project.polyAll,project.poly_pt_hedland,project.poly_region],
    116               figname,
    117               verbose = True)   
    11888
    11989print 'start create mesh from regions'
     
    12595                             'bottom1': [4], 'bottom2': [5],
    12696                             'bottom3': [6], 'right': [7]},
    127            'maximum_triangle_area': 250000,
     97           'maximum_triangle_area': 5000000,
    12898           'filename': meshname,           
    12999           'interior_regions': interior_regions},
    130100          verbose = True, evaluate=True)
    131101
     102cache(fit_to_mesh_file,(meshname,
     103                 'pt_hedland_combined_elevation_31204' + '.pts',
     104                 mesh_elevname),
     105      {'verbose': True}
     106      #,evaluate = True     
     107      ,verbose = False
     108      )
    132109#-------------------------------------------------------------------------------                                 
    133110# Setup computational domain
    134111#-------------------------------------------------------------------------------                                 
    135 domain = Domain(meshname, use_cache = False, verbose = True)
     112domain = Domain(mesh_elevname, use_cache = False, verbose = True)
    136113
    137114print domain.statistics()
     
    158135print 'hi and file',project.combined_dem_name + '.pts'
    159136
    160 domain.set_quantity('elevation',
    161                     filename = project.combined_dem_name + '.pts',
    162                     use_cache = True,
    163                     verbose = True,
    164                     alpha = 0.1
    165                     )
     137#domain.set_quantity('elevation',
     138#                    filename = project.combined_dem_name + '.pts',
     139#                    use_cache = True,
     140#                    verbose = True,
     141#                    alpha = 0.1
     142 #                   )
    166143
    167144#-------------------------------------------------------------------------------                                 
     
    180157#note only need to do when an SWW file for the MOST boundary doesn't exist
    181158cache(ferret2sww,
    182       (source_dir + project.boundary_basename,
    183        source_dir + project.boundary_basename+'_'+project.basename),
     159      (project.boundary_basename,
     160       project.boundary_basename+'_'+project.basename),
    184161      {'verbose': True,
    185162       'minlat': south,
     
    190167       'origin': domain.geo_reference.get_origin(),
    191168       'mean_stage': tide,
    192        'zscale': 1,                 #Enhance tsunami
     169       'zscale': 10,                 #Enhance tsunami
    193170       'fail_on_NaN': False,
    194171       'inverted_bathymetry': True},
     
    199176print 'Available boundary tags', domain.get_boundary_tags()
    200177
    201 Bf = File_boundary(source_dir + project.boundary_basename + '.sww',
     178Bf = File_boundary(project.boundary_basename+'_'+project.basename + '.sww',
    202179                    domain, verbose = True)
    203180Br = Reflective_boundary(domain)
Note: See TracChangeset for help on using the changeset viewer.