Ignore:
Timestamp:
Apr 27, 2007, 1:29:59 PM (17 years ago)
Author:
sexton
Message:

updates for export scripts

File:
1 edited

Legend:

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

    r4422 r4423  
    55from os import sep
    66
    7 time_dir = '20070418_035124_run' #
     7time_dir = '20070419_065050_run' # HAT
     8#time_dir = '20070419_065018_run' # MSL
    89cellsize = 25
    910timestep = None
     
    1617print 'output dir:', name
    1718
    18 which_var = 2
    19 if which_var == 0:  # Stage
    20     outname = name + '_stage'
    21     quantityname = 'stage'
     19var = [2,3] # depth and speed
    2220
    23 if which_var == 1:  # Absolute Momentum
    24     outname = name + '_momentum_i1'
    25     quantityname = '(xmomentum**2 + ymomentum**2)**0.5' 
     21for which_var in var:
     22    if which_var == 0:  # Stage
     23        outname = name + '_stage'
     24        quantityname = 'stage'
    2625
    27 if which_var == 2:  # Depth
    28     outname = name + '_depth'
    29     quantityname = 'stage-elevation
     26    if which_var == 1:  # Absolute Momentum
     27        outname = name + '_momentum_i1'
     28        quantityname = '(xmomentum**2 + ymomentum**2)**0.5
    3029
    31 if which_var == 3:  # Speed
    32     outname = name + '_speed_i0'
    33     quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
     30    if which_var == 2:  # Depth
     31        outname = name + '_depth_facility'
     32        quantityname = 'stage-elevation' 
    3433
    35 if which_var == 4:  # Elevation
    36     outname = name + '_elevation'
    37     quantityname = 'elevation'  #Elevation
     34    if which_var == 3:  # Speed
     35        outname = name + '_speed_facility'
     36        quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))'  #Speed
    3837
     38    if which_var == 4:  # Elevation
     39        outname = name + '_elevation'
     40        quantityname = 'elevation'  #Elevation
    3941
    40 
    41 if is_parallel == True:
    42 #    print 'is_parallel',is_parallel
    43     for i in range(0,nodes):
    44         namei = name + '_P%d_%d' %(i,nodes)
    45         outnamei = outname + '_P%d_%d' %(i,nodes)
    46         print 'start sww2dem for sww file %d' %(i)
    47         sww2dem(namei, basename_out = outnamei,
     42    if is_parallel == True:
     43    #    print 'is_parallel',is_parallel
     44        for i in range(0,nodes):
     45            namei = name + '_P%d_%d' %(i,nodes)
     46            outnamei = outname + '_P%d_%d' %(i,nodes)
     47            print 'start sww2dem for sww file %d' %(i)
     48            sww2dem(namei, basename_out = outnamei,
     49                        quantity = quantityname,
     50                        timestep = timestep,
     51                        cellsize = cellsize,     
     52                        easting_min = project.e_min_area,
     53                        easting_max = project.e_max_area,
     54                        northing_min = project.n_min_area,
     55                        northing_max = project.n_max_area,       
     56                        reduction = max,
     57                        verbose = True,
     58                        format = 'asc')
     59    else:
     60        print 'start sww2dem'
     61        sww2dem(name, basename_out = outname,
    4862                    quantity = quantityname,
    4963                    timestep = timestep,
     
    5670                    verbose = True,
    5771                    format = 'asc')
    58 else:
    59     print 'start sww2dem'
    60     sww2dem(name, basename_out = outname,
    61                 quantity = quantityname,
    62                 timestep = timestep,
    63                 cellsize = cellsize,     
    64                 easting_min = project.e_min_area,
    65                 easting_max = project.e_max_area,
    66                 northing_min = project.n_min_area,
    67                 northing_max = project.n_max_area,       
    68                 reduction = max,
    69                 verbose = True,
    70                 format = 'asc')
Note: See TracChangeset for help on using the changeset viewer.