/usr/bin/pyFAI-waxs is in pyfai 0.3.5-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | #!/usr/bin/python
# -*- coding: utf8 -*-
#
# Project: Fast Azimuthal integration
# https://forge.epn-campus.eu/projects/azimuthal
#
# File: "$Id$"
#
# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "GPLv3+"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "21/12/2011"
__status__ = "production"
__doc__ = """
pyFAI-waxs is the Waxs script of pyFAI that allows data reduction for Wide Angle Scattering,
producing output in 2-theta range output in radial dimension (and in degrees).
Parameters:
-p=param.poni PyFAI parameter file
-m=mask.edf mask image
-d=-2 dummy value for dead pixels
-dd=-1.1 delta dummy
-h print help and exit
Usage:
python pyFAI-waxs -p=param.poni file.edf file2.edf file3.edf
"""
import os, sys, time, fabio
import pyFAI
from pyFAI import AzimuthalIntegrator
if __name__ == "__main__":
paramFile = None
processFile = []
dummy = None
delta_dummy = None
mask = None
for param in sys.argv[1:]:
if param.startswith("-p="):
paramFile = param.split("=", 1)[1]
elif param.startswith("-d="):
dummy = float(param.split("=", 1)[1])
elif param.startswith("-dd="):
delta_dummy = float(param.split("=", 1)[1])
elif param.startswith("-m="):
mask = param.split("=", 1)[1]
elif param.startswith("--version"):
print(pyFAI.version + os.linesep)
sys.exit(0)
elif param.find("-h") in [0, 1]:
print(__doc__)
sys.exit(0)
elif os.path.isfile(param):
processFile.append(param)
if paramFile and processFile:
integrator = AzimuthalIntegrator()
integrator.setChiDiscAtZero()
integrator.load(paramFile)
if mask is not None:
mask = fabio.open(mask).data
print integrator
for oneFile in processFile:
sys.stdout.write("Integrating %s --> " % oneFile)
outFile = os.path.splitext(oneFile)[0] + ".xy"
azimFile = os.path.splitext(oneFile)[0] + ".azim"
data = fabio.open(oneFile).data.astype("float32")
t0 = time.time()
tth, I = integrator.xrpd(data=data, nbPt=min(data.shape), filename=outFile, correctSolidAngle=True,
mask=mask, dummy=dummy, delta_dummy=delta_dummy)
t1 = time.time()
integrator.xrpd2(data, 1000, 360, azimFile,
mask=mask, dummy=dummy, delta_dummy=delta_dummy)
print "%s\t 1D took %.3fs, 2D took %.3fs" % (outFile, t1 - t0, time.time() - t1)
print "raw int: %s ; integrated: %s " % (data.sum() / data.size, I.sum() / I.size)
else:
print(__doc__)
|