Changeset 5943


Ignore:
Timestamp:
Nov 12, 2008, 11:20:44 AM (15 years ago)
Author:
kristy
Message:

Updated script, works like a charm!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/perth/asc2raster_GDA94z50.py

    r5928 r5943  
    1616gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
    1717gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
     18gp.overwriteoutput = 1
    1819
    1920output_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\"
     21scenario_dir="perth_tsunami_scenario\\anuga\\outputs\\"
    2022
    21 ##Perth
    22 scenario_dir="perth_tsunami_scenario\\anuga\\outputs\\"
     23
    2324time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt'
    2425time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'
     
    3435
    3536    # Local variables...
    36     folder = output_dir + scenario_dir + time_dir
    37     raster_gbd = output_dir + scenario_dir + time_dir + 'raster.gdb'
     37    folder = output_dir + scenario_dir + time_dir + '\\'
     38    raster_gbd = folder + 'raster.gdb'
    3839   
    3940    # Process: Create File GDB...
    40     gp.CreateFileGDB_management(time_dir, "raster")
     41    gp.CreateFileGDB_management(folder, "raster")
    4142
    4243    gp.Workspace = raster_gbd
    4344
     45    #print gp.Workspace
     46   
    4447    #replication dictionary
    45     replicate = (('perth', ''),('Geordie', 'Geo'),('Sorrento', 'Sor'),
    46                  ('Fremantle', 'Fre'),('Rockingham', 'Rock'),
    47                  ('time_39900_0', 'b'), ('time_79800_0', 'c'), ('_', ''))
     48    replicate = (('perth', ''),('time_39900_0', 'b'), ('time_79800_0', 'c'),
     49                 ('_', ''),('Geordie', 'Geo'),('Sorrento', 'Sor'),
     50                 ('Fremantle', 'Fre'),('Rockingham', 'Roc'),('depth','_depth'),
     51                 ('speed', '_speed'), ('elevation', '_elev_'), ('stage','_stage'))
    4852
    4953    generate_filename = []
    50     input_ascii = glob.glob(folder + '*.asc')
     54    input_ascii = glob.glob(folder + '*max.asc')
    5155
    5256    for infile in input_ascii:
     
    6064        generate_filename.append(output_DEM)
    6165
     66        #print 'input %s and output %s' %(infile,output_DEM)
     67
    6268        # Process: ASCII to Raster (4)...
    6369        gp.ASCIIToRaster_conversion(infile, output_DEM, "FLOAT")
     
    6975
    7076
     77
Note: See TracChangeset for help on using the changeset viewer.