Ignore:
Timestamp:
Oct 25, 2006, 3:19:29 PM (17 years ago)
Author:
nick
Message:

build_dampier.py is working
run_dampier.py should work... it is still running
project.py is working

File:
1 edited

Legend:

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

    r3841 r3851  
    3030from anuga.shallow_water import Reflective_boundary
    3131from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    32 
    3332from anuga.pmesh.mesh_interface import create_mesh_from_regions
    34 
    3533from anuga.geospatial_data.geospatial_data import *
    3634
     
    3836import project   # Definition of file names and polygons
    3937
    40 
    41 
    4238#------------------------------------------------------------------------------
    4339# Copy scripts to time stamped output directory and capture screen
    4440# output to file
    4541#------------------------------------------------------------------------------
     42#print 'project.build_time', project.build_time
     43#print 'project.output_build_time_dir',project.output_build_time_dir
     44#print '__file__, project.output_time_dir + basename(__file__)', __file__, project.output_build_time_dir + basename(__file__)
     45#print 'dirname(project.__file__) +sep+ project.__name__', dirname(project.__file__) +sep+ project.__name__+'.py'
     46#print'project.topographies_time_dir',project.topographies_time_dir, project.combined_time_dir_name + '.pts'
     47#print project.boundaries_time_dir, project.boundaries_time_dir_name
     48#import sys; sys.exit()
     49if access(project.output_build_time_dir,F_OK) == 0:
     50    mkdir (project.output_build_time_dir)
     51copy (dirname(project.__file__) +sep+ project.__name__+'.py',
     52      project.output_build_time_dir + project.__name__+'.py')     #copies project.py
     53copy (__file__, project.output_build_time_dir + basename(__file__))
     54print 'files '+ project.__name__+'.py and '+ basename(__file__)+' copied to '+ project.output_build_time_dir       #copies this file
     55#import sys; sys.exit()
    4656
    47 
    48 
    49 # creates copy of code in output dir if dir doesn't exist
    50 if access(project.output_time_dir,F_OK) == 0:
    51     mkdir (project.output_time_dir)
    52 copy (dirname(project.__file__) +sep+ project.__name__+'.py',
    53       project.output_time_dir + project.__name__+'.py')     #copies project.py
    54 copy (__file__, project.output_time_dir + basename(__file__))
    55 print 'project.output_time_dir',project.output_time_dir       #copies this file
    56 
    57 
    58 
    59 
    60 boundary_dir_name = project.boundary_dir_name
    61 
    62 
    63 from anuga.shallow_water.data_manager import urs2sww
    64 
    65 print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary
    66 print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary
    67 
    68 #import sys; sys.exit()
    69 urs2sww(boundary_dir_name,
    70 #        minlat=project.south, maxlat=project.north,
    71 #        minlon= project.west, maxlon=project.east,
    72 #        mint=0, maxt= 35000,
    73         verbose='true')
    74        
    75 import sys; sys.exit()
    7657#-------------------------------------------------------------------------------
    7758# Preparation of topographic data
     
    10283offshore_dir_name14 = project.offshore_dir_name14
    10384
    104 
    105 
    106 # files to be used
    107 #file_used = []
    108 
    10985# creates DEM from asc data
    11086convert_dem_from_ascii2netcdf(onshore_dir_name, use_cache=True, verbose=True)
     
    12096        verbose=True)
    12197
    122 
    12398#creates pts file for islands DEM
    12499dem2pts(islands_dir_name, use_cache=True, verbose=True)
    125100
    126 
    127 print'create G1'
     101print'create Geospatial data objects from topographies'
    128102G1 = Geospatial_data(file_name = project.onshore_dir_name + '.pts')
    129103G2 = Geospatial_data(file_name = project.coast_dir_name + '.xya')
     
    145119G_off14 = Geospatial_data(file_name = project.offshore_dir_name14 + '.xya')
    146120
    147 print'add G1+G2+G3+all offshore data'
     121print'add all geospatial objects'
    148122G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5 \
    149123    + G_off6 + G_off7 + G_off8 + G_off9 + G_off10 + G_off11 + G_off12 \
    150124    + G_off13 + G_off14
    151125
     126print'clip combined geospatial object by bounding polygon'
    152127G.clip(project.bounding_polygon)
    153128#FIXME: add a clip function to pts
    154129
    155 print'export G'
    156 G.export_points_file(project.combined_dir_name + '.pts')
    157 import sys; sys.exit()
    158 
    159 
     130print'export combined DEM file'
     131if access(project.topographies_time_dir,F_OK) == 0:
     132    mkdir (project.topographies_time_dir)
     133G.export_points_file(project.combined_time_dir_name + '.pts')
    160134
    161135#-------------------------------------------------------------------------
    162136# Convert URS to SWW file for boundary conditions
    163137#-------------------------------------------------------------------------
    164 
    165 # filenames
    166 meshname = project.mesh_name+'.msh'
    167 source_dir = project.boundarydir
    168 boundary_file = project.boundaryname
    169 
    170 print 'Available boundary tags', domain.get_boundary_tags()
     138print 'starting to create boundary conditions'
     139boundaries_dir_name = project.boundaries_dir_name
    171140
    172141from anuga.shallow_water.data_manager import urs2sww
    173142
    174 urs2sww(boundary_file,
    175         minlat=project.north_boundary, maxlat=project.south_boundary,
     143print 'minlat=project.north_boundary, maxlat=project.south_boundary',project.north_boundary, project.south_boundary
     144print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary
     145
     146if access(project.boundaries_time_dir,F_OK) == 0:
     147    mkdir (project.boundaries_time_dir)
     148urs2sww(boundaries_dir_name,basename_out= project.boundaries_time_dir_name,
     149        minlat=project.south_boundary, maxlat=project.north_boundary,
    176150        minlon= project.west_boundary, maxlon=project.east_boundary,
     151        mint=0, maxt= 35000,
    177152        verbose='true')
     153       
    178154
    179155
     
    182158
    183159
     160
     161
Note: See TracChangeset for help on using the changeset viewer.