Changeset 3955


Ignore:
Timestamp:
Nov 9, 2006, 12:04:41 PM (16 years ago)
Author:
sexton
Message:

(i) dampier report tex and figures (ii) export_results for parallel output

Location:
anuga_work/production/dampier_2006
Files:
36 added
2 edited

Legend:

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

    r3827 r3955  
    33
    44from anuga.shallow_water.data_manager import sww2dem
    5 #from anuga.pyvolution.ermapper_grids import read_ermapper_grid
    6 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher
    75from os import sep
    86
    9 #time_dir = '20060704_063005' #HAT
    10 #time_dir = '20060706_235246' #LAT
    11 time_dir = '20060704_063234' #MSL
    12 #time_dir = '20060515_001733' #DTED data
    13 directory = project.boundarydir
    14 #name = directory + time_dir +sep + 'source'
    15 # to develop grid of MOST output
    16 #directory = project.boundarydir
    17 name = directory + project.boundary_basename
     7time_dir = '20061107_070805_run' #
     8directory = project.output_dir
     9name = directory + time_dir + sep + project.scenario_name
    1810
    19 #normal screen output is stored in 'outname'
    20 #screen_output_name = directory + time_dir + sep + "export_output.txt"
    21 #screen_error_name = directory + time_dir + sep + "export_error.txt"
    22 # for MOST output
    23 #screen_output_name = directory  +  "export_output.txt"
    24 #screen_error_name = directory +  "export_error.txt"
     11is_parallel = True
     12if is_parallel == True: nodes = 8
     13print 'output dir:', name
    2514
    26 #used to catch screen output to file
    27 #sys.stdout = Screen_Catcher(screen_output_name)
    28 #sys.stderr = Screen_Catcher(screen_error_name)
    29 
    30 print 'output dir:', name
    31 #print 'Which variable do you want to export?'
    32 #which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
    33 which_var = 4
    34 #sys.stderr.write(sys.stdout.data)
     15which_var = 2
    3516if which_var == 0:  # Stage
    3617    outname = name + '_stage'
     
    3920if which_var == 1:  # Absolute Momentum
    4021    outname = name + '_momentum'
    41     quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
     22    quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
    4223
    4324if which_var == 2:  # Depth
    4425    outname = name + '_depth'
    45     quantityname = 'stage-elevation'  #Depth
     26    quantityname = 'stage-elevation' 
    4627
    4728if which_var == 3:  # Speed
    4829    outname = name + '_speed'
    4930    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
    50     #quantityname = 'xmomentum/(stage-elevation)'  #Speed
    5131    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
    5232
     
    5535    quantityname = 'elevation'  #Elevation
    5636
    57 print 'start sww2dem'
    58 #sys.stderr.write(sys.stdout.data)
    59 sww2dem(name, basename_out = outname,
    60             quantity = quantityname,
    61             cellsize = 20,       # Trevor would like this at 25
    62             # define region for viz purposes
    63             easting_min = project.e_min_area,
    64             easting_max = project.e_max_area,
    65             northing_min = project.n_min_area,
    66             northing_max = project.n_max_area,       
    67             reduction = max, #this is because we want max quantityname
    68             verbose = True,
    69             format = 'asc')
    70 
    71 #sys.stderr.write(sys.stdout.data)
    72 
    73 #Check
    74 
    75 #data = read_ermapper_grid(name)
    76 #print 'Values from %s are in [%f, %f]' %(name, min(data.flat), max(data.flat))
     37if is_parallel == True:
     38    for i in range(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                    cellsize = 20,     
     45                    easting_min = project.e_min_area,
     46                    easting_max = project.e_max_area,
     47                    northing_min = project.n_min_area,
     48                    northing_max = project.n_max_area,       
     49                    reduction = max,
     50                    verbose = True,
     51                    format = 'asc')
     52else:
     53    print 'start sww2dem'
     54    sww2dem(name, basename_out = outname,
     55                quantity = quantityname,
     56                cellsize = 20,     
     57                easting_min = project.e_min_area,
     58                easting_max = project.e_max_area,
     59                northing_min = project.n_min_area,
     60                northing_max = project.n_max_area,       
     61                reduction = max,
     62                verbose = True,
     63                format = 'asc')
  • anuga_work/production/dampier_2006/project.py

    r3940 r3955  
    8484
    8585print 'gtime: ', gtime
    86 #print 'ctime: ', cctime
    87 
     86output_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep
    8887output_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep
    8988output_build_time_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'outputs'+sep+build_time+sep
     
    9796#boundaries_time_dir = boundaries_in_dir+'urs'+sep+boundaries_source+sep
    9897
     98gauge_dir = home+sep+state+sep+scenario_datas_name+sep+'anuga'+sep+'gauges'+sep
     99gauge_filename = gauge_dir + 'dampier_gauges.csv'
    99100
    100101gauges_dir_name = gauges_dir + gauge_name
     
    178179#                  convert_from_latlon_to_utm([p1, p2, p3, p4, p5, p6, p7])
    179180refzone = zone
     181from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
     182print 'poly area', polygon_area(bounding_polygon)/1000000.0
    180183
    181184#Interior regions
Note: See TracChangeset for help on using the changeset viewer.