Ignore:
Timestamp:
Sep 25, 2008, 2:24:38 PM (15 years ago)
Author:
kristy
Message:

Updated all scripts to reflect Perth format. Also added 250m scripts

File:
1 edited

Legend:

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

    r5646 r5786  
    1 """Script for running tsunami inundation scenario for Dampier, WA, Australia.
     1"""
     2Script for building the elevation data to run a tsunami inundation scenario
     3for busselton, WA, Australia.
    24
    3 Source data such as elevation and boundary data is assumed to be available in
    4 directories specified by project.py
    5 The output sww file is stored in project.output_time_dir
     5Input: elevation data from project.py
     6Output: pts file stored in project.topographies_dir
     7The run_busselton.py is reliant on the output of this script.
    68
    7 The scenario is defined by a triangular mesh created from project.polygon,
    8 the elevation data and a simulated submarine landslide.
    9 
    10 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006
    119"""
    1210
     
    2725from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    2826from anuga.geospatial_data.geospatial_data import *
    29 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters
     27from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files
    3028
    3129# Application specific imports
     
    4240start_screen_catcher(project.output_build_time_dir)
    4341
    44 print 'USER: ', project.user
     42print 'USER:    ', project.user
    4543
    4644#-------------------------------------------------------------------------------
     
    5149# Fine pts file to be clipped to area of interest
    5250#-------------------------------------------------------------------------------
    53 print"project.poly_all",project.poly_all
    54 print"project.combined_dir_name",project.combined_dir_name
     51print "project.poly_all", project.poly_all
     52print "project.combined_dir_name", project.combined_dir_name
    5553
    56 # topography directory filenames
     54# input elevation directory filenames
    5755onshore_in_dir_name = project.onshore_in_dir_name
    5856coast_in_dir_name = project.coast_in_dir_name
     
    6563offshore_in_dir_name5 = project.offshore_in_dir_name5
    6664
     65# output elevation directory filenames
    6766onshore_dir_name = project.onshore_dir_name
    6867coast_dir_name = project.coast_dir_name
     
    7473offshore_dir_name4 = project.offshore_dir_name4
    7574offshore_dir_name5 = project.offshore_dir_name5
    76 
    7775# creates DEM from asc data
    78 print "creates DEMs from ascii data"
     76print "creates DEMs from asc data"
    7977convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)
    8078
    81 #creates pts file for onshore DEM
     79# creates pts file for onshore DEM
    8280print "creates pts file for onshore DEM"
    83 dem2pts(onshore_dir_name,
    84 #        easting_min=project.eastingmin,
    85 #        easting_max=project.eastingmax,
    86 #        northing_min=project.northingmin,
    87 #        northing_max= project.northingmax,
    88         use_cache=True,
    89         verbose=True)
     81dem2pts(onshore_dir_name ,use_cache=True,verbose=True)
    9082
    91 #creates pts file for island DEM
    92 #dem2pts(island_dir_name, use_cache=True, verbose=True)
     83# create onshore pts files
     84print'create Geospatial data1 objects from topographies'
     85G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
    9386
    94 print'create Geospatial data1 objects from topographies'
    95 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts',verbose=True)
    96 G2 = Geospatial_data(file_name = coast_in_dir_name + '.txt',verbose=True)
    97 G3 = Geospatial_data(file_name = coast_in_dir_name1 + '.txt',verbose=True)
    98 G_off = Geospatial_data(file_name = offshore_in_dir_name + '.txt',verbose=True)
    99 G_off1 = Geospatial_data(file_name = offshore_in_dir_name1 + '.txt',verbose=True)
    100 G_off2 = Geospatial_data(file_name = offshore_in_dir_name2 + '.txt',verbose=True)
    101 G_off3 = Geospatial_data(file_name = offshore_in_dir_name3 + '.txt',verbose=True)
    102 G_off4 = Geospatial_data(file_name = offshore_in_dir_name4 + '.txt',verbose=True)
    103 G_off5 = Geospatial_data(file_name = offshore_in_dir_name5 + '.txt',verbose=True)
     87# create coastal and offshore pts files
     88print'create Geospatial data2 objects from topographies'
     89G3 = Geospatial_data(file_name = coast_in_dir_name)
     90print'create Geospatial data3 objects from topographies'
     91G4 = Geospatial_data(file_name = coast_in_dir_name1)
     92print'create Geospatial data4 objects from topographies'
     93G_off = Geospatial_data(file_name = offshore_in_dir_name)
     94print'create Geospatial data5 objects from topographies'
     95G_off1 = Geospatial_data(file_name = offshore_in_dir_name1)
     96print'create Geospatial data6 objects from topographies'
     97G_off2 = Geospatial_data(file_name = offshore_in_dir_name2)
     98print'create Geospatial data7 objects from topographies'
     99G_off3 = Geospatial_data(file_name = offshore_in_dir_name3)
     100print'create Geospatial data8 objects from topographies'
     101G_off4 = Geospatial_data(file_name = offshore_in_dir_name4)
     102print'create Geospatial data9 objects from topographies'
     103G_off5 = Geospatial_data(file_name = offshore_in_dir_name5)
     104
     105
     106#-------------------------------------------------------------------------------
     107# Combine, clip and export dataset
     108#-------------------------------------------------------------------------------
     109
    104110print'add all geospatial objects'
    105111G = G1 + G2 + G3 + G_off + G_off1 + G_off2 + G_off3 + G_off4 + G_off5
     
    111117if access(project.topographies_dir,F_OK) == 0:
    112118    mkdir (project.topographies_dir)
    113 G_clipped.export_points_file(project.combined_dir_name + '.txt')
     119G_clipped.export_points_file(project.combined_dir_name + '.pts')
     120#G_clipped.export_points_file(project.combined_dir_name + '.txt') #Use for comparision in ARC
    114121
    115 print'project.combined_dir_name + .txt',project.combined_dir_name + '.txt'
    116 
    117 ###-------------------------------------------------------------------------
    118 ### Convert URS to SWW file for boundary conditions
    119 ###-------------------------------------------------------------------------
    120 ##print 'starting to create boundary conditions'
    121 ##from anuga.shallow_water.data_manager import urs2sww, urs_ungridded2sww
    122 ##
    123 ##boundaries_in_dir_name = project.boundaries_in_dir_name
    124 ##print 'boundaries_in_dir_name',project.boundaries_in_dir_name
    125 ##
    126 ##
    127 ###import sys; sys.exit()
    128 ##
    129 ##urs_ungridded2sww(project.boundaries_in_dir_name, project.boundaries_in_dir_name,
    130 ##                  verbose=True, mint=4000, maxt=80000, zscale=1)
    131 ##
Note: See TracChangeset for help on using the changeset viewer.