Last change
on this file since 12168 was 12168, checked in by cborstad, 13 years ago |
merged trunk-jpl into branch through revision 12167
|
File size:
832 bytes
|
Line | |
---|
1 | import os
|
---|
2 | def parameterize(md,parametername):
|
---|
3 | #PARAMETERIZE - parameterize a model
|
---|
4 | #
|
---|
5 | # from a parameter matlab file, start filling in all the model fields that were not
|
---|
6 | # filled in by the mesh.py and setmask.py model methods.
|
---|
7 | # Warning: the parameter file must be able to be run in Python
|
---|
8 | #
|
---|
9 | # Usage:
|
---|
10 | # md=parameterize(md,parametername)
|
---|
11 | #
|
---|
12 | # Example:
|
---|
13 | # md=parameterize(md,'Square.par');
|
---|
14 |
|
---|
15 | #some checks
|
---|
16 | if not os.path.isfile(parametername):
|
---|
17 | print 'parameterize error message: file '+parametername+' not found.'
|
---|
18 | return []
|
---|
19 |
|
---|
20 | #Try and run parameter file.
|
---|
21 | execfile(parametername)
|
---|
22 |
|
---|
23 | #ame and notes
|
---|
24 | if len(md.miscellaneous.name)==0:
|
---|
25 | md.miscellaneous.name=os.path.basename(parametername)
|
---|
26 |
|
---|
27 | md=addnote(md,'Model created by using parameter file: '+parametername+' on: '+str(datetime.datetime.now()))
|
---|
Note:
See
TracBrowser
for help on using the repository browser.