dkriegner / xrayutilities Goto Github PK
View Code? Open in Web Editor NEWxrayutilities - a package with useful scripts for X-ray diffraction physicists
Home Page: http://xrayutilities.sourceforge.io
License: GNU General Public License v2.0
xrayutilities - a package with useful scripts for X-ray diffraction physicists
Home Page: http://xrayutilities.sourceforge.io
License: GNU General Public License v2.0
repeated database accesses for the same material parameter should be buffered-> faster!
its annoying that the current version used after an import can not be detected. xrayutilities should set the __version__
attribute
see:
https://packaging.python.org/en/latest/single_source_version/#single-sourcing-the-version
Reported by: dkriegner
in most functions which accept **kwargs a check should be added to raise an error in case an unexpected keyword argument is given. users might in this way easier find an error in their scripts.
Reported by: dkriegner
QConversion routine should be extended to include the possibility of energy scans for arbitrary detectors.
Blocked by [#9]
Reported by: dkriegner
I am trying to simulate the powder x-ray pattern from a COD cif.
My python code is grab from internet:
#from pymatgen import Lattice, Structure
import numpy
import xrayutilities as xru
#from xrayutilities.materials.cif import CIFFile
from xrayutilities.materials import CIFFile
from xrayutilities.materials.material import Crystal
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import matplotlib
matplotlib.rcParams.update({'font.size': 18})
fig_size = [15, 12]
plt.rcParams["figure.figsize"] = fig_size
xu_cif = CIFFile("bifeo3.cif")
xu_crystal = Crystal(name="BiFeO3", lat=xu_cif.SGLattice())
two_theta = numpy.arange(0, 80, 0.01)
powder = xru.simpack.smaterials.Powder(xu_crystal, 1)
pm = xru.simpack.PowderModel(powder, I0=100)
intensities = pm.simulate(two_theta)
plt.plot(two_theta,intensities)
plt.xlim(0,80)
ax = plt.axes()
ax.xaxis.set_major_locator(ticker.MultipleLocator(5))
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter('%.4f'))
plt.title("XRD Pattern for " + xu_crystal.name)
plt.xlabel("2 theta (degrees)")
plt.ylabel("Intensity")
plt.show()
My cif test if from COD database:
#------------------------------------------------------------------------------
#$Date: 2016-02-18 17:37:37 +0200 (Thu, 18 Feb 2016) $
#$Revision: 176729 $
#$URL: svn://www.crystallography.net/cod/cif/1/00/10/1001090.cif $
#------------------------------------------------------------------------------
#
# This file is available in the Crystallography Open Database (COD),
# http://www.crystallography.net/
#
# All data on this site have been placed in the public domain by the
# contributors.
#
data_1001090
loop_
_publ_author_name
'Moreau, J M'
'Michel, C'
'Gerson, R'
'James, W J'
_publ_section_title
;
Ferroelectric Bi Fe O~3~ X-Ray and neutron diffraction study
;
_journal_coden_ASTM JPCSAW
_journal_name_full 'Journal of Physics and Chemistry of Solids'
_journal_page_first 1315
_journal_page_last 1320
_journal_paper_doi 10.1016/S0022-3697(71)80189-0
_journal_volume 32
_journal_year 1971
_chemical_formula_structural 'Bi Fe O3'
_chemical_formula_sum 'Bi Fe O3'
_chemical_name_systematic 'Bismuth iron(III) oxide'
_space_group_IT_number 161
_symmetry_cell_setting trigonal
_symmetry_space_group_name_Hall 'R 3 -2"c'
_symmetry_space_group_name_H-M 'R 3 c :H'
_cell_angle_alpha 90
_cell_angle_beta 90
_cell_angle_gamma 120
_cell_formula_units_Z 6
_cell_length_a 5.5876(3)
_cell_length_b 5.5876(3)
_cell_length_c 13.867(1)
_cell_volume 374.9
_refine_ls_R_factor_all 0.09
_cod_original_sg_symbol_H-M 'R 3 c H'
_cod_database_code 1001090
loop_
_symmetry_equiv_pos_as_xyz
x,y,z
-y,x-y,z
y-x,-x,z
-y,-x,1/2+z
x,x-y,1/2+z
y-x,y,1/2+z
1/3+x,2/3+y,2/3+z
2/3+x,1/3+y,1/3+z
1/3-y,2/3+x-y,2/3+z
2/3-y,1/3+x-y,1/3+z
1/3-x+y,2/3-x,2/3+z
2/3-x+y,1/3-x,1/3+z
1/3-y,2/3-x,1/6+z
2/3-y,1/3-x,5/6+z
1/3+x,2/3+x-y,1/6+z
2/3+x,1/3+x-y,5/6+z
1/3-x+y,2/3+y,1/6+z
2/3-x+y,1/3+y,5/6+z
loop_
_atom_site_label
_atom_site_type_symbol
_atom_site_symmetry_multiplicity
_atom_site_Wyckoff_symbol
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
_atom_site_attached_hydrogens
_atom_site_calc_flag
Bi1 Bi3+ 6 a 0. 0. 0. 1. 0 d
Fe1 Fe3+ 6 a 0. 0. 0.2212(15) 1. 0 d
O1 O2- 18 b 0.443(2) 0.012(4) 0.9543(20) 1. 0 d
loop_
_atom_type_symbol
_atom_type_oxidation_number
Bi3+ 3.000
Fe3+ 3.000
O2- -2.000
This gives an Output error:
Traceback (most recent call last):
File "main.py", line 15, in <module>
xu_cif = CIFFile("bifeo3.cif")
File "lib/python3.6/site-packages/xrayutilities/materials/cif.py", line 180, in __init__
self.SymStruct()
File "lib/python3.6/site-packages/xrayutilities/materials/cif.py", line 378, in SymStruct
element = getattr(elements, el)
AttributeError: module 'xrayutilities.materials.elements' has no attribute 'Bi+'
When I remove the + sign of the chage in the cif, the library works.
Please, guide me to solve this issue.
Congratulation for the work and thanks for the attention.
at the moment we use scons for installation of the c-library, scons is calling distutils for the installtion of the python package. it would be more convenient for users to avoid the usage of scons and use distutils for the full installation
this requires moving the c-code to a c-extension
scons should not be required anymore for users. we should keep it for building the documentation, webpage and so on.
we could ship prebuilt packages for windows once this is done!
Reported by: dkriegner
A new file reader for the new (easy) ascii-files created at beamline P08 at DESY should be included. In addition to standard data parsing and name based access also the header needs to be parsed correctly.
Multiple scans should be parsed together. support for linear detector data should be included.
Reported by: dkriegner
consider using file parser from the cctbx package http://cctbx.sourceforge.net/ trough a simply include in case the package is available.
should be kept optional in the best case.
could replace EDF parser and help in reading the CBF images of CCD detectors
see: http://cctbx.sourceforge.net/current/python/iotbx.html
Reported by: dkriegner
in order to allow for more tests and combining different models coherently it would be nice to allow to return the field (complex number) instead of the intensity
Reported by: dkriegner
While trying to change the energy of x-rays for simulating xrd data, I noticed that the pattern wouldn't change by setting the en=(energy, eV) keyword when PowderModel is instantiated.
e.g., looking at the tutorial example
(https://xrayutilities.sourceforge.io/simulations.html#powder-diffraction-simulations)
pm = xu.simpack.PowderModel(Fe_powder, Co_powder, I0=100, en=10000)
The addition of the 'en' keyword does not affect the output. After the above line of code, I checked the energy of the PowderDiffraction class that was created:
in: pm.pdiff[0].energy out: 8047.8230999999987
After some digging, I noticed I could override this and set the energy manually by:
pm.pdiff[0].energy=10000
However it seemed to me that this keyword should have worked. I can see that the keyword get's passed down in the source code, but for whatever reason the PowderDiffraction class that comes out still has the Cu Kalpha1 energy.
I made a jupyter notebook showing the bug based on the example from the tutorial. I couldn't attach it here as a .ipynb so I changed the extension to txt. I've also attached a PDF of the notebook.
XrayUtilities_BugDemonstration.pdf
XrayUtilities_BugDemonstration.txt
analogous function for 111 surface should be added
Reported by: dkriegner
currently there is only one function for energy to wavelength and wavelength to energy conversion. since the introduction of names for energy and wavelength this is however misleading
e.g. what means
xu.utilities.lam2en('CuKa1')
the name suggests it returns an energy, however, it is often used different and will return actually the wavelength. there should be two functions lam2en and en2lam to distinguish such cases!
Reported by: dkriegner
A user reported an incompatibility between xrayutilities and spec when it comes to orientation matrices. The definition of the B matrix used in xrayutilities is slightly different from the one used in spec which is derived from Busing&Levy Acta Cryst.. 22, 457 (1967).
this should be fixed in some way or the other
BUG in getspecscan and geth5scan in io/spec.py for spec motornames with whitespaces:
1036 - h5scan.attrs["INIT_MOPO_%s" % motname]
1036 + h5scan.attrs["INIT_MOPO_%s" % makeNaturalName(motname)]
1112 - sscan.init_motor_pos["INIT_MOPO_%s" % motname])
1112 + sscan.init_motor_pos["INIT_MOPO_%s" % makeNaturalName(motname)])
Reported by: dschick
Change the build system from distutils to setuptools.
Reported by: eugenwintersberger
If a powder profile depends on the Miller indices HKL the powder diffraction class needs to treat all contributions to a powder line independently. This is not done by default since it would significantly slow down the calculation but should optionally be possible to allow for such anisotropic convolvers (e.g. anisotropic size of crystallites)
Developement on Github offers many convenient features and migration of projects seems to be very easy
https://github.com/new/import
issue migration seems to be possible using https://github.com/cmungall/gosf2github
Reported by: dkriegner
I was trying to use a tetragonal system of space group 123 (a=b =/= c, alpha = beta = gamma = 90deg).
In spacegrouplattice.py, the tetragonal systems have a value of 120deg for gamma (probably copy&paste from hexagonal/trigonal), so I just changed it there.
Example code showing a primitive unit cell for iron and a doubled one (to get epitaxy on MgO working...):
import xrayutilities as xu
import numpy as np
FeTetr = xu.materials.Crystal("Fe", xu.materials.SGLattice(123,np.sqrt(2)*2.8665,2.8665,
atoms=[xu.materials.e.Al,xu.materials.e.Bi,xu.materials.e.Ca],
pos=['1a','1c','2e']))
print('Tetragonal:')
for at, pos, occ, b in FeTetr.lattice.base():
print(at,pos,occ,b)
FeBcc = xu.materials.Crystal("Fe", xu.materials.SGLattice(229, 2.8665, atoms=[xu.materials.e.Fe, ], pos=['2a', ]))
print('\nBcc:')
for at, pos, occ, b in FeBcc.lattice.base():
print(at,pos,occ,b)
FeTetr.environment((0,0,0))
FeBcc.environment((0,0,0))
With 120deg, the environment are not the same, even though they should be. With 90deg, they are the same, only the multiplicities split and there are tiny numerical differences.
Hi,
I am a physicist working since a while with x-rays but only recently on powders.
First of all, thanks for the very nice package and in particular the relatively new powders models. With some colleagues we have used TOPAS so far but we are eager to switch to something open, easily installable, etc.
In this sense the current interface is nice but could probably be improved a bit:
is there any way not to use some 'convolver' ? For example in our experiment (at a synchrotron) we did not use any Soller slits, how can I bypass it ? I could not find a way in the documentation. Looking at the code it seems that this option is not actually implemented. In general a better documentation or more complete example would be very nice to have.
It would be nice to add some commonly used 'corrections' like the footprint correction
I am willing to help in any way that makes sense including proposing code changes, comparing the numerical results with calculations done by TOPAS or improving documentations and examples.
Thanks again,
marco
functions to obtain a line scan from a reciprocal space map measurement should operate on the raw data instead of the gridded reciprocal space map (at least for 2D measurements).
the 1D gridder should be used extensively to provide this functionality
Reported by: dkriegner
setuptools offers a sphinx_build target which we currently ignore but should use and abandon our custom changes in setup.py
Reported by: dkriegner
The visibility of the mailing list should be increased. It should be mentioned in the readme and documentation as primary contact in case of problems with installation and use!
I'm trying to calculate a powder diffraction pattern, but am unable to update the wavelength in the global
dictionary. I am able to update other keys, and add a wavelength
key and pass it to fpsettings
, but this has no effect on the output pattern. This script is based off the xrayutilities_experiment_Powder_example_Iron
example and I'm currently running it inside a jupyter notebook. I tried some alternatives: running this as an executable in a directory alongside a xrayutilities.conf
file, and also passing a wl=#.##
argument directly to PowderDiffraction()
but am not having any luck. Any advice?
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
import xrayutilities as xu
from xrayutilities.materials.cif import CIFFile
from xrayutilities.materials.material import Crystal
ni_cif = CIFFile('./stru/Ni.cif')
ni_crystal = Crystal(name="Ni", lat=ni_cif.SGLattice())
#X-ray wavelength is 0.1866 Angstroms
settings = {'global': {'wavelength': 0.1866e-10,
'dominant_wavelength': 0.1866e-10,
'diffractometer_radius': 0.010101}}
ni_powder = xu.simpack.Powder(ni_crystal, 1)
pd = xu.simpack.PowderDiffraction(ni_powder, fpsettings=settings)
tt = np.arange(1, 200, 0.01)
inte = pd.Calculate(tt)
print(pd)
fig, ax1 = plt.subplots(1, 1, figsize=(8,8))
ax1.plot(tt, inte)
ax1.set_xlim(0,200)
Here is a partial output of the printed settings dictionary:
Settings: {'absorption': {'absorption_coefficient': 100000.0},
'global': {'wavelength': 1.866e-11,
'dominant_wavelength': 1.5405929759615019e-10,
'equatorial_divergence_deg': 0.5,
'diffractometer_radius': 0.010101}}
The Gridder
class serves as abstraction of all the derived classes Gridder1D, Gridder2D, ...
The class itself however should not be usable since its methods rely on properties which are defined only in the derived classes.
@eugenwintersberger what is the best/pythonic way to solve this?
I see two options:
option 2 seems easy, but does not look like the best solution...
Hi,
I try to import a crystal structure in cubic from a CIF file.
import xrayutilities.materials.cif as cif
crystal = cif.CIFFile("./Si.cif")
calcite = crystal.SGLattice()
print(Is)
The code above gives the following output.
1 triclinic P1: a = 5.4309, b = 5.4309 c= 5.4309
alpha = 90.000, beta = 90.000, gamma = 90.000
Lattice base:
.....
Obviously, Si is not triclinic P1. I import the same CIF file from other programs and the CIF file does not have any issues.
I wonder if I miss anything here. Thanks in advance.
Dan Shim
In the debub print message on line 113 of normalize.py the parameters N and M (# pixels in ROI) are undefined.
transparent reading of compressed files should be possible not only for gzip-compression but also for bz2 compression
see: http://docs.python.org/2/library/bz2.html
this applies basically to all data file readers and should be implemented in a central place as a helper function
Reported by: dkriegner
structure factor and chi calculation still has a lot of overhead since the atomic scattering factor database function are called for every atom in the unit cell and do not consider that most atoms appear multiple times!
this should be reorganized to work more efficient!
Reported by: dkriegner
Idea: Use PyArray_FROM_OTF http://docs.scipy.org/doc/numpy/user/c-info.how-to-extend.html#PyArray_FROM_OTF
in the c-code to avoid the use of numpy.require in the python code and keep it more readable
Reported by: dkriegner
it seems that currently several powder lines without intensity are nevertheless calculated.
this should be optimized!
should be an easy fix
sigmas should only be positive values
Reported by: wusal
It would be helpful if the kinematical diffraction model could be used to do a rough fit of formatted XRD data for thin films and superlattices in the same way that data for X-ray reflection can be fit. Being able to choose which factors are varied would be helpful as well.
The inplane component of the RelaxationTriangle functions results are always positive! they should depending on the input parameters also give negative values!
So far several important fitting parameters are missing and can not be optimized by the least squares fitting procedure.
A maybe incomplete list of missing parameters:
Just brainstorming/no concrete idea's yet:
consider using the features of the cctbx package http://cctbx.sourceforge.net/ instead of our own material class.
This could enable easier treatment of new materials. of course it should serve as a drop-in replacement of our own solution with extended features for new materials
see http://cctbx.sourceforge.net/current/tour.html as a starting point
Reported by: dkriegner
For performance reasons there are many variants of the ang2q_conversion for point, linear, and area detectors. the respective different functions for point, linear, and area detector however share the same interface to the python code and the variable checking/conversion code should therefore be moved to a common wrapper function!
This should make the code more readable and managable in future!
Reported by: dkriegner
now that we can produce some nice simulations and fit XRR data we should have some screenshots showing this
Reported by: dkriegner
I have just recently discovered xrayutilities, and find it an exceedingly nice package for many purposes.
I do extensive powder diffraction work, and would like to integrate some extra features which would be broadly useful to the powder community. I have developed a pure-python code which implements the Fundamental Parameters Approach to compute peak shapes directly from basic machine and sample parameters. The paper on it is at: Journal of Research of NIST, and the code is provided as ancillary material, accessible at FPA Python Code. I think it would take very little effort for someone to wrap this code so that it fits in under the Powder experiment class as an alternative to the Gaussian convolver. This code includes essentially all currently documented aberrations to the peak shape from instrument geometry, crystal microstructure, and sample properties such as absorption. It is also extensible via simple plugins to handle extra aberrations.
I don't know what the development schedule for new bits of xrayutilities is. I probably do not have time to fully implement the needed wrapper for this, but would be glad to assist with the process.
cross references in documentation do currently not work. it needs to be investigated what it needs for them to be present. I realized that depending on the sphinx version there are cases where the links are present.
Reported by: dkriegner
When upon a structural change of the material the number of distinct peaks is changing the PowderDiffraction instance fails to detect this and will not work correctly in some cases. (specifically when not enough convolvers were predefined upon class creation.
Such cases should be detected and necessary convolvers should be created as needed.
[om, tt], MAP = xu.io.geth5_scan(h5file, 36, 'omega', 'gamma')
this method returns the motor positions in a list, whereas the counter values from the SPEC file are returned as a numpy array which can be indexed by the counter name: MAP['counterName']
is it possible to return the motor positions also as a numpy array, ie. a recarray which can be indexed by the motorname?
Reported by: dschick
currently the use of numpy.matmul restricts the use of older numpy versions. It brings however huge performance improvements.
Reported by: dkriegner
Parsing of chemical formulas would make the definition of Amorphous materials much easier.
e.g.
cofe = xu.materials.Amorphous('CoFe', rho_cofe, [('Co', 0.5), ('Fe', 0.5)])
should be simplified to
cofe = xu.materials.Amorphous('CoFe', rho_cofe)
Reported by: dkriegner
The mentioned routine gives back an error while it seems to work for other people. I am able to open my .edf images via fabIO however.
I am attaching a .zip with the code and an example image. The error I get is as follows
xu.io.EDFFile_Error.zip
:
Traceback (most recent call last):
File "XRD_evaluation_ID9_DK.py", line 80, in
qx, qy, qz, gint, gridder = gridmap(imagenr=1, pathname="./Scan_S6_C3/S6_3K_C3_%04d.edf", stepsize=0.5, start_angle=-10., nx=nx, ny=ny, nz=nz)
File "XRD_evaluation_ID9_DK.py", line 71, in gridmap
qx, qy, qz, intensity = rawmap(imagenr, pathname, stepsize, start_angle)
File "XRD_evaluation_ID9_DK.py", line 52, in rawmap
a = e.data
File "/usr/local/lib/python2.7/dist-packages/xrayutilities/io/edf.py", line 323, in data
self._data[i] = self.ReadData(i)
File "/usr/local/lib/python2.7/dist-packages/xrayutilities/io/edf.py", line 285, in ReadData
% (fmt_str, len(bindata) / tot_nofp))
IOError: XU.io.EDFFile: data format (H) has different byte-length, from amount of data one expects 1 bytes per entry
for better comparison of dynamic and kinematic diffraction models it would be nice to enable the possibility to switch of the use of F(Q) and use only F(hkl)
Reported by: dkriegner
...python2.7/site-packages/xrayutilities/materials/atom.py:66: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if en == "config":
.../python2.7/site-packages/xrayutilities/materials/atom.py:73: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if en == "config":
when en is an array of intensities then the current way of comparing 'en' to have the value 'config' is not correct anymore (change in numpy) and should be replaced by:
if isinstance(en, str) and en == 'config':
pass
Reported by: dkriegner
Hi,
I'm trying to verify my geometry settings and set things up to use the angles from our instrument.
I have a problem when converting from angles back to HKL: Even when I start very close with strict bounds, the fit goes for the limits of the range. Any idea why this is happening? I tried the built-in crystal structure as well as the triclinic one which comes from a SPEC refinement and should work quite well.
import xrayutilities as xu
import matplotlib.pyplot as plt
import numpy as np
# Energy 9keV
en = 9000
# Our sample angles:
# alpha = AOI
# chi (fixed at -90deg, meaning vertical sample)
# omegaV = sample rotation about its normal (leaving L unchanged in a c-cut sample
#
# Detector angles:
# gamma = azimuth (theta-2theta means gamma=2alpha coordinated scan)
# delta = elevation
# direct beam position at gamma, delta = 0
qconv = xu.QConversion(('z+','x+','z-'),('z+','y-'),(1,0,0))
# This matches our setting in SPEC during the last beamtime:
# c-cut sample with omegaV zeroed to the SPEC value
omegavOffset = -44.6
ovx = np.sin(np.deg2rad(omegavOffset))
ovy = np.cos(np.deg2rad(omegavOffset))
hxrd = xu.HXRD(np.array([ovx,ovy,0]),np.array([0,0,1]),en=en,qconv=qconv)
# Built-in data for bcc-Fe
Fe = xu.materials.Fe
# Triclinic cell from the SPEC refinement of our peaks
# (almost cubic of course)
FeTriclinic = xu.materials.Crystal("Fe",\
xu.materials.SGLattice(2, 2.9038,2.8939,2.8823,89.8225,90.0546,90.3348,\
atoms=[xu.materials.e.Fe,xu.materials.e.Fe],pos=['1a','1h']))
# Tetragonal cell for later epitaxy calculations (non-primitive, doubled)
FeTetragonal = xu.materials.Crystal("Fe",\
xu.materials.SGLattice(123,np.sqrt(2)*2.8665,2.8665,\
atoms=[xu.materials.e.Fe,xu.materials.e.Fe,xu.materials.e.Fe],pos=['1a','1c','2e']))
# Primitive bcc unit cell
FeBcc = xu.materials.Crystal("Fe",\
xu.materials.SGLattice(229, 2.8665, atoms=[xu.materials.e.Fe, ], pos=['2a', ]))
# Experimental goniometer angles for (2 0 2)
# The next indexed peak at -90deg sample rotation from there was (0 -2 2)
alp,chi,ov = (4,-90,18.37)
gam,delta = (84.6,25)
# To not print too many digits
def npp( x ):
"print stuff as numpy arrays"
np.set_printoptions(precision=3)
print(np.asarray(x))
np.set_printoptions(precision=8) #reset default
return 0
print('Built-in BCC Fe:')
print('This should be ~ (2 0 2)')
npp(hxrd.Ang2HKL(alp,chi,ov,gam,delta,mat=Fe))
print('This should be ~ (0 -2 2)')
npp(hxrd.Ang2HKL(alp,chi,ov-90,gam,delta,mat=Fe))
print('\nOwn BCC Fe:')
print('This should be ~ (2 0 2)')
npp(hxrd.Ang2HKL(alp,chi,ov,gam,delta,mat=FeBcc))
print('This should be ~ (0 -2 2)')
npp(hxrd.Ang2HKL(alp,chi,ov-90,gam,delta,mat=FeBcc))
print('\nOwn Triclinic Fe:')
print('This should be ~ (2 0 2)')
npp(hxrd.Ang2HKL(alp,chi,ov,gam,delta,mat=FeTriclinic))
print('This should be ~ (0 -2 2)')
npp(hxrd.Ang2HKL(alp,chi,ov-90,gam,delta,mat=FeTriclinic))
print('\nOwn Tetragonal Fe:')
print('This should be ~ (2sqrt2 0 2)')
npp(hxrd.Ang2HKL(alp,chi,ov,gam,delta,mat=FeTetragonal))
print('This should be ~ (0 -2sqrt2 2)')
npp(hxrd.Ang2HKL(alp,chi,ov-90,gam,delta,mat=FeTetragonal))
# Experimental angles at (2 1 1)
alp211 = 5
ov211 = 19.35
gam211 = 53.1
delta211 = 57.8
print('\nExpvalues were:')
npp((alp211, chi, ov211, gam211, delta211))
print('\nThis should be ~ (2 1 1)')
npp(hxrd.Ang2HKL(alp211,chi,ov211,gam211,delta211,mat=Fe))
print('\nBackwards calculation for 5deg AOI, (2 1 1) peak:')
fittedangles, qerror, errcode = xu.q2ang_fit.Q2AngFit(Fe.Q(2,1,1),\
hxrd, bounds = (5, -90, (15, 25), (50,60), (50,60)),\
startvalues = (alp211, chi, ov211, gam211, delta211))
npp(fittedangles)
print('\nCalculating forwards again:')
npp(hxrd.Ang2HKL(*fittedangles,mat=FeTriclinic))
The first tests check out but the results of the last bit are:
Expvalues were:
[ 5. -90. 19.35 53.1 57.8 ]
This should be ~ (2 1 1)
[ 1.97 0.997 1.007]
Backwards calculation for 5deg AOI, (2 1 1) peak:
XU.Q2AngFit: q-error=8.219 with error-code 0 (Optimization terminated successfully.)
[ 5. -90. 25. 50. 50.]
Calculating forwards again:
[ 1.633 1.102 1.135]
Parsing of cif files without included generators should also work and produce a complete Crystal instance including the correct atomic positions
In addition to the calculation of specular reflected intensity also diffusely scattered intensity should be calculated. For this purpose also XRR map calculation should be possible
Reported by: dkriegner
currently including svg images is not working in rst2pdf. rst2pdf-0.93 (last release) also does not support python3 and sphinx >=1.3
Reported by: dkriegner
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.