silx-kit / pyfai Goto Github PK
View Code? Open in Web Editor NEWFast Azimuthal Integration in Python
License: Other
Fast Azimuthal Integration in Python
License: Other
Dear Jerome,
when looking to the manual of pyFai I tripped over the polarization
correction that is implemented. Apparently, you are still using only a
single parameter P, and I do not understand the physical meaning of it:
vertical (-1) and horizontal (+1)? What are you doing when the elliptical
polarization axis is inclined by 35.55 degrees, e.g. because something
rotates the polarization direction (e.g. with a type of quarter wave
plate).I personally separate the polarization correction into an unpolarized
(1-P) and a polarized contribution (P) based on Stokes parameters and then
I describe the polarized part in the Poincare notation (ellipticity pchi
and polarization angle ppsi). The final formulas are not complicated and
the three input parameters have a physical meaning.Somebody could say that we cannot distinguish between, circular and
unpolarized light because we only measure intensities, not amplitudes. But
remember, that we already used to have colleagues that claimed that in
SAXS scattering angles are always so small that no conversion of tan to
sin would be necessary. For me the pyFAI parameter P seems to be a bad
trick that makes the polarization correction more difficult especially in
the case of partially rotated polarization planes that even does not seem
to be possible in pyFAI.In general, 3 parameter are needed
polarization factor P: 0..1
ellipticity PChi: -pi/4<=PChi<=+pi/4
inclination PPsi: 0<=PPsi<piYou can find a description in the optics book of Born & Wolf
[1] Born&Wolf, Principles of Optics, 6th (corrected) edition 1997,
Cambridge University Press 1980, 10.8 and 1.4.I prefer a general description that covers all possible (future) cases,
especially then, when its implementation is simple.Greetings,
PeterPS: I have written a documentation in the module polarization.c (in
spd/edfpack):The Stokes parameter of the incident wave can be separated into an unpolarized
s(1) and a polarized part s(2):(xii a) s = s(1) + s(2) = ( s0, s1, s2, s3 )
(xii b) s(1) = ( (1-P)_s0, 0, 0, 0 )
(xii c) s(2) = ( P_s0, s1, s2, s3 )where P is the polarization (0<=P<=1). If P is 0 the wave is totally
unpolarized, if P is 1 the wave is totally polarized.The polarized portion s(2) can be described by the Poincar notation:
(xiii a) s0(2)+s1(2) = P_so+s1 = P_so_(1+cos(2_PChi)cos(2_PPsi))
(xiii b) s0(2)-s1(2) = P_so-s1 = P_so(1-cos(2_PChi)_cos(2_PPsi))
(xiii c) s2(2) = s2 = P_so_cos(2_PChi)_sin(2*PPsi)with
P : degree of polarization (0<=P<=1)
PChi : ellipticity (after Poincar) (-pi/4<=PChi<=+pi/4)
PChi=-pi/4 left hand (cw) circular polarization
PChi<0 left hand polarization
PChi==0 linear polarization
PChi>0 right hand polarization
PChi=pi/4 right hand (ccw) circular polarization
PPsi : inclination of the plane of polarization (after Poincar)
(0<=PPsi<pi)
PPsi is the angle between axis x_1 and the plane of polarizationBecause the angles PChi and PPsi are defined in a mirrored coordinate
system
with the incident beam parallel to e3^ (and not antiparallel) the signs of
the
angle PPsi must be altered if used in the standard SAXS coordinate system.
The
result is independent of the sign of PChi.The scattering intensity Iout can also be splitted into an unpolarized and
a polarized part:(xiv a) Iout = Iout(1) + Iout(2)
(xiv b) Iout(1) = f_f * (1-P)_s0 * ( 1 + kout3_kout3 )/2
(xiv c) Iout(2) = f_f * P _s0 * (
(1-kout1_kout1) * 0.5 * (1+cos(2_PChi)_cos(2_PPsi))
+ (1-kout2_kout2) * 0.5 * (1-cos(2_PChi)_cos(2_PPsi))
- kout1_kout2 * cos(2_PChi)_sin(2*PPsi) )Dr. Peter Boesecke
ID01 & ID02
European Synchrotron Radiation Facility (ESRF)
B.P. 220
F-38043 GRENOBLE CEDEXTel. +33 (0) 4 7688 2400
Fax. +33 (0) 4 7688 2542Email [email protected]
request from Cedric, ID13
When the wavelength refines, the position of the rings is not updated correctly (they are still calculated with the old wavelength
Hello Jerome,
I was playing with my bootstrap script when I decided to try a script.
The error message should print the usage of the command instead of this
one.
cheers
Frederic
picca@mordor:~/Projets/pyFAI$ ./bootstrap.py MX-calibrate
Executing MX-calibrate from source checkout
Add this option to make fat packages with all test material included (no network connection needed to test)
Hello Jerome,
I would like to know your plan for integration of hdf5/NeXuS files in your tools.
maybe it would be nice to provide a sort of URI system to describe the datas these files.
pyFAI-saxs -p Si.poni hdf5://:/path/to/the/data[slice]
where slice allow to extract part of the datas.
Are you aware of an hdf5 URI system ?
Saxs method expects masked pixels to be 0 whereas Waxs methods request the opposit,1 for masked pixels.
2 bugs:
On creating a GeometryRefinement with GeometryRefinement(data) throws a TypeError in detectors.py (line 235) since _pixel1 in the Detector object is None.
Solution: default pixel1/pixel2 values should be 1 in GeometryRefinement.init ?
. pour pyFAI-calib la sélections des points manuellement dans la fenêtre matplotlib interfère avec le zoom. Je peux sommer dans une région mais lorsque je sélectionne un anneau dans une région zoomée le zoom se réinitialise. Ce serait plus confortable si le zoom était maintenu après la sélection et que l'on puisse revenir à l'image complète via le bouton Home de la fenêtre matplotlib. C'est pas bien grave mais si c'est facile à corriger ce serait plus pratique.
No module named msvccompiler in numpy.distutils; trying from distutils
skipping 'src\histogram.c' Cython extension (up-to-date)
building 'histogram' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\site-packages\nump
y\core\include -Ic:\Python27\include -Ic:\Python27\PC /Tcsrc\histogram.c /Fobuil
d\temp.win-amd64-2.7\Release\src\histogram.obj /openmp
Found executable C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64
\cl.exe
link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\Python27\libs /LIBPATH:c:\Pyth
on27\PCbuild\amd64 /EXPORT:inithistogram build\temp.win-amd64-2.7\Release\src\hi
stogram.obj /OUT:build\lib.win-amd64-2.7\pyFAI\histogram.pyd /IMPLIB:build\temp.
win-amd64-2.7\Release\src\histogram.lib /MANIFESTFILE:build\temp.win-amd64-2.7\R
elease\src\histogram.pyd.manifest
Found executable C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64
\link.exe
mt.exe -nologo -manifest build\temp.win-amd64-2.7\Release\src\histogram.pyd.mani
fest -outputresource:build\lib.win-amd64-2.7\pyFAI\histogram.pyd;2
Found executable C:\Program Files\Microsoft SDKs\Windows\v7.0\bin\x64\mt.exe
skipping 'src\splitPixel.c' Cython extension (up-to-date)
building 'splitPixel' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\site-packages\nump
y\core\include -Ic:\Python27\include -Ic:\Python27\PC /Tcsrc\splitPixel.c /Fobui
ld\temp.win-amd64-2.7\Release\src\splitPixel.obj
link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\Python27\libs /LIBPATH:c:\Pyth
on27\PCbuild\amd64 /EXPORT:initsplitPixel build\temp.win-amd64-2.7\Release\src\s
plitPixel.obj /OUT:build\lib.win-amd64-2.7\pyFAI\splitPixel.pyd /IMPLIB:build\te
mp.win-amd64-2.7\Release\src\splitPixel.lib /MANIFESTFILE:build\temp.win-amd64-2
.7\Release\src\splitPixel.pyd.manifest
skipping 'src\splitBBox.c' Cython extension (up-to-date)
building 'splitBBox' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\site-packages\nump
y\core\include -Ic:\Python27\include -Ic:\Python27\PC /Tcsrc\splitBBox.c /Fobuil
d\temp.win-amd64-2.7\Release\src\splitBBox.obj
link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\Python27\libs /LIBPATH:c:\Pyth
on27\PCbuild\amd64 /EXPORT:initsplitBBox build\temp.win-amd64-2.7\Release\src\sp
litBBox.obj /OUT:build\lib.win-amd64-2.7\pyFAI\splitBBox.pyd /IMPLIB:build\temp.
win-amd64-2.7\Release\src\splitBBox.lib /MANIFESTFILE:build\temp.win-amd64-2.7\R
elease\src\splitBBox.pyd.manifest
skipping 'src\splitBBoxLUT.c' Cython extension (up-to-date)
building 'splitBBoxLUT' extension
cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\site-packages\nump
y\core\include -Ic:\Python27\include -Ic:\Python27\PC /Tcsrc\splitBBoxLUT.c /Fob
uild\temp.win-amd64-2.7\Release\src\splitBBoxLUT.obj /openmp
splitBBoxLUT.c
src\splitBBoxLUT.c(3673) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(4244) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(4503) : warning C4244: '=' : conversion from 'double' to 'flo
at', possible loss of data
src\splitBBoxLUT.c(6814) : warning C4244: '+=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(9159) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(9170) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(9915) : warning C4244: '=' : conversion from 'double' to 'p
yx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(9961) : warning C4244: '=' : conversion from 'double' to '__p
yx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(9982) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(10018) : warning C4244: '=' : conversion from 'double' to '
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10098) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10153) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10174) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(10210) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10305) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10351) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10397) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10443) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10464) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(10500) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10521) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(10557) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10604) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10626) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(10662) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(10708) : warning C4244: '=' : conversion from 'double' to '__
pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(11966) : error C3016: '__pyx_t_18' : index variable in OpenMP
'for' statement must have signed integral type
src\splitBBoxLUT.c(12279) : error C3016: '__pyx_t_18' : index variable in OpenMP
'for' statement must have signed integral type
src\splitBBoxLUT.c(12631) : error C3016: '__pyx_t_18' : index variable in OpenMP
'for' statement must have signed integral type
src\splitBBoxLUT.c(12806) : error C3016: '_pyx_t_18' : index variable in OpenMP
'for' statement must have signed integral type
src\splitBBoxLUT.c(12992) : warning C4244: '+=' : conversion from 'double' to '
_pyx_t_5numpy_float32_t', possible loss of data
src\splitBBoxLUT.c(14466) : warning C4305: '=' : truncation from 'double' to 'fl
oat'
src\splitBBoxLUT.c(14603) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(14613) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(14635) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(15045) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(15481) : warning C4018: '<' : signed/unsigned mismatch
src\splitBBoxLUT.c(15954) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(16056) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(16200) : warning C4244: '=' : conversion from 'double' to 'fl
oat', possible loss of data
src\splitBBoxLUT.c(20542) : warning C4244: 'function' : conversion from '__int64
' to 'long', possible loss of data
src\splitBBoxLUT.c(21409) : warning C4244: '=' : conversion from 'Py_ssize_t' to
'int', possible loss of data
src\splitBBoxLUT.c(23392) : warning C4244: 'function' : conversion from 'Py_ssiz
e_t' to 'int', possible loss of data
src\splitBBoxLUT.c(37237) : warning C4244: 'function' : conversion from 'const P
y_ssize_t' to 'long', possible loss of data
error: Command "cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\si
te-packages\numpy\core\include -Ic:\Python27\include -Ic:\Python27\PC /Tcsrc\spl
itBBoxLUT.c /Fobuild\temp.win-amd64-2.7\Release\src\splitBBoxLUT.obj /openmp" fa
iled with exit status 2
20120966@diffabs3:/usr/lib/python2.7/dist-packages/pyFAI$ pyFAI-integrate
ERROR:pyFAI.integrate_widget:No such file: .azimint.json
Dump!
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pyFAI/integrate_widget.py", line 99, in proceed
self.dump()
File "/usr/lib/python2.7/dist-packages/pyFAI/integrate_widget.py", line 323, in dump
with open(filename, "w") as myFile:
IOError: [Errno 13] Permission non accordée: '.azimint.json'
Traceback (most recent call last):
File "/usr/bin/pyFAI-integrate", line 102, in proceed
self.set_ai()
File "/usr/bin/pyFAI-integrate", line 459, in set_ai
darks = numpy.zeros(d0.shape[0], d0.shape[1], len(dark_files), dtype=numpy.float32)
TypeError: function takes at most 3 arguments (4 given)
does not set detector type ...
Masks and flats (dark current ?) when they were created by fit2D needs to be distorted in the opposite way (not corrected, uncorrected) to be used precisely by pyFAI
Hello Jerome,
When I use the -b option of pyFAI calib, I got this error message.
without -b it works.
20120966@diffabs3:~$ pyFAI-calib --background=50 -w 0.65 -S Si.D -D Xpad Si_1379.edf
INFO:root:Enter, port=54321.
INFO:root:Enter.
INFO:pyFAI.utils:Reading Si_1379.edf
Traceback (most recent call last):
File "/usr/bin/pyFAI-calib", line 62, in
c.preprocess()
File "/usr/lib/python2.7/dist-packages/pyFAI/calibration.py", line 702, in preprocess
AbstractCalibration.preprocess(self)
File "/usr/lib/python2.7/dist-packages/pyFAI/calibration.py", line 427, in preprocess
filter_=self.filter)
File "/usr/lib/python2.7/dist-packages/pyFAI/utils.py", line 481, in averageImages
elif ("len" in dir(darks)) and (type(darks[0]) in types.StringTypes):
IndexError: list index out of range
Cheers
Fred
TODO on DistortionCorrection plugin:
j'ai un petit souci avec la dernière version de pyFAI sur mon mac. J'ai tenté de passer à la dernière version mais je me retrouve coincé avec l'erreur suivante :
MacBook-de-Cedric:calibrations cedricmontero$ pyFAI-calib calib_al2o3_1.edf
WARNING:root:Exception No module named fftw3: FFTw3 not available. Falling back on Scipy
INFO:root:Enter, port=54321.
INFO:root:Enter.
ERROR:pyFAI.calibration:No such d-Spacing file: None
pyFAI calib has changed !!!
Instead of entering the 2theta value, which was tedious,the program takes a d-spacing file in input (just a serie of number representing the inter-planar distance in Angstrom)
and an associated wavelength
You will be asked to enter the ring number, which is usually a simpler than the 2theta value.
Please enter the name of the file containing the d-spacing: alpha_Al2O3.D
Please enter wavelength in Angstrom: 0.865771
Please enter the pixel size (in micron, comma separated X,Y i.e. 1.50e+01,1.50e+01) or a spline file: /Users/cedricmontero/Folder/ESRF/Projects/8_Kevlar_tensile/Experiments/d_2013-06-21_inh_stretch/PROCESS/ANALYSIS/corrections/frelonid13_C26_2013-01-21/distorsion.spline
Traceback (most recent call last):
File "/usr/local/bin/pyFAI-calib", line 62, in
c.preprocess()
File "/Library/Python/2.7/site-packages/pyFAI/calibration.py", line 727, in preprocess
AbstractCalibration.preprocess(self)
File "/Library/Python/2.7/site-packages/pyFAI/calibration.py", line 478, in preprocess
self.peakPicker.gui(log=True, maximize=True)
File "/Library/Python/2.7/site-packages/pyFAI/peakPicker.py", line 109, in gui
mng.resize(event)
TypeError: resize() takes exactly 3 arguments (2 given)
d
DirectBeamDist= 107.717mm Center: x=1033.709, y=1013.185 pix Tilt=0.735 deg tiltPlanRotation= -178.200 deg
Detector Detector Spline= /mntdirect/_data_opid13_inhouse/THEDATA/d_2013-03-09_inh_pp/REMOTE/REMOTE/test_plugin/edf100/COPIED_distorsion.spline PixelSize= 5.095e-05, 5.167e-05 m
Wavelength= 8.856014e-11m
SampleDetDist= 1.077081e-01m PONI= 5.166798e-02, 5.479423e-02m rot1=0.012822 rot2= -0.000403 rot3= -0.000000 rad
DirectBeamDist= 107.717mm Center: x=1033.709, y=1013.185 pix Tilt=0.735 deg tiltPlanRotation= -178.200 deg
Modify parameters ?
Traceback (most recent call last):
File "/usr/bin/pyFAI-calib", line 65, in
c.postProcess()
File "/usr/lib/pymodules/python2.6/pyFAI/calibration.py", line 380, in postProcess
self.geoRef.mask = self.mask
File "/usr/lib/pymodules/python2.6/pyFAI/azimuthalIntegrator.py", line 2771, in set_mask
self.detector.set_mask(mask)
File "/usr/lib/pymodules/python2.6/pyFAI/detectors.py", line 257, in set_mask
self._mask_crc = crc32(mask)
TypeError: Argument 'data' has incorrect type (expected numpy.ndarray, got NoneType)
Many typo and small bugs have been found in this library containing helper functions,
a good test suite is needed.
mean over a stack, masking data with abs(I-) > 4 std(I)
(4 being a parameter)
requested bu BM26
Hello, When I try to use pyFAI-calib with this
pyFAI-calib --spacing=CH_3.D CH_3.tiff
I get this:
INFO:TiffIO:Not closing not owned file
ERROR:pyFAI.peakPicker:ControlPoint.load: No such file CH_3.npt
INFO:pyFAI.peakPicker:Image size is (2048, 2048)
INFO:pyFAI.peakPicker:Binning size is [2, 2]
Please enter wavelength in Angstrom: INFO:pyFAI.peakPicker:Labeling found 15619 massifs.
INFO:pyFAI.peakPicker:Labeling found 15619 massifs.
1.7
INFO:root:Please use the GUI and Right-click on the peaks to mark them (center-click to erase last group)
Please press enter when you are happy; to fill in ring number
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1437, in call
return self.func(_args)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 286, in button_press_event
FigureCanvasBase.button_press_event(self, x, y, num, guiEvent=event)
File "/usr/lib/pymodules/python2.7/matplotlib/backend_bases.py", line 1632, in button_press_event
self.callbacks.process(s, mouseevent)
File "/usr/lib/pymodules/python2.7/matplotlib/cbook.py", line 262, in process
proxy(_args, *_kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/cbook.py", line 192, in call
return mtd(_args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pyFAI/peakPicker.py", line 155, in onclick
a = self.points.pop()
File "/usr/lib/python2.7/dist-packages/pyFAI/peakPicker.py", line 366, in pop
self._angles.pop()
IndexError: pop from empty list
See you
Frederic
Hello when I start pyFAI with only one edf file I got htis error message
20120966@diffabs3:~/ruche/published-data$ pyFAI-calib lab6.edf
INFO:root:No socket opened for debugging. Please install rfoo
Traceback (most recent call last):
File "/usr/bin/pyFAI-calib", line 58, in
c.parse()
File "/usr/lib/python2.7/dist-packages/pyFAI/calibration.py", line 680, in parse
(options, _) = self.analyse_options()
File "/usr/lib/python2.7/dist-packages/pyFAI/calibration.py", line 296, in analyse_options
self.spacing_file = os.path.abspath(options.spacing)
File "/usr/lib/python2.7/posixpath.py", line 352, in abspath
if not isabs(path):
File "/usr/lib/python2.7/posixpath.py", line 61, in isabs
return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
Hello when playing with pyFAI-integrate, it got this
WARNING:pyFAI.integrate_widget:Undefined unit !!! falling back on 2th_deg
INFO:pyFAI.integrate_widget:Parameters for integration:
dummy: None
error_model: None
delta_dummy: None
safe: False
filename: None
polarization_factor: None
correctSolidAngle: True
nbPt_rad: 360
method: lut
unit: 2th_deg
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pyFAI/integrate_widget.py", line 205, in proceed
if self.hdf5_path:
AttributeError: 'AIWidget' object has no attribute 'hdf5_path'
Hello Jerome.
with some pictures it not possible to use the automatic mode (right click) to select a ring.
(It dos not work)
I will attach an image for exemple and the D spacing information.
It wouls be nice if it exist a mode when each click add a point.
We can imagine a way to provide different method for the peak selection.
1 click -> 1 point
1 click -> the way it works now
3 click + 1 click -> define a circle + the thikness of the right -> an area when we can find a peak.
Cheers
Frederic
. le champs de distorsion qui est affiché devrait inclure une barre d'échelle de façon à identifier si l'ordre de grandeur est cohérent et ne pas se fier uniquement à la forme.
polarization correction needs tests
Working on device: GPU
1D integration of Pilatus1M.edf 1.0 Mpixel -> 981 bins
Traceback (most recent call last):
File "./benchmark.py", line 252, in
b.bench_cpu1d_ocl_lut("GPU")
File "./benchmark.py", line 151, in bench_cpu1d_ocl_lut
res = ai.xrpd_LUT_OCL(data, N, devicetype=devicetype, platformid=platformid, deviceid=deviceid)
File "/Users/kieffer/workspace/pyFAI/build/lib.macosx-10.7-intel-2.7/pyFAI/azimuthalIntegrator.py", line 685, in xrpd_LUT_OCL
self._ocl_lut_integr = ocl_azim_lut.OCL_LUT_Integrator(self._lut_integrator.lut, devicetype, platformid=platformid, deviceid=deviceid, checksum=self._lut_integrator.lut_checksum)
File "/Users/kieffer/workspace/pyFAI/build/lib.macosx-10.7-intel-2.7/pyFAI/ocl_azim_lut.py", line 70, in init
self._program = pyopencl.Program(self._ctx, open(os.path.join(os.path.dirname(os.path.abspath(file)), "ocl_azim_LUT.cl")).read()).build()
File "/Library/Python/2.7/site-packages/pyopencl-2012.2-py2.7-macosx-10.7-intel.egg/pyopencl/init.py", line 158, in build
raise err
pyopencl.RuntimeError: clBuildProgram failed: build program failure -
Build on <pyopencl.Device 'GeForce 9400M' on 'Apple' at 0x1022600>:
:104:75: error: invalid argument type 'float const' to unary expression
if( (!do_dummy) || (delta_dummy && (fabs(data-dummy) > delta_dummy))|| (!delta_dummy && (data!=dummy)))
^~~~~~~~~~~~
:166:7: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
if(i < bins)
~ ^ ~~~~
:166:7: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
if(i < bins)
~ ^ ~~~~
:168:13: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
for (j=0;j<lut_size;j++)
~^~~~~~~~~
:168:13: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
for (j=0;j<lut_size;j++)
~^~~~~~~~~
:176:76: error: invalid argument type 'float const' to unary expression
if( (!do_dummy) || (delta_dummy && (fabs(data-dummy) > delta_dummy))|| (!delta_dummy && (data!=dummy)))
^~~~~~~~~~~~
:250:7: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
if(i < bins)
~ ^ ~~~~
:250:7: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
if(i < bins)
~ ^ ~~~~
:252:13: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
for (j=0;j<lut_size;j++)
~^~~~~~~~~
:252:13: warning: comparison of integers of different signs: 'int' and 'uint const' (aka 'unsigned int const')
for (j=0;j<lut_size;j++)
~^~~~~~~~~
:260:76: error: invalid argument type 'float const' to unary expression
if( (!do_dummy) || (delta_dummy && (fabs(data-dummy) > delta_dummy))|| (!delta_dummy && (data!=dummy)))
^~~~~~~~~~~~
(source saved as /var/folders/l_/nmqqpw1j1dq2x0xwv8y92ym80000gn/T/tmpiLLifs.cl)
Hello, I am trying to debug pyFAI and it would be nice if it could be possible to test the code inplace.
so a python setup.py build_ext --inplace generate the Extension inside the source code. this way it is possible from the source directory to do
import pyFAI
but for this the module organisation of the source should be identical to the source module organisation once installed on the system.
so Is it possible to rename pyFAI-src into pyFAI.
It would ease a lot the debuggage. :)
cheers
when I start pyFAI-saxs, I get this message and I could not stop the programme until I use xkill
20120966@diffabs3:~/ruche/published-data$ pyFAI-saxs -p lab6.poni lab6.edf
Detector Xpad_flat PixelSize= 1.300e-04, 1.300e-04 m
Wavelength= 6.500000e-11m
SampleDetDist= 3.828605e-01m PONI= 1.174935e-01, 5.737684e-02m rot1=0.022558 rot2= -0.029589 rot3= 0.000000 rad
DirectBeamDist= 383.126mm Center: x=374.915, y=816.606 pix Tilt=2.132 deg tiltPlanRotation= -127.310 deg
Mask: None Method: BBox
Hello, I package pyFAI 0.8.7 but:
picca@ORD03037:~$ pyFAI-integrate
ERROR:pyFAI.opencl:Unable to import pyOpenCl. Please install it from: http://pypi.python.org/pypi/pyopencl
ERROR:pyFAI.azimuthalIntegrator:Unable to import pyFAI.ocl_azim
ERROR:pyFAI.azimuthalIntegrator:Unable to import pyFAI.ocl_azim_lut for Look-up table based azimuthal integration on GPU
WARNING:root:Exception No module named fftw3: FFTw3 not available. Falling back on Scipy
Traceback (most recent call last):
File "/usr/bin/pyFAI-integrate", line 492, in
window = AIWidget()
File "/usr/bin/pyFAI-integrate", line 31, in init
uic.loadUi('integration.ui', self)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/init.py", line 223, in loadUi
return DynamicUILoader(package).loadUi(uifile, baseinstance)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/Loader/loader.py", line 71, in loadUi
return self.parse(filename, basedir)
File "/usr/lib/python2.7/dist-packages/PyQt4/uic/uiparser.py", line 921, in parse
document = parse(filename)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1183, in parse
tree.parse(source, parser)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
source = open(source, "rb")
IOError: [Errno 2] Aucun fichier ou dossier de ce type: 'integration.ui'
the problem is that the binary does not find the .ui file
I do not know how do you want to solve this issue.
the python setup.py sdist does not contain the ui file
it should be nice to add somme package_data
package_data = {
'pyFAI.qt': ['*.ui']
}
the to use in the code something like
def get_ui(filename):
basedir = os.path.dirname(os.path.abspath(file))
return os.path.join(basedir, filename)
in the file which use the .ui.
Since it is not allow to put other things than binaru under /usr/bin.
It may be nice to create under pyFAI a qt directory with the gui code.
and call something like
from pyFAI.qt import main
if name == "main":
main()
Cheers
Fred
Hello, I am preparing a package for Debian and during the buil dprocess I got this error
message.
WARNING:pyFAI.azimuthalIntegrator:Look-up table implementation not available: falling back on old method !
WARNING:pyFAI.azimuthalIntegrator:Look-up table implementation not available: falling back on old method !
..............WARNING:pyFAI.timeit:calc_LUT_size took 13.003s
WARNING:pyFAI.timeit:calc_LUT took 21.073s
WARNING:pyFAI._distortion:Patching image as image is 2048x1024 and spline is 2048x1025
WARNING:pyFAI.timeit:correct took 1.791s
/tmp/buildd/pyfai-0.8.9/test/testDistortion.py:72: RuntimeWarning: invalid value encountered in divide
ratio = delta / self.fit2d
cheers
Fred
Looks possible after the work on distortion correction. Should reduce the size of the look-up table as well.
missing file in windows installation + UTF8 -> ascii issue
Hello
I try to build the current master branch and on linux there is a problem with the last commit.
windowsError is unkown.
this is because you moved the fft part above the windowsError = RuntimeError.
cheers
Fred.
Ps: je ne peux pas t'envoyer de patch je suis sur les lignes et je n(ai pas mes clef...
It could be enhanced by having in the Detector class a "contiguous" flag.
There could be a calc_cartesian_positions_corner that calculates the position of the 4 corners with +/- pixel size (to be used or not in geometry)
Modify parameters ? set rot1 0
Traceback (most recent call last):
File "/usr/bin/pyFAI-recalib", line 65, in
c.refine()
File "/usr/lib/pymodules/python2.6/pyFAI/calibration.py", line 812, in refine
setattr(self.geoRef, what, value)
NameError: global name 'value' is not defined
pixel size: 75 microns
2923: size in cm 12 mpix
Traceback (most recent call last):
File "/users/opd29/workspace/pyFAI/test/testOpenCL.py", line 112, in test_OpenCL_LUT
res = ai.xrpd_LUT_OCL(data, 1000, devicetype="all", platformid=ids[0], deviceid=ids[1])
File "/users/opd29/workspace/pyFAI/build/lib.linux-x86_64-2.6/pyFAI/azimuthalIntegrator.py", line 1356, in xrpd_LUT_OCL
checksum=self._lut_integrator.lut_checksum)
File "/users/opd29/workspace/pyFAI/build/lib.linux-x86_64-2.6/pyFAI/ocl_azim_lut.py", line 91, in init
pyopencl.enqueue_copy(self._queue, self._cl_mem["lut"], lut.T.copy())
File "/usr/lib/python2.6/dist-packages/pyopencl/init.py", line 747, in enqueue_copy
return _cl._enqueue_write_buffer(queue, dest, src, **kwargs)
MemoryError: clEnqueueWriteBuffer failed: mem object allocation failure
Ran 90 tests in 58.804s
FAILED (errors=1)
There are many entries in a single poni file. they should be tagged with timestamps (at lease)
Looks like the labeling of massif is completely funky with data from ID13 ...
Hello, when I red these method I found at least three problems:
cheers
Fred
def set_darkfiles(self, files=None, method="mean"):
"""
@param files: file(s) used to compute the dark.
@type files: str or list(str) or None
@param method: method used to compute the dark, "mean" or "median"
@type method: str
Set the dark current from one or mutliple files, avaraged
according to the method provided
"""
if type(files) in types.StringTypes:
files = [i.strip() for i in files.split(",")]
elif not files:
files = []
if len(files) == 0:
self.set_darkcurrent(None)
elif len(files) == 1:
self.set_darkcurrent(fabio.open(files[0]).data.astype(numpy.float32))
self.darkfiles = files[0]
else:
self.set_darkcurrent(utils.averageDark(files), method)
self.darkfiles = "%s(%s)" % (method, ",".join(files))
C:\Users\wouter\Documents\2013\B-station\2D-detector\PyFai\PyFAI_184_40keV>pyFAI
-integrate.py data1.tif
WARNING:root:Exception No module named fftw3: FFTw3 not available. Falling back
on Scipy
Dump!
Detector Detector Spline= None PixelSize= 7.500e-05, 7.500e-05 m
Wavelength= 3.099145e-11m
SampleDetDist= 1.836135e-01m PONI= 6.178475e-03, 1.191257e-01m rot1=0.0
00825 rot2= 0.010000 rot3= 0.000000 rad
DirectBeamDist= 183.623mm Center: x=1586.324, y=106.862 pix Tilt=0.5
75 deg tiltPlanRotation= 94.714 deg
INFO:pyFAI.integrate_widget:Parameters for integration:
dummy: None
error_model: poisson
delta_dummy: None
nbPt_azim: 360
safe: False
filename: None
azimuth_range: None
polarization_factor: None
correctSolidAngle: True
nbPt_rad: 1200
method: lut
unit: 2th_deg
radial_range: None
INFO:pyFAI.azimuthalIntegrator:AI.integrate2d: Resetting integrator because init
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pyFAI\integrate_widget.py", line 217, in p
roceed
out.append(self.ai.integrate2d(**kwarg)[0])
File "C:\Python27\lib\site-packages\pyFAI\azimuthalIntegrator.py", line 2419,
in integrate2d
self._lut_integrator = self.setup_LUT(shape, nbPt, mask, radial_range, azimu
th_range, mask_checksum=mask_crc, unit=unit)
File "C:\Python27\lib\site-packages\pyFAI\azimuthalIntegrator.py", line 962, i
n setup_LUT
unit=unit)
File "splitBBoxLUT.pyx", line 465, in splitBBoxLUT.HistoBBox2d.init (src\s
plitBBoxLUT.c:8340)
OverflowError: size does not fit in an int
Dump!
Detector Detector Spline= None PixelSize= 7.500e-05, 7.500e-05 m
Wavelength= 3.099145e-11m
SampleDetDist= 1.836135e-01m PONI= 6.178475e-03, 1.191257e-01m rot1=0.0
00825 rot2= 0.010000 rot3= 0.000000 rad
DirectBeamDist= 183.623mm Center: x=1586.324, y=106.862 pix Tilt=0.5
75 deg tiltPlanRotation= 94.714 deg
INFO:pyFAI.integrate_widget:Parameters for integration:
dummy: None
error_model: poisson
delta_dummy: None
nbPt_azim: 36
safe: False
filename: None
azimuth_range: None
polarization_factor: None
correctSolidAngle: True
nbPt_rad: 1200
method: lut
unit: 2th_deg
radial_range: None
INFO:pyFAI.azimuthalIntegrator:AI.integrate2d: Resetting integrator because init
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pyFAI\integrate_widget.py", line 217, in p
roceed
out.append(self.ai.integrate2d(**kwarg)[0])
File "C:\Python27\lib\site-packages\pyFAI\azimuthalIntegrator.py", line 2654,
in integrate2d
self.save2D(filename, I, bins_rad, bins_azim, sigma, unit, dark=dark, flat=f
lat, polarization_factor=polarization_factor)
File "C:\Python27\lib\site-packages\pyFAI\azimuthalIntegrator.py", line 2806,
in save2D
if dark:
ValueError: The truth value of an array with more than one element is ambiguous.
Use a.any() or a.all()
C:\Users\wouter\Documents\2013\B-station\2D-detector\PyFai\PyFAI_184_40keV>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.