- Timestamp:
- Sep 9, 2005 10:03:21 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/app-fermi/fermi.py
r10 r55 26 26 E = Emin; dE = 0.005*(Emax-Emin) 27 27 28 Rappture.driver.put("output.curve(f12).about.label", "Fermi-Dirac Factor") 29 Rappture.driver.put("output.curve(f12).xaxis.label", "Energy") 30 Rappture.driver.put("output.curve(f12).xaxis.units", "eV") 31 path = "output.curve(f12).component.xy" 32 28 33 while E < Emax: 29 34 f = 1.0/(1.0 + exp((E - Ef)/kT)) 30 result.append( [E,f] ) 35 # result.append( [E,f] ) 36 value = "%s %s\n" % (f,E) 37 Rappture.driver.put(path,value,append=1) 31 38 E += dE 39 -
trunk/examples/app-fermi/fermi_io.py
r10 r55 18 18 #result = [] 19 19 20 T = Rappture.number('input .temperature', units='K', default=300)21 Ef = Rappture.number('input .Ef', units='eV', default=-5.5)20 T = Rappture.number('input', id="temperature", units='K', default=300) 21 Ef = Rappture.number('input', id="Ef", units='eV', default=-5.5) 22 22 23 23 #result = Rappture.table('output.result') \ 24 24 # .column('Energy (eV)',units='eV') \ 25 25 # .column('Fermi-Dirac Factor') 26 result = []26 #result = [] -
trunk/python/Rappture/interface.py
r9 r55 44 44 # and interrogating them for symbols. 45 45 # 46 lib = Rappture.library('<?xml version="1.0"?><run></run>') 46 lib = Rappture.library('<?xml version="1.0"?><run><tool>' + 47 '<about>Press Simulate to view results.</about>' + 48 '<command>' +argv[0]+ ' -d @driver</command></tool></run>') 47 49 48 50 for module in args: … … 76 78 representing the entire run. 77 79 """ 78 f = open("run.xml","w") 79 f.write( Rappture.driver.xml() ) 80 f.close() 80 # f = open("run.xml","w") 81 # f.write( Rappture.driver.xml() ) 82 # f.close() 83 84 Rappture.result(Rappture.driver) -
trunk/python/Rappture/number.py
r9 r55 9 9 10 10 class number: 11 def __init__(self,path, **kwargs):11 def __init__(self,path,id,**kwargs): 12 12 """ 13 13 Blah, blah... 14 14 """ 15 15 16 self.path = path 16 self.basePath = path 17 self.path = path + ".number(" + id + ")" 18 self.id = id 17 19 self.attribs = kwargs 18 20 … … 23 25 24 26 def __coerce__(self,other): 25 s = Rappture.driver.get(self.path+'.current') 27 attrList = Rappture.driver.children(self.path, "id") 28 attrName = 'default' 29 for attr in attrList: 30 if attr == 'current': 31 attrName = attr 32 s = Rappture.driver.get(self.path+'.'+attrName) 26 33 return (float(s),other)
Note: See TracChangeset
for help on using the changeset viewer.