Ignore:
Timestamp:
Dec 11, 2006, 6:45:38 PM (18 years ago)
Author:
sexton
Message:

slide modelling updates (based on inundation extents found)

Location:
anuga_work/production/sydney_2006
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/sydney_2006/export_results.py

    r3514 r4072  
    1 import project, os
     1import project_slide, os
     2import sys
    23
    3 from anuga.pyvolution.data_manager import sww2dem
    4 from anuga.pyvolution.ermapper_grids import read_ermapper_grid
     4from anuga.shallow_water.data_manager import sww2dem
     5from os import sep
    56
    6 name = project.outputname
     7time_dir = '20061206_061014'
     8directory = project_slide.outputdir
     9name = directory + time_dir + sep + project_slide.basename
    710
    8 #print 'Which variable do you want to export?'
    9 #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
     11is_parallel = False
     12if is_parallel == True: nodes = 4
     13print 'output dir:', name
     14
    1015which_var = 2
    11 
    1216if which_var == 0:  # Stage
    1317    outname = name + '_stage'
     
    1519
    1620if which_var == 1:  # Absolute Momentum
    17     outname = name + '_momentum'
    18     quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
     21    outname = name + '_momentum_i1'
     22    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    1923
    2024if which_var == 2:  # Depth
    2125    outname = name + '_depth'
    22     quantityname = 'stage-elevation'  #Depth
     26    quantityname = 'stage-elevation' 
    2327
    2428if which_var == 3:  # Speed
    25     outname = name + '_speed'
     29    outname = name + '_speed_i0'
    2630    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
    27     #quantityname = 'xmomentum/(stage-elevation)'  #Speed
    2831    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
    2932
    30    
    31 sww2dem(name, basename_out = outname,
    32             quantity = quantityname,
    33             cellsize = 25,       # Trevor would like this at 25
    34             # define region for viz purposes
    35             easting_min = project.eminviz,
    36             easting_max = project.emaxviz,
    37             northing_min = project.nminviz,
    38             northing_max = project.nmaxviz,       
    39             reduction = max, #this is because we want max quantityname
    40             verbose = True,
    41             format = 'asc')
     33if which_var == 4:  # Elevation
     34    outname = name + '_elevation'
     35    quantityname = 'elevation'  #Elevation
    4236
    43 #Check
    44 
    45 #data = read_ermapper_grid(name)
    46 #print 'Values from %s are in [%f, %f]' %(name, min(data.flat), max(data.flat))
     37if is_parallel == True:
     38    for i in range(0,nodes):
     39        namei = name + '_P%d_%d' %(i,nodes)
     40        outnamei = outname + '_P%d_%d' %(i,nodes)
     41        print 'start sww2dem for sww file %d' %(i)
     42        sww2dem(namei, basename_out = outnamei,
     43                    quantity = quantityname,
     44                    timestep = 1,
     45                    cellsize = 100,     
     46                    #easting_min = project.e_min_area,
     47                    #easting_max = project.e_max_area,
     48                    #northing_min = project.n_min_area,
     49                    #northing_max = project.n_max_area,       
     50                    reduction = max,
     51                    verbose = True,
     52                    format = 'asc')
     53else:
     54    print 'start sww2dem'
     55    sww2dem(name, basename_out = outname,
     56                quantity = quantityname,
     57                cellsize = 100,     
     58                easting_min = project_slide.eastingmin,
     59                easting_max = project_slide.eastingmax,
     60                northing_min = project_slide.northingmin,
     61                northing_max = project_slide.northingmax,       
     62                reduction = max,
     63                verbose = True,
     64                format = 'asc')
  • anuga_work/production/sydney_2006/project_slide.py

    r4058 r4072  
    9393
    9494# sydney digitized polygons
    95 poly_coast = read_polygon(polygondir+'coast.csv')
     95poly_coast = read_polygon(polygondir+'coast2.csv')
    9696poly_syd1 = read_polygon(polygondir+'local.csv')
    9797
     
    129129
    130130# exporting asc grid
    131 #eastingmin =
    132 #eastingmax =
    133 #northingmin =
    134 #northingmax =
     131eastingmin = 337500
     132eastingmax = 344060
     133northingmin = 6248890
     134northingmax = 6274550
    135135
    136136###################################################################
  • anuga_work/production/sydney_2006/run_sydney_slide.py

    r4063 r4072  
    113113
    114114from anuga.pmesh.mesh_interface import create_mesh_from_regions
    115 remainder_res = 150000.
     115remainder_res = 250000.
    116116local_res = 50000.
    117117coast_res = 500.
Note: See TracChangeset for help on using the changeset viewer.