Skip to content

DunstanBecht/lpa-xrd

Repository files navigation

DOI License: CC0-1.0


Mines Saint-Etienne

Line Profile Analysis - X-Ray Diffraction

This project is related to the analysis of crystals containing dislocations by X-ray diffraction. It was developed and used for a study conducted during a research internship at the laboratory of material and structural sciences of the École Nationale Supérieure des Mines de Saint-Étienne. This repository contains the distribution of one of the three published python packages that have been proposed to conduct line profile analyses based on simulation results:

  • lpa-input (line profile analysis input generator)
  • lpa-xrd (line profile analysis x-ray diffraction simulation program)
  • lpa-output (line profile analysis output analyzer)

The repository lpa-workspace contains the parameters and the scripts for the generation of the data used in the study. You can then easily replicate the results obtained or use it as inspiration to take the code in hand and conduct your own calculations. The software is placed in the public domain and you can use it as you wish. However, users are encouraged to contribute to the development and report issues.

Features

The package lpa.xrd can be used to:

  • make a local copy of the X-ray diffraction simulator code
  • automate the tasks of compilations and executions

Installation

The package is indexed on PyPI and installable directly via pip:

pip install -U lpa-xrd

Examples

Output data files

   1.0.0 # v: lpa-xrd version
5.00e+13 # d: dislocation density [m^-2]
 1  1  0 # z: direction of 'l' (line vector) [uvw]
 1  1  0 # b: Burgers vector direction [uvw]
 2  0  0 # g: diffraction vector direction (hkl)
0.250000 # C: contrast coefficient [1]
0.404600 # a: cell parameter [nm]
    3200 # s: side of the region of interest [nm]
0.345000 # nu: Poisson's number [1]
    4608 # nd: number of dislocations in the input file
  200000 # np: number of random points
