Changeset 4080


Ignore:
Timestamp:
Dec 14, 2006, 1:48:57 PM (17 years ago)
Author:
nick
Message:

working build_perth

Location:
anuga_work/production/perth_2006
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/perth_2006/build_perth.py

    r4077 r4080  
    5555# Fine pts file to be clipped to area of interest
    5656#-------------------------------------------------------------------------------
    57 
     57print"project.bounding_polygon",project.bounding_polygon
     58print"project.combined_dir_name",project.combined_dir_name
    5859
    5960# topography directory filenames
     61onshore_in_dir_name = project.onshore_in_dir_name
     62coast_in_dir_name = project.coast_in_dir_name
     63island_in_dir_name = project.island_in_dir_name
     64island_in_dir_name1 = project.island_in_dir_name1
     65island_in_dir_name2 = project.island_in_dir_name2
     66island_in_dir_name3 = project.island_in_dir_name3
     67offshore_in_dir_name = project.offshore_in_dir_name
     68
    6069onshore_dir_name = project.onshore_dir_name
    6170coast_dir_name = project.coast_dir_name
    62 islands_dir_name = project.islands_dir_name
    63 islands_dir_name1 = project.islands_dir_name1
    64 islands_dir_name1 = project.islands_dir_name2
     71island_dir_name = project.island_dir_name
     72island_dir_name1 = project.island_dir_name1
     73island_dir_name2 = project.island_dir_name2
     74island_dir_name3 = project.island_dir_name3
    6575offshore_dir_name = project.offshore_dir_name
    6676
    6777# creates DEM from asc data
    68 convert_dem_from_ascii2netcdf(onshore_dir_name, use_cache=True, verbose=True)
    69 convert_dem_from_ascii2netcdf(islands_dir_name, use_cache=True, verbose=True)
    70 convert_dem_from_ascii2netcdf(islands_dir_name1, use_cache=True, verbose=True)
    71 convert_dem_from_ascii2netcdf(islands_dir_name2, use_cache=True, verbose=True)
     78convert_dem_from_ascii2netcdf(onshore_in_dir_name, basename_out=onshore_dir_name, use_cache=True, verbose=True)
     79convert_dem_from_ascii2netcdf(island_in_dir_name, basename_out=island_dir_name, use_cache=True, verbose=True)
     80convert_dem_from_ascii2netcdf(island_in_dir_name1, basename_out=island_dir_name1, use_cache=True, verbose=True)
     81convert_dem_from_ascii2netcdf(island_in_dir_name2, basename_out=island_dir_name2, use_cache=True, verbose=True)
     82convert_dem_from_ascii2netcdf(island_in_dir_name3, basename_out=island_dir_name3, use_cache=True, verbose=True)
    7283
    7384#creates pts file for onshore DEM
     
    8091        verbose=True)
    8192
    82 #creates pts file for islands DEM
    83 dem2pts(islands_dir_name, use_cache=True, verbose=True)
    84 dem2pts(islands_dir_name1, use_cache=True, verbose=True)
    85 dem2pts(islands_dir_name2, use_cache=True, verbose=True)
     93#creates pts file for island DEM
     94dem2pts(island_dir_name, use_cache=True, verbose=True)
     95dem2pts(island_dir_name1, use_cache=True, verbose=True)
     96dem2pts(island_dir_name2, use_cache=True, verbose=True)
     97dem2pts(island_dir_name3, use_cache=True, verbose=True)
    8698
    8799print'create Geospatial data objects from topographies'
    88 G1 = Geospatial_data(file_name = project.onshore_dir_name + '.pts')
    89 G2 = Geospatial_data(file_name = project.coast_dir_name + '.xya')
    90 G3 = Geospatial_data(file_name = project.islands_dir_name + '.pts')
    91 G4 = Geospatial_data(file_name = project.islands_dir_name1 + '.pts')
    92 G5 = Geospatial_data(file_name = project.islands_dir_name2 + '.pts')
    93 G_off = Geospatial_data(file_name = project.offshore_dir_name + '.xya')
     100G1 = Geospatial_data(file_name = onshore_dir_name + '.pts')
     101G2 = Geospatial_data(file_name = coast_in_dir_name + '.xya')
     102G3 = Geospatial_data(file_name = island_dir_name + '.pts')
     103G4 = Geospatial_data(file_name = island_dir_name1 + '.pts')
     104G5 = Geospatial_data(file_name = island_dir_name2 + '.pts')
     105G6 = Geospatial_data(file_name = island_dir_name3 + '.pts')
     106G_off = Geospatial_data(file_name = offshore_in_dir_name + '.xya')
    94107
     108print'add all geospatial objects'
     109G = G1 + G2 + G3 + G4 + G5 + G6 + G_off
    95110
    96 
    97 
    98 
    99 print 'G_offshore_data_old_e'#, G_offshore_old_e.get_data_points()
    100 print'add all geospatial objects'
    101 G = G1 + G2 + G3 + G4 + G5 + G_off
    102 
    103 #print'clip combined geospatial object by bounding polygon'
     111print'clip combined geospatial object by bounding polygon'
    104112G_clipped = G.clip(project.bounding_polygon)
    105113#FIXME: add a clip function to pts
    106 print'shape of clipped data', G_clipped.get_data_points().shape
     114#print'shape of clipped data', G_clipped.get_data_points().shape
    107115
    108116print'export combined DEM file'
  • anuga_work/production/perth_2006/project.py

    r4077 r4080  
    99from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    1010#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
     11from anuga.utilities.system_tools import get_user_name
    1112
    1213# file and system info
     
    2021home += sep +'data'
    2122
     23#time stuff
     24time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
     25gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
     26build_time = time+'_build'
     27run_time = time+'_run'
     28print 'gtime: ', gtime
     29
    2230#Making assumptions about the location of scenario data
    2331state = 'western_australia'
    2432scenario_name = 'perth'
    25 scenario_dir_name = 'perth_tsunami_scenario_2006'
     33scenario = 'perth_tsunami_scenario_2006'
    2634
    2735# onshore data provided by WA DLI
     
    3139island_name1 = 'gard_dli_ext'
    3240island_name2 = 'carnac_island_dted'
     41island_name3 = 'penguin_dted'
    3342
    3443# AHO + DPI data
     
    3948combined_name ='perth_combined_elevation'
    4049
    41 topographies_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'topographies'+sep
     50topographies_in_dir = home+sep+state+sep+scenario+sep+'elevation_final'+sep+'points'+sep
     51topographies_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'topographies'+sep
    4252topographies_time_dir = topographies_dir+build_time+sep
    4353
    4454#input topo file location
     55onshore_in_dir_name = topographies_in_dir + onshore_name
     56island_in_dir_name = topographies_in_dir + island_name
     57island_in_dir_name1 = topographies_in_dir + island_name1
     58island_in_dir_name2 = topographies_in_dir + island_name2
     59island_in_dir_name3 = topographies_in_dir + island_name3
     60
     61coast_in_dir_name = topographies_in_dir + coast_name
     62offshore_in_dir_name = topographies_in_dir + offshore_name
     63
    4564onshore_dir_name = topographies_dir + onshore_name
    4665island_dir_name = topographies_dir + island_name
    4766island_dir_name1 = topographies_dir + island_name1
    4867island_dir_name2 = topographies_dir + island_name2
     68island_dir_name3 = topographies_dir + island_name3
    4969
    5070coast_dir_name = topographies_dir + coast_name
     
    5474combined_dir_name = topographies_dir + combined_name
    5575combined_time_dir_name = topographies_time_dir + combined_name
    56 combined_time_dir_final_name = topographies_time_dir + combined_final_name
     76#combined_time_dir_final_name = topographies_time_dir + combined_final_name
    5777
    5878
    5979#Derive subdirectories and filenames
    6080
    61 meshes_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'meshes'+sep
     81meshes_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'meshes'+sep
    6282meshes_dir_name = meshes_dir + scenario_name
    6383
    64 polygons_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'polygons'+sep
    65 tide_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'tide_data'+sep
     84polygons_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'polygons'+sep
     85tide_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'tide_data'+sep
    6686
     87
     88boundaries_source = 'mag_9_corrected'
    6789#boundaries locations
    68 boundaries_in_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
    69 boundaries_in_dir_name = boundaries_in_dir + boundaries_name
    70 boundaries_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep
    71 boundaries_dir_name = boundaries_dir + boundaries_name
    72 #boundaries_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
     90boundaries_in_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+'urs'+sep+boundaries_source+sep
     91boundaries_in_dir_name = boundaries_in_dir + scenario_name
     92boundaries_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep
     93boundaries_dir_name = boundaries_dir + scenario_name
     94#boundaries_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'boundaries'+sep+build_time+sep
    7395#boundaries_time_dir_name = boundaries_time_dir + boundaries_name  #Used by post processing
    7496#ideas
    7597#boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep
    7698
    77 #time stuff
    78 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
    79 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
    80 build_time = time+'_build'
    81 run_time = time+'_run'
    82 print 'gtime: ', gtime
    83 
    8499#output locations
    85 output_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep
    86 output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep
    87 output_run_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+run_time+sep
     100output_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep
     101output_build_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+build_time+sep
     102output_run_time_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'outputs'+sep+run_time+sep
    88103output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    89104
    90105#gauges
    91106gauge_name = 'perth.csv'
    92 gauges_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep
     107gauges_dir = home+sep+state+sep+scenario+sep+'anuga'+sep+'gauges'+sep
    93108gauges_dir_name = gauges_dir + gauge_name
    94109
     
    123138
    124139poly_penguin = read_polygon(polygons_dir+'penguin_pts.csv')
    125 assert zone == refzone
     140#assert zone == refzone
    126141
    127142
Note: See TracChangeset for help on using the changeset viewer.