/[escript]/trunk/doc/examples/cookbook/example10p.py
ViewVC logotype

Contents of /trunk/doc/examples/cookbook/example10p.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3389 - (show annotations)
Wed Dec 1 23:03:35 2010 UTC (8 years, 9 months ago) by ahallam
File MIME type: text/x-python
File size: 1961 byte(s)
Some changes to the cookbook examples. Starting Inversion experimentation.
1
2 ########################################################
3 #
4 # Copyright (c) 2009 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2009 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="https://launchpad.net/escript-finley"
21
22 """
23 Author: Antony Hallam antony.hallam@uqconnect.edu.au
24 """
25
26 ############################################################FILE HEADER
27 # example10a.py
28 # Model of gravitational Potential for a Gravity Well.
29
30 #######################################################EXTERNAL MODULES
31 # To solve the problem it is necessary to import the modules we require.
32 import pylab as pl
33 import os
34 from esys.escript import * # This imports everything from the escript library
35
36 ################################################ESTABLISHING PARAMETERS
37 #the folder to put our outputs in, leave blank "" for script path
38 save_path= os.path.join("data","example10")
39 #ensure the dir exists
40 mkDir(save_path)
41
42
43 dat1=pl.loadtxt(os.path.join(save_path,'example10b_2000.asc'))
44 dat2=pl.loadtxt(os.path.join(save_path,'example10b_0500.asc'))
45 dat3=pl.loadtxt(os.path.join(save_path,'example10b_4000.asc'))
46 dat4=pl.loadtxt(os.path.join(save_path,'example10b_1000.asc'))
47
48 pl.plot(dat2,label='500^2')
49 pl.plot(dat4,label='1000^2')
50 pl.plot(dat1,label='2000^2')
51 pl.plot(dat3,label='4000^2')
52
53 pl.legend()
54 pl.title('Small vs Large Gravity Model')
55 pl.xlabel('X')
56 pl.ylabel('Potential')
57 pl.savefig(os.path.join(save_path,"ex10p_boundeff.pdf"),dpi=150)
58
59

  ViewVC Help
Powered by ViewVC 1.1.26