source: anuga_work/production/sydney_2006/export_results.py @ 4058

Last change on this file since 4058 was 3514, checked in by duncan, 19 years ago

Hi all,
I'm doing a change in the anuga structure, moving the code to

\anuga_core\source\anuga

After you have done an svn update, the PYTHONPATH has to be changed to;
PYTHONPATH = anuga_core/source/

This is part of changes required to make installation of anuga quicker and reducing the size of our sandpits.

If any imports are broken, try fixing them. With adding anuga. to them for example. If this seems to have really broken things, email/phone me.

Cheers
Duncan

File size: 1.6 KB
Line 
1import project, os
2
3from anuga.pyvolution.data_manager import sww2dem
4from anuga.pyvolution.ermapper_grids import read_ermapper_grid
5
6name = project.outputname
7
8#print 'Which variable do you want to export?'
9#which_var = int(raw_input('Stage = 0, Absolute Momentum = 1, Depth = 2, Speed = 3  '  ))
10which_var = 2
11
12if which_var == 0:  # Stage
13    outname = name + '_stage'
14    quantityname = 'stage'
15
16if which_var == 1:  # Absolute Momentum
17    outname = name + '_momentum'
18    quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum
19
20if which_var == 2:  # Depth
21    outname = name + '_depth'
22    quantityname = 'stage-elevation'  #Depth
23
24if which_var == 3:  # Speed
25    outname = name + '_speed'
26    #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5'  #Speed
27    #quantityname = 'xmomentum/(stage-elevation)'  #Speed
28    quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed
29
30   
31sww2dem(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')
42
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))
Note: See TracBrowser for help on using the repository browser.