#    L                   cos1       err_cos1                   sin1       err_sin1                   cos2       err_cos2                   sin2       err_sin2                   cos3       err_cos3                   sin3       err_sin3                   cos4       err_cos4                   sin4       err_sin4                   cos5       err_cos5                   sin5       err_sin5                   eps2       nrpo
   5.0  9.919780130050152E-01  9.7694405E-05  4.649751351202615E-02  2.4401673E-04  9.718584161805875E-01  1.8592315E-04  9.122464362090398E-02  4.4864260E-04  9.416076235866173E-01  2.8748026E-04  1.329066527551777E-01  6.2921540E-04  9.028444599229754E-01  3.9678622E-04  1.709151124821277E-01  7.8794931E-04  8.573342759258576E-01  5.0992929E-04  2.044546944647581E-01  9.2512636E-04  2.845523399565078E-05          0
  10.0  9.710121708440832E-01  2.0278255E-04  9.116575916950630E-02  4.5055666E-04  9.021774943746688E-01  4.0288039E-04  1.707146134209013E-01  7.8889338E-04  8.056001607624746E-01  6.3151908E-04  2.328566641373228E-01  1.0416918E-03  6.927731828272842E-01  8.5946732E-04  2.748280712141710E-01  1.2181959E-03  5.742201959831477E-01  1.0648126E-03  2.962318625026029E-01  1.3337083E-03  2.617600870330373E-05          0
  15.0  9.395445834614645E-01  3.1299194E-04  1.327871325064340E-01  6.3257909E-04  8.046734338889502E-01  6.3674889E-04  2.326487626980035E-01  1.0423216E-03  6.327588009897309E-01  9.6786160E-04  2.874622559208860E-01  1.2838090E-03  4.571775204982404E-01  1.2389300E-03  2.983695306858330E-01  1.4053084E-03  3.005082344656380E-01  1.4261736E-03  2.740638215115847E-01  1.4625214E-03  2.481141516583650E-05          0
  20.0  8.993436301724801E-01  4.2723083E-04  1.704071187402802E-01  7.9258445E-04  6.906480375231716E-01  8.6683762E-04  2.737961837849355E-01  1.2201674E-03  4.559003177641861E-01  1.2406425E-03  2.975801405205130E-01  1.4067085E-03  2.545509049349202E-01  1.4701520E-03  2.599099636430895E-01  1.4754416E-03  1.129192720943877E-01  1.5695090E-03  1.897256354854598E-01  1.5142432E-03  2.373505031216241E-05          0
  25.0  8.516614476030940E-01  5.4780190E-04  2.033546680843503E-01  9.3086906E-04  5.706886117215826E-01  1.0738353E-03  2.942115140982540E-01  1.3362870E-03  2.987234196066947E-01  1.4270872E-03  2.729380237755982E-01  1.4645098E-03  1.126175894290291E-01  1.5691999E-03  1.896567626737299E-01  1.5147189E-03  1.891169892405472E-02  1.5817794E-03  9.567064471795843E-02  1.5653900E-03  2.304178934627635E-05          0
  30.0  7.985247260772457E-01  6.6747584E-04  2.311286397025575E-01  1.0484144E-03  4.534921843382094E-01  1.2452935E-03  2.958800622688820E-01  1.4082830E-03  1.742423031865108E-01  1.5340841E-03  2.259746945032075E-01  1.4964907E-03  3.160954643341109E-02  1.5843732E-03  1.135856338875382E-01  1.5557255E-03 -6.130215023255015E-03  1.5650907E-03  2.531599523454267E-02  1.5959710E-03  2.244421905092251E-05          0
  35.0  7.410752464481675E-01  7.8651089E-04  2.534921772801799E-01  1.1463665E-03  3.458235540618880E-01  1.3782516E-03  2.821306910401114E-01  1.4506841E-03  8.595612424579292E-02  1.5784296E-03  1.693521980523827E-01  1.5258575E-03 -9.849516565701470E-04  1.5698693E-03  4.926418775735411E-02  1.5885199E-03  2.294348308628428E-04  1.5724518E-03 -1.084062333821490E-02  1.5896014E-03  2.195849122361079E-05          0
  40.0  6.815209458298868E-01  8.9840727E-04  2.703528545906205E-01  1.2268124E-03  2.517942315088739E-01  1.4736698E-03  2.568075447362318E-01  1.4770128E-03  3.076184110428900E-02  1.5843507E-03  1.121636192027453E-01  1.5563492E-03 -4.522635176754295E-03  1.5664373E-03  6.521320715162537E-03  1.5956141E-03  1.045383752828092E-02  1.5808535E-03 -1.840794717875087E-02  1.5807234E-03  2.150926463836787E-05          0
  45.0  6.205081267878839E-01  1.0036404E-03  2.819421287855753E-01  1.2923277E-03  1.729762404668073E-01  1.5364053E-03  2.236241440863359E-01  1.4966092E-03  3.202768282748670E-03  1.5736270E-03  6.235483267653156E-02  1.5824763E-03  4.053287403694522E-03  1.5747902E-03 -1.438970403956044E-02  1.5871179E-03  1.079189490770739E-02  1.5767568E-03 -1.108314471022998E-02  1.5851392E-03  2.113891121012931E-05          0
  50.0  5.594670074739783E-01  1.1005490E-03  2.886193711632470E-01  1.3443529E-03  1.104874688401281E-01  1.5706706E-03  1.858408505746260E-01  1.5163431E-03 -5.179008050301716E-03  1.5663271E-03  2.406090540928068E-02  1.5948717E-03  1.121242109009753E-02  1.5812539E-03 -1.845548000493876E-02  1.5802941E-03  7.912953489862166E-04  1.5628750E-03 -4.302837063839781E-03  1.5991720E-03  2.079771440621235E-05          0
  55.0  4.995902029814044E-01  1.1876543E-03  2.906542938103523E-01  1.3853312E-03  6.338698402136406E-02  1.5845386E-03  1.469719101610804E-01  1.5366094E-03 -2.830915220094076E-03  1.5680732E-03 -6.420790546988258E-04  1.5940920E-03  1.233584141396622E-02  1.5788623E-03 -1.355478062944766E-02  1.5828896E-03 -1.141018755317326E-02  1.5533821E-03 -7.710223191642077E-03  1.6081296E-03  2.047828020338118E-05          0
  60.0  4.415649753904912E-01  1.2659647E-03  2.884823399334340E-01  1.4164544E-03  3.102270489207339E-02  1.5844300E-03  1.096466167553907E-01  1.5571391E-03  4.107535133823420E-03  1.5744518E-03 -1.401578846341889E-02  1.5874697E-03  6.087210967641720E-03  1.5694964E-03 -7.397357626631275E-03  1.5925600E-03 -1.779380135356151E-02  1.5608504E-03 -2.076727927767695E-02  1.6000099E-03  2.020392906852112E-05          0
  65.0  3.859926997678325E-01  1.3345502E-03  2.826844995962349E-01  1.4403092E-03  1.038688189774781E-02  1.5781251E-03  7.545084355107248E-02  1.5749737E-03  1.055190287167328E-02  1.5798766E-03 -1.788215325916730E-02  1.5817267E-03 -3.597621905334611E-03  1.5562005E-03 -5.880120098377285E-03  1.6056237E-03 -1.643029116421317E-02  1.5716395E-03 -3.336288063489704E-02  1.5884140E-03  1.993672809657496E-05          0
  70.0  3.335118445855593E-01  1.3940669E-03  2.737684723141243E-01  1.4579785E-03 -1.746234114881926E-04  1.5711556E-03  4.610545783989257E-02  1.5877236E-03  1.363050227403528E-02  1.5808353E-03 -1.587683218086774E-02  1.5807579E-03 -1.259292872532142E-02  1.5519088E-03 -1.106016580883529E-02  1.6094097E-03 -9.740845332860780E-03  1.5781832E-03 -3.860399640620505E-02  1.5815931E-03  1.968736667616888E-05          0
  75.0  2.845890088672144E-01  1.4442689E-03  2.622243738658244E-01  1.4715115E-03 -3.657296323005920E-03  1.5670730E-03  2.222981118571182E-02  1.5942928E-03  1.255201775676720E-02  1.5770069E-03 -1.099032277908083E-02  1.5848288E-03 -1.769105659807612E-02  1.5599496E-03 -2.119594972366435E-02  1.6008657E-03 -3.316791276953404E-03  1.5812253E-03 -3.564819631071586E-02  1.5790321E-03  1.945611974399867E-05          0
  80.0  2.395326112795399E-01  1.4855214E-03  2.484680988967788E-01  1.4824597E-03 -2.543158707542895E-03  1.5671422E-03  3.973955960801674E-03  1.5949856E-03  7.328912535048060E-03  1.5686584E-03 -6.301465648727153E-03  1.5933828E-03 -1.761813428921810E-02  1.5699016E-03 -3.155266699673362E-02  1.5902529E-03  8.461035716029134E-04  1.5821195E-03 -2.607090436462123E-02  1.5790887E-03  1.923637169320791E-05          0
  85.0  1.982958519653960E-01  1.5187390E-03  2.326508290923389E-01  1.4920511E-03  1.265081142491911E-03  1.5709874E-03 -8.491219189330473E-03  1.5911175E-03 -5.611909956703896E-04  1.5592935E-03 -4.278488152591983E-03  1.6026651E-03 -1.280111149009435E-02  1.5770681E-03 -3.802891127894834E-02  1.5826657E-03  3.160716736166042E-04  1.5836254E-03 -1.403684161203870E-02  1.5783440E-03  1.903541294997870E-05          0
  90.0  1.612525459591669E-01  1.5442451E-03  2.152976085786621E-01  1.5011839E-03  5.877115862159625E-03  1.5755992E-03 -1.596723945322631E-02  1.5862108E-03 -8.299018475498654E-03  1.5536870E-03 -5.527210084167680E-03  1.6079753E-03 -6.930744401338407E-03  1.5817438E-03 -3.929606344593451E-02  1.5780210E-03 -4.543466276893127E-03  1.5852970E-03 -2.762873799848069E-03  1.5769328E-03  1.884278612317125E-05          0
  95.0  1.282112990020728E-01  1.5633002E-03  1.967155308632580E-01  1.5101127E-03  1.043437104467520E-02  1.5799302E-03 -1.917403962229908E-02  1.5816014E-03 -1.463162313686160E-02  1.5545738E-03 -1.074262076372700E-02  1.6067600E-03 -1.315469395420639E-03  1.5831097E-03 -3.545641178784738E-02  1.5771792E-03 -1.092554401651496E-02  1.5826908E-03  4.816844993938320E-03  1.5793676E-03  1.866203035415159E-05          0
 100.0  9.959314909173192E-02  1.5763379E-03  1.773985343642243E-01  1.5192885E-03  1.376913835841935E-02  1.5827978E-03 -1.873343761342664E-02  1.5786302E-03 -1.884676883469437E-02  1.5597696E-03 -1.869841214751276E-02  1.6011307E-03  2.473732586373747E-03  1.5830942E-03 -2.702626411355061E-02  1.5780225E-03 -2.000138784164228E-02  1.5814200E-03  8.076104806501708E-03  1.5801296E-03  1.848810043887355E-05          0
 105.0  7.492515728454675E-02  1.5847344E-03  1.577960199255670E-01  1.5284221E-03  1.577581123602416E-02  1.5823329E-03 -1.600850955128734E-02  1.5791522E-03 -1.943005403695166E-02  1.5684756E-03 -2.775313389757126E-02  1.5919078E-03  2.003725983858416E-03  1.5846194E-03 -1.685875121343024E-02  1.5772017E-03 -2.863940628242954E-02  1.5807826E-03  5.263521008775164E-03  1.5801620E-03  1.832668599560836E-05          0
 110.0  5.387901307910824E-02  1.5888214E-03  1.383079244403231E-01  1.5380218E-03  1.554217273324296E-02  1.5800659E-03 -1.201372134297731E-02  1.5816090E-03 -1.617783247565431E-02  1.5763954E-03 -3.500416936210113E-02  1.5835301E-03 -8.785164039581190E-04  1.5870743E-03 -6.503834327715480E-03  1.5751206E-03 -3.427874947650209E-02  1.5775908E-03 -3.245359119824111E-03  1.5828154E-03  1.817181812275684E-05          0
 115.0  3.664664804552439E-02  1.5890681E-03  1.192000745638934E-01  1.5482665E-03  1.273585500168861E-02  1.5761517E-03 -7.860718063676213E-03  1.5857651E-03 -1.035325801829374E-02  1.5811673E-03 -3.952065878469124E-02  1.5784770E-03 -5.978935991356900E-03  1.5844021E-03  2.220319114352040E-03  1.5778123E-03 -3.284382342785040E-02  1.5763638E-03 -1.278934098649472E-02  1.5839478E-03  1.802149836603412E-05          0
 120.0  2.267475187895469E-02  1.5870685E-03  1.007818559717982E-01  1.5581665E-03  8.537805138971058E-03  1.5707438E-03 -4.330668164237631E-03  1.5913299E-03 -4.099858553905379E-03  1.5818447E-03 -4.036912792480702E-02  1.5778340E-03 -1.296473682568716E-02  1.5832761E-03  7.766120774671626E-03  1.5786449E-03 -2.564418278471131E-02  1.5788786E-03 -1.825211916513501E-02  1.5818386E-03  1.788089337917736E-05          0
 125.0  1.190286127740707E-02  1.5832084E-03  8.304490697993464E-02  1.5678920E-03  2.897926087346033E-03  1.5652379E-03 -2.020276444306553E-03  1.5968697E-03  1.590219895493123E-03  1.5818388E-03 -3.784760155519840E-02  1.5781749E-03 -2.000022089405814E-02  1.5831335E-03  9.304973544805110E-03  1.5783790E-03 -1.534394166752527E-02  1.5834564E-03 -1.939828580840173E-02  1.5778568E-03  1.774492292646695E-05          0
 130.0  3.807211878475745E-03  1.5781473E-03  6.637256567826624E-02  1.5771420E-03 -3.756414511098720E-03  1.5604430E-03 -1.184299394918682E-03  1.6015508E-03  5.342312616717334E-03  1.5821894E-03 -3.224181504804660E-02  1.5784047E-03 -2.598367874583192E-02  1.5828914E-03  6.997921055755023E-03  1.5782457E-03 -5.681677001787565E-03  1.5844150E-03 -1.544660924847807E-02  1.5774345E-03  1.761680336006850E-05          0
 135.0 -1.909208115959259E-03  1.5726811E-03  5.070053279864655E-02  1.5855056E-03 -1.066726377099978E-02  1.5566132E-03 -2.542505501762969E-03  1.6051102E-03  6.540217270484781E-03  1.5842874E-03 -2.493962057398943E-02  1.5769384E-03 -3.055934125118156E-02  1.5807860E-03  1.491041153865881E-03  1.5800190E-03 -1.885899470757636E-04  1.5807945E-03 -1.005470676961577E-02  1.5813311E-03  1.748434506050901E-05          0
 140.0 -5.662657734737501E-03  1.5680042E-03  3.668189862462734E-02  1.5920112E-03 -1.648588708717751E-02  1.5549157E-03 -6.001264195804602E-03  1.6064629E-03  4.927507072618795E-03  1.5852091E-03 -1.770167087437136E-02  1.5765307E-03 -3.235607121551773E-02  1.5784983E-03 -5.449399766414424E-03  1.5820825E-03  1.300516520241499E-03  1.5809818E-03 -6.107671404477703E-03  1.5812421E-03  1.735916714236917E-05          0
 145.0 -7.578744489184322E-03  1.5646040E-03  2.404345553293039E-02  1.5965155E-03 -2.069579457592526E-02  1.5565722E-03 -1.133551641180289E-02  1.6044700E-03  2.316668700462364E-03  1.5845456E-03 -1.044493609317209E-02  1.5775513E-03 -2.998136846104535E-02  1.5766117E-03 -1.235649195949234E-02  1.5840021E-03  2.162202556195563E-03  1.5862384E-03 -4.174327774508281E-03  1.5759956E-03  1.724154351165089E-05          0
 150.0 -7.812855152604117E-03  1.5624565E-03  1.315034451760286E-02  1.5992450E-03 -2.337463792883914E-02  1.5611062E-03 -1.770418990290372E-02  1.5995854E-03 -2.124808894344471E-03  1.5829743E-03 -4.024227437188634E-03  1.5792764E-03 -2.409107897390648E-02  1.5789434E-03 -1.718001037741835E-02  1.5819561E-03  2.608488962371413E-03  1.5892159E-03 -1.467238277730306E-03  1.5730140E-03  1.712660040558190E-05          0

Abbreviations

Some abbreviations are used in the column names:

  • cos<j> estimator of the mean cos coefficients of the Fourier transform, harmonic <j>
  • cos<j> estimator of the mean sin coefficients of the Fourier transform, harmonic <j>
  • err_cos<j> estimator of the standard deviation of the cos coefficients mean (standard error), harmonic <j>
  • err_sin<j> estimator of the standard deviation of the sin coefficients mean (standard error), harmonic <j>
  • eps2 estimator of the mean square strain
  • nrpo number of random points outside the region of interest for the current value of L

User guide

It is necessary to install the NVIDIA CUDA Toolkit to compile the OpenCL code on NVIDIA GPUs.

The directory tests/ contains several examples of package module usage. To become familiar with the use of these modules you should go through these scripts in the following order:

  • test_code.py
  • test_run.py

In the sources the docstrings are carefully written and it is recommended to refer to the documentation with the help() python command to list the available functions, classes and parameters.

The installation from PyPI does not allow the modification of the code. To edit the package and contribute to the development use the following commands in your working directory.

pip uninstall lpa-xrd
git clone https://github.com/DunstanBecht/lpa-xrd.git
pip install -e lpa-xrd
cd lpa-xrd
git branch <name_of_your_new_branch>