Changeset 6262


Ignore:
Timestamp:
Feb 3, 2009, 1:44:29 PM (16 years ago)
Author:
ole
Message:

Cleanup before coding style meeting

Location:
anuga_work/production/busselton/standardised_version
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/standardised_version/build_busselton.py

    r6261 r6262  
    1414
    1515# Standard modules
    16 from os.path import dirname
    17 from os import mkdir, access, F_OK
     16import os
    1817
    1918# Related major packages
    20 from anuga.shallow_water import Domain
    2119from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    22 from anuga.geospatial_data.geospatial_data import *
     20from anuga.geospatial_data.geospatial_data import Geospatial_data
    2321from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files
    2422
     
    3129#------------------------------------------------------------------------------
    3230
    33 #copy_code_files(project.output_build_time_dir,__file__,
    34 #               dirname(project.__file__)+os.sep+ project.__name__+'.py' )
    35 #start_screen_catcher(project.output_build_time_dir)
     31copy_code_files(project.output_build_time_dir,__file__,
     32                os.path.dirname(project.__file__)+os.sep+ project.__name__+'.py' )
     33start_screen_catcher(project.output_build_time_dir)
    3634
    3735
     
    4644print 'project.poly_all', project.poly_all
    4745print 'project.combined_dir_name', project.combined_dir_name
    48 
    49 # input elevation directory filenames
    50 #onshore_in_dir_name = project.onshore_in_dir_name
    51 #coast_in_dir_name = project.coast_in_dir_name
    52 #coast_in_dir_name1 = project.coast_in_dir_name1
    53 #offshore_in_dir_name = project.offshore_in_dir_name
    54 #offshore_in_dir_name1 = project.offshore_in_dir_name1
    55 #offshore_in_dir_name2 = project.offshore_in_dir_name2
    56 #offshore_in_dir_name3 = project.offshore_in_dir_name3
    57 #offshore_in_dir_name4 = project.offshore_in_dir_name4
    58 #offshore_in_dir_name5 = project.offshore_in_dir_name5
    59 
    60 # output elevation directory filenames
    61 #onshore_dir_name = project.onshore_dir_name
    62 #coast_dir_name = project.coast_dir_name
    63 #coast_dir_name1 = project.coast_dir_name1
    64 #offshore_dir_name = project.offshore_dir_name
    65 #offshore_dir_name1 = project.offshore_dir_name1
    66 #offshore_dir_name2 = project.offshore_dir_name2
    67 #offshore_dir_name3 = project.offshore_dir_name3
    68 #offshore_dir_name4 = project.offshore_dir_name4
    69 #offshore_dir_name5 = project.offshore_dir_name5
    70 
    7146
    7247# Create Geospatial data from ASCII files
     
    9065
    9166
    92 #print "creates DEMs from asc data"
    93 #print onshore_in_dir_name, onshore_dir_name
    94 #print offshore_in_dir_name5, offshore_dir_name5
    95 #
    96 #convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)
    97 #
    98 #convert_dem_from_ascii2netcdf(offshore_in_dir_name5, basename_out=offshore_dir_name5, use_cache=True, verbose=True)#
    99 ##
    100 #
    101 # creates pts file for onshore DEM
    102 #print "creates pts file for onshore DEM"
    103 #dem2pts(onshore_dir_name ,use_cache=True,verbose=True)
    104 #dem2pts(offshore_dir_name5 ,use_cache=True,verbose=True)
    105 
    106 # create onshore pts files
    107 #print'create Geospatial data1 objects from topographies'
    108 #G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
    109 
    110 # create coastal and offshore pts files
    111 #print'create Geospatial data2 objects from topographies'
    112 #G2 = Geospatial_data(file_name = coast_in_dir_name)
    113 #print'create Geospatial data3 objects from topographies'
    114 #G3 = Geospatial_data(file_name = coast_in_dir_name1)
    115 #print'create Geospatial data4 objects from topographies'
    116 #G_off = Geospatial_data(file_name = offshore_in_dir_name)
    117 #print'create Geospatial data5 objects from topographies'
    118 #G_off1 = Geospatial_data(file_name = offshore_in_dir_name1)
    119 #print'create Geospatial data6 objects from topographies'
    120 #G_off2 = Geospatial_data(file_name = offshore_in_dir_name2)
    121 #print'create Geospatial data7 objects from topographies'
    122 #G_off3 = Geospatial_data(file_name = offshore_in_dir_name3)
    123 #print'create Geospatial data8 objects from topographies'
    124 #G_off4 = Geospatial_data(file_name = offshore_in_dir_name4)
    125 #print'create Geospatial data9 objects from topographies'
    126 #G_off5 = Geospatial_data(file_name = offshore_dir_name5 + '.pts')
    127 
    128 
    12967#-------------------------------------------------------------------------------
    13068# Combine, clip and export dataset
    13169#-------------------------------------------------------------------------------
    13270
    133 #print'add all geospatial objects'
    134 #G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4
    135 
    13671print 'Add geospatial objects except', project.offshore_name5
    137 print geospatial_data.keys()
    13872G = None
    13973for key in geospatial_data:
     
    14175        G += geospatial_data[key]
    14276       
    143 print 'Clip (outside) combined geospatial object except %s by area of interest.'
     77print 'Clip combined geospatial data'
    14478G_clip = G.clip_outside(project.poly_aoi1)
    145 
    146 print 'Clip combined geospatial object by bounding polygon'
    14779G_all = G_clip + geospatial_data[project.offshore_name5]   # G_off5
    14880G_clipped = G_all.clip(project.poly_all)
    14981
    15082print 'Export combined DEM file'
    151 #if access(project.topographies_dir,F_OK) == 0:
    152 #    mkdir (project.topographies_dir)
    15383G_clipped.export_points_file(project.combined_dir_name + '.pts')
    15484print 'Do txt version too'
  • anuga_work/production/busselton/standardised_version/project.py

    r6261 r6262  
    77
    88import os
    9 from os import sep, environ, getenv, getcwd
    10 from os.path import expanduser
    11 import sys
     9from os import sep, getenv
    1210from time import localtime, strftime, gmtime
    13 from anuga.utilities.polygon import read_polygon, plot_polygons, is_inside_polygon, number_mesh_triangles
     11from anuga.utilities.polygon import read_polygon, number_mesh_triangles
    1412from anuga.utilities.system_tools import get_user_name, get_host_name
    15 from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary
    16 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    1713
    1814#------------------------------------------------------------------------------
  • anuga_work/production/busselton/standardised_version/run_busselton.py

    r6261 r6262  
    1616"""
    1717
    18 # Note repeated use of domain id
    19 # Note naming of fundamental datasets and directories
    20 
    21 
    2218#------------------------------------------------------------------------------
    2319# Import necessary modules
     
    2622# Standard modules
    2723import os
    28 from os.path import dirname
    2924import time
    3025
     
    5045#-----------------------------------------------------------------------
    5146
    52 #copy script must be before screen_catcher
    53 #copy_code_files(project.output_run_time_dir, __file__,
    54 #         dirname(project.__file__)+os.sep+ project.__name__+'.py' )
    55 #start_screen_catcher(project.output_run_time_dir, myid, numprocs)
     47copy script must be before screen_catcher
     48copy_code_files(project.output_run_time_dir, __file__,
     49                os.path.dirname(project.__file__)+os.sep+ project.__name__+'.py' )
     50start_screen_catcher(project.output_run_time_dir, myid, numprocs)
    5651
    5752
     
    133128                     'ocean': Bf})
    134129
     130
    135131#-------------------------------------------------------------------------
    136132# Evolve system through time
Note: See TracChangeset for help on using the changeset viewer.