Ignore:
Timestamp:
Apr 20, 2009, 4:45:56 PM (16 years ago)
Author:
myall
Message:

using ARC script to turn ascii stage files into rasters, and dividing by max wave height; done for GC clockwise to perth. not checked thoroughly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/australia_ph2/portland/Arc_asc2raster_GDA94z50.py

    r6716 r6842  
    2020gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")
    2121gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
    22 gp.overwriteoutput = 0
     22gp.overwriteoutput = 1
    2323
    24 scenario_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\australia_ph2\\esperance\\"
     24scenario_dir = "\\\\nas2\\gemd\\georisk_models\\inundation\\data\\australia_ph2\\portland\\"
    2525output_dir="anuga\\outputs\\"
    2626
    27 time_dir1 = '20090302_104336_run_final_0_27255_mhingee'
     27time_dir1 = '20090408_152424_run_final_0_27289_1969_Tb__mhingee'
     28time_dir2 = '20090408_194222_run_final_0_58358_1969_Tb__mhingee'
     29time_dir3 = '20090409_001857_run_final_0_64322_1969_Tb__mhingee'
    2830
    29 time_dirs = [time_dir1] #, time_dir2] #4, time_dir5] #, time_dir3, time_dir4, time_dir5, time_dir6]
    30  
    31 for time_dir in time_dirs:
     31events = [[time_dir1,0.430643],[time_dir2,0.462943],[time_dir3,0.418183]]
    3232
     33for event in events:
     34##for time_dir in time_dirs:
     35    time_dir = event[0]
     36    max_wave = event[1]
     37    print time_dir
     38    print max_wave
    3339    # Local variables...
    34     folder = scenario_dir + output_dir + time_dir +'\\'
     40    folder = scenario_dir + output_dir +  time_dir +'\\'
    3541    raster_gbd = folder + 'raster.gdb'
    36     land = scenario_dir + "map_work\\Busselton.gdb\\Internal_polygons\\initial_conditions_extend_Di"
    37     ocean = scenario_dir + "map_work\\Busselton.gdb\\input_boundaries\\Ocean"
     42##    land = scenario_dir + "map_work\\\port_hedland.gdb\\outlines\\initial_condition"
     43##    ocean = scenario_dir + "map_work\\\port_hedland.gdb\\outlines\\initial_conditions_ocean"
    3844
    39    
    4045    print 'Process: Create File GDB'
    4146    gp.CreateFileGDB_management(folder, "raster")
     
    4348    gp.Workspace = raster_gbd
    4449
    45     print time_dir
     50    print gp.Workspace
    4651   
    4752    #replication dictionary
    48     replicate = (('esperance', ''),('_', ''),
     53    replicate = (('portland', ''),('_', ''),('max','_M'),
     54                 ('CBD', 'CDB'),('All',''),
    4955                 ('depth','_depth'),('speed', '_speed'),
    5056                 ('elevation', '_ele_'), ('stage','_stage'))
     
    5763        for (key, rep) in replicate:
    5864            output_DEM = output_DEM.replace(key,rep)
    59         output_DEM = output_DEM[:12]
     65        output_DEM = output_DEM[:10]
    6066        if output_DEM in generate_filename:
    6167            print 'Output_DEM filename (%s) already in use' % output_DEM
     
    6975
    7076        print 'Process: Define Projection'
    71         gp.DefineProjection_management(output_DEM, "PROJCS['GDA_1994_MGA_Zone_51',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
    72                                                    ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',123.0],PARAMETER['Scale_Factor',0.9996]"
     77        gp.DefineProjection_management(output_DEM, "PROJCS['GDA_1994_MGA_Zone_54',GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
     78                                                   ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',141.0],PARAMETER['Scale_Factor',0.9996]"
    7379                                                   ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
    74 ##        output_extract = output_DEM + '_E'
     80##        output_extract = output_DEM + 'E'
    7581##        print 'Output Extract ',output_extract
    7682##        print 'Process: Extract by Mask'
    7783##        gp.ExtractByMask_sa(output_DEM, land, output_extract)
     84        # do this bit only if there are only stage asc files
     85        div_file = output_DEM.replace('stage','div_stage')
     86        print 'divide', output_DEM,' by', max_wave,' and call',div_file
     87        gp.Divide_sa(output_DEM,max_wave,div_file)
    7888
    79 
Note: See TracChangeset for help on using the changeset viewer.