Re: Question about PDFgetX3 and normalization, also batch mode

263 views
Skip to first unread message

Pavol Juhas

unread,
May 2, 2013, 2:52:17 PM5/2/13
to diffpy...@googlegroups.com
On Wed, May 01, 2013 at 08:23:43PM -0700, taro...@gmail.com wrote:
> Dear All,
>
> One thing that is required by PDFgetX3 is to input the composition of the
> material to be analyzed in the configuration file.
> I was wondering if this is being used to normalize the data in terms of the
> atomic form factor when generating the PDF.

Hi Taro, Yes, the chemical composition is used for evaluating the
average scattering factor that is used to normalize raw intensities.

> Also, it is mentioned in the tutorial that PDFgetX3 can handle
> multiple files in batch mode. This works if one doesn't need to
> change the configuration filed, but I'm currently looking at
> multiple compositions so I need to change the composition in the
> configuration file for each IvsQ set. Is there a rapid way to handle
> data that involves multiple compositions?

Sure, however you'd need to write some code that can determine
sample composition per each input file. Here is an example,
where input files are just named according to their compositions.
Let's assume the current directory contains 3 input files named
as In1Ga0As.chi, In0.5Ga0.5As.chi, In0Ga1As.chi. To process
them in a batch, create a configuration file pdfgetx3.cfg that
sets all constant parameters, such as qmaxinst, qmax, etc.,
and then use the following Python script:

# --------------------------------------------------------------------
from os.path import splitext
import glob
from diffpy.pdfgetx import PDFGetter, loadPDFConfig

cfg = loadPDFConfig('pdfgetx3.cfg')
pg = PDFGetter(cfg)
inputfiles = glob.glob('*.chi')
for f in inputfiles:
fbasename = splitext(f)[0]
pg.config.composition = fbasename
pg(filename=f)
pg.writeOutput(fbasename + '.gr', 'gr')
# uncomment if you also need the F(Q) output
# pg.writeOutput(fbasename + '.fq', 'fq')
# --------------------------------------------------------------------

There is a brief inline documentation for the PDFGetter class and
loadPDFConfig functions, which can be displayed using

pydoc diffpy.pdfgetx.PDFGetter
pydoc diffpy.pdfgetx.loadPDFConfig

(The pydoc program comes with Python installation on Linux and Mac;
I am not sure about Windows).

Hope this helps,

Pavol

--
Dr. Pavol Juhas
Condensed Matter Physics and Materials Science Department
building 510B
Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000

Simon Billinge

unread,
May 3, 2013, 10:47:06 AM5/3/13
to diffpy-users
incidentally, the program will work ok if you give it the wrong composition.  However, this will result in a clearly incorrect multiplicative correction to the PDF and therefore rather suspect thermal factors.  It is not to be advised, but if you want a quick and dirty PDF......

S



--
You received this message because you are subscribed to the Google Groups "diffpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-users...@googlegroups.com.
To post to this group, send email to diffpy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diffpy-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





--
----
Prof. Simon Billinge

Applied Physics & Applied Mathematics
Columbia University
500 West 120th Street
Room 200 Mudd, MC 4701
New York, NY 10027
Tel: (212)-854-2918 (o) 851-7428 (lab)

Condensed Matter Physics and Materials Science Dept.

Brookhaven National Laboratory
P.O. Box 5000
Upton, NY 11973-5000
(631)-344-3594

email: sb2896 at columbia dot edu
home: http://bgsite.apam.columbia.edu

Monica Dapiaggi

unread,
May 3, 2013, 11:20:33 AM5/3/13
to diffpy...@googlegroups.com
well, you can also create a separate configuration file pdfgetx3.cfg, with a different name, for each composition. then you can input each data file and each conf file in the command line.
this is how I do it, but Pavol's way is certainly more elegant...
;-)
Monica

Pavol Juhas

unread,
May 3, 2013, 12:06:11 PM5/3/13
to diffpy...@googlegroups.com
That's a great way. However for many input files, it might be better
to use just
one configuration file and then create a second file, say
"samples.txt", which would
just list all files and all compositions on separate lines:

filename1.chi
chemical composition 1
filename2.chi
chemical composition 2
...

After that you can batch process all chi files in a UNIX shell loop like this:

<samples.txt while read f && read c; do
pdfgetx3 --composition="$c" "$f"
done

I am not sure if there is any way of doing something similar with Windows
batch scripting.

Cheers,

Pavol
tel: +1-631-344-3594
fax: +1-631-344-2739
Reply all
Reply to author
Forward
0 new messages