Ignore:
Timestamp:
Nov 28, 2008, 11:54:56 AM (15 years ago)
Author:
kristy
Message:

general maintenance of scripts

File:
1 edited

Legend:

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

    r5943 r6032  
    1313gp = arcgisscripting.create()
    1414
     15# Check out any necessary licenses
     16gp.CheckOutExtension("spatial")
     17
    1518# Load required toolboxes...
     19gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
    1620gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
    1721gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
    1822gp.overwriteoutput = 1
    1923
    20 output_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\"
    21 scenario_dir="perth_tsunami_scenario\\anuga\\outputs\\"
     24scenario_dir="\\\\nas2\\gemd\\georisk_models\\inundation\\data\\western_australia\\perth_tsunami_scenario\\"
     25output_dir = "anuga\\outputs\\"
    2226
    2327
    2428time_dir1 = '20081031_133353_run_final_0.6_68693_alpha0.1_kvanputt'
    25 time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'
    26 time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'
    27 time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt'
    28 time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'
    29 time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'
     29##time_dir2 = '20081031_133511_run_final_0_68693_alpha0.1_kvanputt'
     30##time_dir3 = '20081031_133624_run_final_0_27255_alpha0.1_kvanputt'
     31##time_dir4 = '20081031_133735_run_final_0.6_27255_alpha0.1_kvanputt'
     32##time_dir5 = '20081031_133841_run_final_0_27283_alpha0.1_kvanputt'
     33##time_dir6 = '20081031_133925_run_final_0.6_27283_alpha0.1_kvanputt'
    3034
    3135
    32 time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
     36time_dirs = [time_dir1]#, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
    3337
    3438for time_dir in time_dirs:
    3539
    3640    # Local variables...
    37     folder = output_dir + scenario_dir + time_dir + '\\'
     41    folder =  scenario_dir + output_dir + time_dir + '\\'
    3842    raster_gbd = folder + 'raster.gdb'
     43    land = scenario_dir + "map_work\\Perth.gdb\\poly_all_cut"
    3944   
    4045    # Process: Create File GDB...
    41     gp.CreateFileGDB_management(folder, "raster")
     46    #gp.CreateFileGDB_management(folder, "raster")
    4247
    4348    gp.Workspace = raster_gbd
     
    4752    #replication dictionary
    4853    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'))
     54                 ('_', ''),('Geordie', 'Geo'),('Sorrento', 'Sor'), ('max','M_'),
     55                 ('Fremantle', 'Fre'),('Rockingham', 'Roc'),('depth','_dep_'),
     56                 ('speed', '_spe_'), ('elevation', '_ele_'), ('stage','_sta_'))
    5257
    5358    generate_filename = []
    54     input_ascii = glob.glob(folder + '*max.asc')
     59    input_ascii = glob.glob(folder + '*elevation.asc')
    5560
    5661    for infile in input_ascii:
     
    6368            sys.exit(10)
    6469        generate_filename.append(output_DEM)
    65 
    66         #print 'input %s and output %s' %(infile,output_DEM)
    67 
    68         # Process: ASCII to Raster (4)...
     70        print 'Output DEM ',output_DEM
     71        output_extract = output_DEM + 'E'
     72        print 'Output Extract ',output_extract
     73       
     74        print 'Process: ASCII to Raster'
    6975        gp.ASCIIToRaster_conversion(infile, output_DEM, "FLOAT")
    7076
    71         # Process: Define Projection (3)...
     77        print 'Process: Define Projection'
    7278        gp.DefineProjection_management(output_DEM, "PROJCS['GDA_1994_MGA_Zone_50',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
    7379                                                   ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',0.9996]"
    7480                                                   ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
    7581
     82##        print 'Process: Extract by Mask'
     83##        gp.ExtractByMask_sa(output_DEM, land, output_extract)
    7684
    7785
Note: See TracChangeset for help on using the changeset viewer.