[Ifeffit] how can i call the function of Athena or Artemis in Python

Bruce Ravel bravel at bnl.gov
Thu Dec 4 11:28:27 CST 2008


On Thursday 04 December 2008 11:58:48 am goodhei8 at gmail.com wrote:
> Such as I want to call calibrate or merge function of Athena in python.
> Can python glue them together? any document?
>
> Jack Song

Jack,

That's the most interesting question I've seen here in weeks! :)

The fact that you cannot do what you are asking is something that has been 
bothering me for quite some time.  So much so, in fact, that I am in the 
process of rewriting the entire functionality of Athena and Artemis so that 
clever ideas like yours are possible.  You can peruse my Demeter wiki pages 
for details.

One of my goals for the new software is to write a XML-RPC wrapper around it 
so that you can have the new software running as a service on your computer 
or on a computer on the network.  This is a nifty idea because it is language 
neutral in the sense that you could write a script in python or any other 
language (Ruby, C, Lua, C#, even something crazy like perl!) and process your 
data identically to how it is done in Athena.

Alas, what I just described is still many months away.  The code base is 
mostly written, but I need to spend some time writing GUIs so the code base 
can be tested more methodically.  But someday....

One option you might consider in the short term is to drive Ifeffit directly 
from your python script.  Try watching what goes on in the Ifeffit buffer 
(see Athena's Edit menu) while you are calibrating or merging or whatever.  
That will give you a sense of how my perl programs are driving Ifeffit and 
might help you hack something usable together in python.

Another option would be to try to use some of Sam's work in SixPack as the 
basis for your own python scripts.

HTH
B

-- 

 Bruce Ravel  ------------------------------------ bravel at bnl.gov

 National Institute of Standards and Technology
 Synchrotron Methods Group at NSLS --- Beamlines U7A, X24A, X23A2
 Building 535A
 Upton NY, 11973

 My homepage:    http://xafs.org/BruceRavel
 EXAFS software: http://cars9.uchicago.edu/~ravel/software/exafs/



More information about the Ifeffit mailing list