Changeset 6682


Ignore:
Timestamp:
Apr 1, 2009, 2:50:33 PM (15 years ago)
Author:
kristy
Message:
 
Location:
anuga_work/production/geraldton/geraldton_rerun
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/geraldton/geraldton_rerun/Arc_asc2raster_GDA94z50.py

    r6671 r6682  
    5656
    5757    generate_filename = []
    58     input_ascii = glob.glob(folder + '*depth_max.asc')
     58    input_ascii = glob.glob(folder + '*speed_max.asc')
    5959
    6060    for infile in input_ascii:
     
    7777                                                   ",PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',10000000.0],PARAMETER['Central_Meridian',117.0],PARAMETER['Scale_Factor',0.9996]"
    7878                                                   ",PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
    79         output_extract = output_DEM + 'E'
    80         print 'Output Extract ',output_extract
    81         print 'Process: Extract by Mask'
    82         gp.ExtractByMask_sa(output_DEM, land, output_extract)
     79##        output_extract = output_DEM + 'E'
     80##        print 'Output Extract ',output_extract
     81##        print 'Process: Extract by Mask'
     82##        gp.ExtractByMask_sa(output_DEM, land, output_extract)
     83##
    8384
    84 
  • anuga_work/production/geraldton/geraldton_rerun/Arc_txt2feature_class.py

    r6671 r6682  
    2626time_dir6 = '20090327_160043_run_final_0_27255_Bt_kvanputt'
    2727
    28 time_dirs = [time_dir1, time_dir2, time_dir3]
     28time_dirs = [time_dir4, time_dir5, time_dir6]
    2929
    3030for time_dir in time_dirs:
     
    3636    layer = 'layer'
    3737   
    38     print 'Process: Create File GDB'
    39     gp.CreateFileGDB_management(folder, "raster")
     38##    print 'Process: Create File GDB'
     39##    gp.CreateFileGDB_management(folder, "raster")
    4040
    4141    print 'Process: Make XY Event Layer'
  • anuga_work/production/geraldton/geraldton_rerun/Arc_txt2feature_class_res.py

    r6671 r6682  
    77# Import system modules
    88import sys, string, os, arcgisscripting
     9from os.path import join
    910
    1011# Create the Geoprocessor object
     
    1920output_dir = "anuga\\outputs\\"
    2021
    21 time_dir1 = '20081117_141353_run_final_0_27283_alpha0.1_kvanputt'
    22 time_dir2 = '20081117_141443_run_final_0.6_27283_alpha0.1_kvanputt'
    23 time_dir3 = '20081117_141520_run_final_0_27255_alpha0.1_kvanputt'
    24 time_dir4 = '20081117_141558_run_final_0.6_27255_alpha0.1_kvanputt'
    25 time_dir5 = '20081117_141634_run_final_0_68693_alpha0.1_kvanputt'
    26 time_dir6 = '20081117_141717_run_final_0.6_68693_alpha0.1_kvanputt'
     22time_dir1 = '20090324_134504_run_final_0.6_27255_Bt_kvanputt'
     23time_dir2 = '20090324_140411_run_final_0.6_27283_Bt_kvanputt'
     24time_dir3 = '20090324_140741_run_final_0.6_68693_Bt_kvanputt'
     25time_dir4 = '20090327_155230_run_final_0_68693_Bt_kvanputt'
     26time_dir5 = '20090327_160022_run_final_0_27283_Bt_kvanputt'
     27time_dir6 = '20090327_160043_run_final_0_27255_Bt_kvanputt'
    2728
     29time_dirs = [time_dir6] #1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
    2830
    29 time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5, time_dir6]
     31def replace_in_file(filename, instr, repstr):
     32    '''Replace one string with another in a file.'''
     33   
     34    # get the file contents
     35    fd = open(filename, 'r')
     36    lines = fd.readlines()
     37    fd.close()
     38
     39    # convert list to one string
     40    newlines = ''.join(lines)
     41   
     42    # replace 'instr' with 'repstr'
     43    newlines = newlines.replace(instr, repstr)
     44   
     45    # write changed lines back to file
     46    fd = open(filename, 'w')
     47    fd.write(newlines)
     48    fd.close()
    3049
    3150for time_dir in time_dirs:
    32 
     51    print 'time_dir = ', time_dir
    3352    # Local variables...
    3453    folder =  scenario_dir + output_dir + time_dir + '\\'
     
    3655    raster_gdb = folder + "raster.gdb"
    3756    layer = 'layer'
     57
     58    print 'replace _$ with nothing'
     59    replace_in_file(input_dir_name, '_$', '')
    3860   
    39 
    4061    print 'Process: Make XY Event Layer'
    4162    gp.MakeXYEventLayer_management(input_dir_name, "longitude", "latitude", layer, "GEOGCS['GCS_GDA_1994',DATUM['D_GDA_1994',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision")
    4263
    4364    print 'Process: Feature Class to Feature Class'
    44     gp.FeatureClassToFeatureClass_conversion(layer, raster_gdb, "geraldton_res", "", "OBJECTID OBJECTID true true false 4 Long 0 10 ,First,#,geraldton_res.csv_Features,OBJECTID,-1,-1;LONGITUDE LONGITUDE true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,LONGITUDE,-1,-1;LATITUDE LATITUDE true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,LATITUDE,-1,-1;STRUCT_INUNDATED STRUCT_INUNDATED true true false 4 Long 0 10 ,First,#,geraldton_res.csv_Features,STRUCT_INUNDATED,-1,-1;STRUCT_DAMAGE_fraction STRUCT_DAMAGE_fraction true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,STRUCT_DAMAGE_fraction,-1,-1;COLLAPSE_CSV_INFO COLLAPSE_CSV_INFO true true false 255 Text 0 0 ,First,#,geraldton_res.csv_Features,COLLAPSE_CSV_INFO,-1,-1;MAX_DEPTH_m MAX_DEPTH_m true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,MAX_DEPTH_m,-1,-1;STRUCT_COLLAPSED STRUCT_COLLAPSED true true false 255 Text 0 0 ,First,#,geraldton_res.csv_Features,STRUCT_COLLAPSED,-1,-1;STRUCT_LOSS STRUCT_LOSS true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,STRUCT_LOSS,-1,-1;CONTENTS_DAMAGE_fraction CONTENTS_DAMAGE_fraction true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,CONTENTS_DAMAGE_fraction,-1,-1;CONTENTS_LOSS CONTENTS_LOSS true true false 8 Double 0 0 ,First,#,geraldton_res.csv_Features,CONTENTS_LOSS,-1,-1", "")
     65    gp.FeatureClassToFeatureClass_conversion(layer, raster_gdb, "geraldton_res", "", "OBJECTID OBJECTID true true false 4 Long 0 10 ,First,#,carnarvon_res.csv_Features,OBJECTID,-1,-1;LONGITUDE LONGITUDE true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,LONGITUDE,-1,-1;LATITUDE LATITUDE true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,LATITUDE,-1,-1;STRUCT_INUNDATED STRUCT_INUNDATED true true false 4 Long 0 10 ,First,#,carnarvon_res.csv_Features,STRUCT_INUNDATED,-1,-1;STRUCT_DAMAGE_fraction STRUCT_DAMAGE_fraction true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,STRUCT_DAMAGE_fraction,-1,-1;COLLAPSE_CSV_INFO COLLAPSE_CSV_INFO true true false 255 Text 0 0 ,First,#,carnarvon_res.csv_Features,COLLAPSE_CSV_INFO,-1,-1;MAX_DEPTH_m MAX_DEPTH_m true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,MAX_DEPTH_m,-1,-1;STRUCT_COLLAPSED STRUCT_COLLAPSED true true false 255 Text 0 0 ,First,#,carnarvon_res.csv_Features,STRUCT_COLLAPSED,-1,-1;STRUCT_LOSS STRUCT_LOSS true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,STRUCT_LOSS,-1,-1;CONTENTS_DAMAGE_fraction CONTENTS_DAMAGE_fraction true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,CONTENTS_DAMAGE_fraction,-1,-1;CONTENTS_LOSS CONTENTS_LOSS true true false 8 Double 0 0 ,First,#,carnarvon_res.csv_Features,CONTENTS_LOSS,-1,-1", "")
    4566
  • anuga_work/production/geraldton/geraldton_rerun/build_urs_boundary.py

    r6608 r6682  
    157157                ordering_filename=order_filename,
    158158                weights=mux_weights,
     159                zone=project.zone,
    159160                verbose=True)
    160161
  • anuga_work/production/geraldton/geraldton_rerun/export_results_max.py

    r6670 r6682  
    3030time_dir6 = '20090327_160043_run_final_0_27255_Bt_kvanputt'
    3131
    32 time_dirs = [time_dir1, time_dir2, time_dir3]
     32time_dirs = [time_dir4, time_dir5, time_dir6]
    3333 
    3434
  • anuga_work/production/geraldton/geraldton_rerun/get_runup.py

    r6671 r6682  
    2424time_dir6 = '20090327_160043_run_final_0_27255_Bt_kvanputt'
    2525
    26 time_dirs = [time_dir4, time_dir5] #, time_dir3]
     26time_dirs = [time_dir6] #, time_dir3]
    2727 
    2828interior_region = []
  • anuga_work/production/geraldton/geraldton_rerun/project.py

    r6669 r6682  
    2626# Model specific parameters.
    2727# One or all can be changed each time the run_model script is executed
    28 tide = 0                # difference between MSL and HAT in metres
     28tide = -0.4                # difference between MSL and HAT in metres
    2929zone = 50               # specify zone of model
    30 event_number = 27255    # the event number or the mux file name
     30#event_number = 27255    # the event number or the mux file name
     31event_number = 'wa04_val'    # the event number or the mux file name
    3132alpha = 0.1             # smoothing parameter for mesh
    3233friction=0.01           # manning's friction coefficient
     
    8788# Used in run_model.py
    8889# Format for points easting,northing (no header)                   
    89 interior_regions_data = [['CBD_500m.csv', 500],
     90interior_regions_data = [['harbour.csv', 20],
     91                         ['CBD_500m.csv', 500],
    9092                         ['CBD_1km.csv', 800],
    91                          ['island_wallabi_poly.csv', 5000],
     93                         ['island_wallabi_poly2.csv', 5000],
    9294                         ['island_dingiville_poly.csv', 5000],
    9395                         ['island_pelsaert_poly.csv', 5000]]
     
    101103# Used in get_timeseries.py. 
    102104# Format easting,northing,name,elevation (with header)
    103 gauges_filename = 'MH_gauges.csv'
     105#gauges_filename = 'MH_gauges.csv'
     106gauges_filename = 'nick_geraldton_gauges.csv'
    104107
    105108# BUILDINGS EXPOSURE - for identifying inundated houses
     
    119122# Thinned ordering file from Hazard Map (geographic)
    120123# Format is index,latitude,longitude (with header)
    121 urs_order_filename = 'thinned_boundary_ordering.csv'
     124#urs_order_filename = 'thinned_boundary_ordering.csv'
     125urs_order_filename = 'urs_order.csv'
    122126
    123127# Landward bounding points
    124128# Format easting,northing (no header)
    125 landward_boundary_filename = 'landward_bounding_polygon.csv'
     129#landward_boundary_filename = 'landward_bounding_polygon.csv'
     130landward_boundary_filename = 'landward_boundary.csv'
    126131
    127132# MUX input filename.
    128133# If a meta-file from EventSelection is used, set 'multi-mux' to True.
    129134# If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False.
    130 ##mux_input_filename = event_number # to be found in event_folder
     135mux_input_filename = event_number # to be found in event_folder
    131136                                    # (ie boundaries/event_number/)
    132 ##multi_mux = False
    133 mux_input_filename = 'event.list'
    134 multi_mux = True
     137multi_mux = False
     138##mux_input_filename = 'event.list'
     139##multi_mux = True
    135140
    136141#-------------------------------------------------------------------------------
  • anuga_work/production/geraldton/geraldton_rerun/run_building_inundation.py

    r6671 r6682  
    3333time_dir6 = '20090327_160043_run_final_0_27255_Bt_kvanputt'
    3434
    35 time_dirs = [time_dir1, time_dir2, time_dir3, time_dir4, time_dir5]
     35time_dirs = [time_dir6] #1, time_dir2, time_dir3, time_dir4, time_dir5]
    3636
    3737buildings = project.building_exposure
     
    3939for time_dir in time_dirs:
    4040   
    41     time_dir_name = time_dir[-25:][:-18]
     41    time_dir_name = time_dir[-25:][:-11]
    4242       
    4343    building_marker = '_m_'+ time_dir_name
Note: See TracChangeset for help on using the changeset viewer.