Ignore:
Timestamp:
Nov 8, 2006, 4:04:55 PM (17 years ago)
Author:
nick
Message:

update to dampier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/dampier_2006/build_dampier.py

    r3905 r3940  
    3232from anuga.pmesh.mesh_interface import create_mesh_from_regions
    3333from anuga.geospatial_data.geospatial_data import *
    34 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
     34from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files
    3535
    3636# Application specific imports
     
    4242#------------------------------------------------------------------------------
    4343
    44 if access(project.output_build_time_dir,F_OK) == 0:
    45     mkdir (project.output_build_time_dir)
    46 copy (dirname(project.__file__) +sep+ project.__name__+'.py',
    47       project.output_build_time_dir + project.__name__+'.py')     #copies project.py
    48 copy (__file__, project.output_build_time_dir + basename(__file__))
    49 print 'files '+ project.__name__+'.py and '+ basename(__file__)+' copied to '+ project.output_build_time_dir       #copies this file
    50 #import sys; sys.exit()
    51 
    52 
    53 #normal screen output is stored in
    54 screen_output_name = project.output_build_time_dir + "screen_output.txt"
    55 screen_error_name = project.output_build_time_dir + "screen_error.txt"
    56 
    57 #used to catch screen output to file
    58 sys.stdout = Screen_Catcher(screen_output_name)
    59 sys.stderr = Screen_Catcher(screen_error_name)
     44copy_code_files(project.output_build_time_dir,__file__,
     45               dirname(project.__file__)+sep+ project.__name__+'.py' )
     46
     47start_screen_catcher(project.output_build_time_dir)
    6048
    6149print 'USER:    ', project.user
     
    125113G_off13 = Geospatial_data(file_name = project.offshore_dir_name13 + '.xya')
    126114G_off14 = Geospatial_data(file_name = project.offshore_dir_name14 + '.xya')
    127 
     115'''
     116
     117
     118print'clip nw', project.clip_poly_nw
     119print'clip e', project.clip_poly_e
     120
     121print'reading combined_dir_name'
     122G_offshore_data = Geospatial_data(file_name = project.topographies_dir+'dampier_combined_elevation_final.pts')
     123
     124print'reading offshore_dir_name_old'
     125G_offshore_old = Geospatial_data(file_name = project.offshore_dir_name_old + '.pts')
     126
     127'''
     128print 'G_offshore_data_old_nw',
     129G_nw_name = project.topographies_dir + 'nw_old_data'
     130G_offshore_nw = G_offshore_old.clip(project.clip_poly_nw)
     131G_offshore_nw.export_points_file(G_nw_name + '.pts')
     132G_offshore_nw.export_points_file(G_nw_name + '.xya')
     133G_nw = array(G_offshore_nw.get_data_points())
     134print'shape of arr nw data', G_nw.shape
     135print' max and min of array 0',max(G_nw[:,0]),min(G_nw[:,0])
     136print' max and min of array 1',max(G_nw[:,1]),min(G_nw[:,1])
     137
     138print 'G_offshore_data_old_e'#, G_offshore_old_nw.get_data_points()
     139G_e_name = project.topographies_dir+'e_old_data'
     140G_offshore_e = G_offshore_old.clip(project.clip_poly_e)
     141G_offshore_e.export_points_file(G_e_name + '.pts')
     142G_offshore_e.export_points_file(G_e_name + '.xya')
     143G_e = array(G_offshore_e.get_data_points())
     144print'shape of arr e data', G_e.shape
     145print' max and min of array 0',max(G_e[:,0]),min(G_e[:,0])
     146print' max and min of array 1',max(G_e[:,1]),min(G_e[:,1])
     147'''
     148
     149print 'G_offshore_data_mid_e'#, G_offshore_old_nw.get_data_points()
     150G_mid_e_name = project.topographies_dir+'mid_e_old_data'
     151G_offshore_mid_e = G_offshore_old.clip(project.clip_poly_mid_e)
     152G_offshore_mid_e.export_points_file(G_mid_e_name + '.pts')
     153G_offshore_mid_e.export_points_file(G_mid_e_name + '.xya')
     154G_mid_e = array(G_offshore_mid_e.get_data_points())
     155print'shape of arr e data', G_mid_e.shape
     156print' max and min of array 0',max(G_mid_e[:,0]),min(G_mid_e[:,0])
     157print' max and min of array 1',max(G_mid_e[:,1]),min(G_mid_e[:,1])
     158
     159print 'G_offshore_data_mid_w'#, G_offshore_old_nw.get_data_points()
     160G_mid_w_name = project.topographies_dir+'mid_w_old_data'
     161G_offshore_mid_w = G_offshore_old.clip(project.clip_poly_mid_w)
     162G_offshore_mid_w.export_points_file(G_mid_w_name + '.pts')
     163G_offshore_mid_w.export_points_file(G_mid_w_name + '.xya')
     164G_mid_w = array(G_offshore_mid_w.get_data_points())
     165print'shape of arr e data', G_mid_w.shape
     166print' max and min of array 0',max(G_mid_w[:,0]),min(G_mid_w[:,0])
     167print' max and min of array 1',max(G_mid_w[:,1]),min(G_mid_w[:,1])
     168
     169
     170print 'G_offshore_data_old_e'#, G_offshore_old_e.get_data_points()
    128171print'add all geospatial objects'
    129 G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \
    130     + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \
    131     + G_off13 + G_off14
    132 
    133 print'clip combined geospatial object by bounding polygon'
    134 G.clip(project.bounding_polygon)
     172#G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \
     173#    + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \
     174#    + G_off13 + G_off14
     175
     176G = G_offshore_data + G_offshore_mid_w + G_offshore_mid_e
     177print'shape of arr G data', G.get_data_points().shape
     178
     179
     180#print'clip combined geospatial object by bounding polygon'
     181G_clipped = G.clip(project.bounding_polygon)
    135182#FIXME: add a clip function to pts
     183print'shape of clipped data', G_clipped.get_data_points().shape
    136184
    137185print'export combined DEM file'
    138186if access(project.topographies_time_dir,F_OK) == 0:
    139187    mkdir (project.topographies_time_dir)
    140 G.export_points_file(project.combined_time_dir_name + '.pts')
     188G_clipped.export_points_file(project.combined_time_dir_final_name + '.pts')
     189G_clipped.export_points_file(project.combined_time_dir_final_name + '.xya')
    141190'''
    142191#-------------------------------------------------------------------------
     
    156205if access(project.boundaries_time_dir,F_OK) == 0:
    157206    mkdir (project.boundaries_time_dir)
    158 '''
    159 urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name,
    160         minlat=project.south_boundary, maxlat=project.north_boundary,
    161         minlon= project.west_boundary, maxlon=project.east_boundary,
    162         mint=0, maxt= 35000,
    163         verbose='true')
    164 
    165 
    166 urs2sww(boundaries_in_dir_name, basename_out= project.boundaries_time_dir_name,
    167 #        minlat=project.south, maxlat=project.north,
    168 #        minlon= project.west, maxlon=project.east,
    169         minlat=project.south_boundary, maxlat=project.north_boundary,
    170         minlon= project.east_boundary, maxlon=project.west_boundary,
    171         mint=0, maxt= 35000,
    172         verbose='true')
    173 '''
     207
    174208from caching import cache
    175209cache(urs2sww,
     
    193227       )
    194228#       dependencies = source_dir + project.boundary_basename + '.sww')
    195    
    196 
    197 
    198 
    199 
    200 
    201 
    202 
    203 
     229'''   
     230
     231
     232
     233
     234
     235
     236
     237
Note: See TracChangeset for help on using the changeset viewer.