|
6 | 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
7 | 7 | <tr bgcolor="#7799ee"> |
8 | 8 | <td valign=bottom> <br> |
9 | | -<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="Dans_Diffraction.html"><font color="#ffffff">Dans_Diffraction</font></a>.classes_crystal</strong></big></big> (version 3.2.4)</font></td |
| 9 | +<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="Dans_Diffraction.html"><font color="#ffffff">Dans_Diffraction</font></a>.classes_crystal</strong></big></big> (version 3.3.0)</font></td |
10 | 10 | ><td align=right valign=bottom |
11 | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:c%3A%5Cusers%5Cgrp66007%5Conedrive%20-%20diamond%20light%20source%20ltd%5Cpythonprojects%5Cdans_diffraction%5Cdans_diffraction%5Cclasses_crystal.py">c:\users\grp66007\onedrive - diamond light source ltd\pythonprojects\dans_diffraction\dans_diffraction\classes_crystal.py</a></font></td></tr></table> |
12 | 12 | <p><tt>classes_crystal.py<br> |
|
34 | 34 | Diamond<br> |
35 | 35 | 2017<br> |
36 | 36 | <br> |
37 | | -Version 3.2.4<br> |
38 | | -Last updated: 22/05/23<br> |
| 37 | +Version 3.3.0<br> |
| 38 | +Last updated: 06/02/25<br> |
39 | 39 | <br> |
40 | 40 | Version History:<br> |
41 | 41 | 27/07/17 1.0 Version History started.<br> |
|
59 | 59 | 15/11/21 3.2.2 Added <a href="#Cell">Cell</a>.orientation, updated <a href="#Cell">Cell</a>.UV()<br> |
60 | 60 | 12/01/21 3.2.3 Added <a href="#Symmetry">Symmetry</a>.axial_vector<br> |
61 | 61 | 22/05/23 3.2.4 Added <a href="#Symmetry">Symmetry</a>.wyckoff_label(), <a href="#Symmetry">Symmetry</a>.spacegroup_dict<br> |
| 62 | +06/05/25 3.3.0 <a href="#Symmetry">Symmetry</a>.from_cif now loads operations from find_spacegroup if not already loaded<br> |
62 | 63 | <br> |
63 | 64 | @author: DGPorter</tt></p> |
64 | 65 | <p> |
|
70 | 71 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
71 | 72 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="Dans_Diffraction.functions_crystallography.html">Dans_Diffraction.functions_crystallography</a><br> |
72 | 73 | </td><td width="25%" valign=top><a href="Dans_Diffraction.functions_general.html">Dans_Diffraction.functions_general</a><br> |
| 74 | +</td><td width="25%" valign=top><a href="Dans_Diffraction.functions_lattice.html">Dans_Diffraction.functions_lattice</a><br> |
73 | 75 | </td><td width="25%" valign=top><a href="numpy.html">numpy</a><br> |
74 | | -</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| 76 | +</td></tr></table></td></tr></table><p> |
75 | 77 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
76 | 78 | <tr bgcolor="#ee77aa"> |
77 | 79 | <td colspan=3 valign=bottom> <br> |
|
293 | 295 | <dl><dt><a name="Cell-Bmatrix"><strong>Bmatrix</strong></a>(self)</dt><dd><tt>Calculate the Busing and Levy B matrix from a real space UV<br> |
294 | 296 | "choose the x-axis parallel to a*, the y-axis in the plane of a* and b*, and the z-axis perpendicular to<br> |
295 | 297 | that plane"<br> |
296 | | - W. R. Busing & H. A. Levy, Acta Cryst. (1967). 22, 457</tt></dd></dl> |
| 298 | +W. R. Busing & H. A. Levy, Acta Cryst. (1967). 22, 457</tt></dd></dl> |
297 | 299 |
|
298 | 300 | <dl><dt><a name="Cell-Qmag"><strong>Qmag</strong></a>(self, HKL)</dt><dd><tt>Returns the magnitude of wave-vector transfer of [h,k,l], in A-1<br> |
299 | 301 | :param HKL: list of hkl reflections<br> |
|
334 | 336 | <dl><dt><a name="Cell-calculateR"><strong>calculateR</strong></a>(self, UVW)</dt><dd><tt>Convert coordinates [u,v,w], in the basis of the unit cell, to<br> |
335 | 337 | coordinates [x,y,z], in an orthogonal basis, in units of A<br> |
336 | 338 | R(x,y,z) = uA + vB + wC<br> |
337 | | - <br> |
338 | 339 | E.G.<br> |
339 | 340 | R = <a href="#Cell">Cell</a>.<a href="#Cell-calculateR">calculateR</a>([0.1,0,0]) # for a hexagonal system, a = 2.85<br> |
340 | 341 | > R = array([[0.285, 0, 0]])</tt></dd></dl> |
341 | 342 |
|
| 343 | +<dl><dt><a name="Cell-choose_basis"><strong>choose_basis</strong></a>(self, option='default')</dt><dd><tt>Choose the basis function<br> |
| 344 | +Options:<br> |
| 345 | + 1. c || z, b* || y - basis choice of Materials Project<br> |
| 346 | + 2. a || x, c* || z - basis choice of Vesta<br> |
| 347 | + 3. c || z, a* || x - basis choice of Busing & Levy (Default)<br> |
| 348 | +:param option: name or number of basis</tt></dd></dl> |
| 349 | + |
342 | 350 | <dl><dt><a name="Cell-diff6circle"><strong>diff6circle</strong></a>(self, delta=0, gamma=0, energy_kev=None, wavelength=1.0)</dt><dd><tt>Calcualte wavevector in diffractometer axis using detector angles<br> |
343 | 351 | :param delta: float angle in degrees in vertical direction (about diff-z)<br> |
344 | 352 | :param gamma: float angle in degrees in horizontal direction (about diff-x)<br> |
|
420 | 428 | :param hkl: [3xn] array of (h, k, l) reciprocal lattice vectors<br> |
421 | 429 | :return: [3xn] array of Q vectors in the lab coordinate system</tt></dd></dl> |
422 | 430 |
|
423 | | -<dl><dt><a name="Cell-latt"><strong>latt</strong></a>(self, lattice_parameters=(), *args, **kwargs)</dt><dd><tt>Generate lattice parameters with list<br> |
| 431 | +<dl><dt><a name="Cell-latt"><strong>latt</strong></a>(self, *lattice_parameters, **kwargs)</dt><dd><tt>Generate lattice parameters with list<br> |
424 | 432 | <a href="#Cell-latt">latt</a>(1) -> a=b=c=1,alpha=beta=gamma=90<br> |
425 | 433 | <a href="#Cell-latt">latt</a>([1,2,3]) -> a=1,b=2,c=3,alpha=beta=gamma=90<br> |
426 | 434 | <a href="#Cell-latt">latt</a>([1,2,3,120]) -> a=1,b=2,c=3,alpha=beta=90,gamma=120<br> |
|
444 | 452 | :param hkl: array : list of reflections<br> |
445 | 453 | :return: correction</tt></dd></dl> |
446 | 454 |
|
447 | | -<dl><dt><a name="Cell-reciprocal_space_plane"><strong>reciprocal_space_plane</strong></a>(self, x_axis=[1, 0, 0], y_axis=[0, 1, 0], centre=[0, 0, 0], q_max=4.0, cut_width=0.05)</dt><dd><tt>Returns positions within a reciprocal space plane<br> |
| 455 | +<dl><dt><a name="Cell-reciprocal_space_plane"><strong>reciprocal_space_plane</strong></a>(self, x_axis=(1, 0, 0), y_axis=(0, 1, 0), centre=(0, 0, 0), q_max=4.0, cut_width=0.05)</dt><dd><tt>Returns positions within a reciprocal space plane<br> |
448 | 456 | x_axis = direction along x, in units of the reciprocal lattice (hkl)<br> |
449 | 457 | y_axis = direction along y, in units of the reciprocal lattice (hkl)<br> |
450 | 458 | centre = centre of the plot, in units of the reciprocal lattice (hkl)<br> |
|
607 | 615 | :param mxmymz: array : atomic magnetic vectors [mu,mv,mw]<br> |
608 | 616 | :return: None</tt></dd></dl> |
609 | 617 |
|
610 | | -<dl><dt><a name="Crystal-new_cell"><strong>new_cell</strong></a>(self, lattice_parameters=(), *args, **kwargs)</dt><dd><tt>Replace the lattice parameters<br> |
| 618 | +<dl><dt><a name="Crystal-new_cell"><strong>new_cell</strong></a>(self, *lattice_parameters, **kwargs)</dt><dd><tt>Replace the lattice parameters<br> |
611 | 619 | :param lattice_parameters: [a,b,c,alpha,beta,gamma]<br> |
612 | 620 | :return: None</tt></dd></dl> |
613 | 621 |
|
| 622 | +<dl><dt><a name="Crystal-search_distances"><strong>search_distances</strong></a>(self, min_d=0.65, max_d=3.2, c_ele=None, elems=None, labels=None, simple=True)</dt><dd><tt>Calculated atoms interatomic distances form each label.<br> |
| 623 | +:param c_ele (list,string): only sites with noted elements<br> |
| 624 | + if None all site<br> |
| 625 | +:param elems (list,string): only distances with noted elements<br> |
| 626 | + if None all site<br> |
| 627 | +:param min_d: minimum distance <br> |
| 628 | +:param max_d: maximum distance<br> |
| 629 | +:return dictionary:</tt></dd></dl> |
| 630 | + |
614 | 631 | <dl><dt><a name="Crystal-start_gui"><strong>start_gui</strong></a>(self)</dt><dd><tt>Start <a href="#Crystal">Crystal</a> GUI<br> |
615 | 632 | :return: None</tt></dd></dl> |
616 | 633 |
|
|
799 | 816 | :param mxmymz: array : atomic magnetic vectors [mu,mv,mw]<br> |
800 | 817 | :return: None</tt></dd></dl> |
801 | 818 |
|
802 | | -<dl><dt><a name="Superstructure-new_cell"><strong>new_cell</strong></a>(self, lattice_parameters=(), *args, **kwargs)</dt><dd><tt>Replace the lattice parameters<br> |
| 819 | +<dl><dt><a name="Superstructure-new_cell"><strong>new_cell</strong></a>(self, *lattice_parameters, **kwargs)</dt><dd><tt>Replace the lattice parameters<br> |
803 | 820 | :param lattice_parameters: [a,b,c,alpha,beta,gamma]<br> |
804 | 821 | :return: None</tt></dd></dl> |
805 | 822 |
|
| 823 | +<dl><dt><a name="Superstructure-search_distances"><strong>search_distances</strong></a>(self, min_d=0.65, max_d=3.2, c_ele=None, elems=None, labels=None, simple=True)</dt><dd><tt>Calculated atoms interatomic distances form each label.<br> |
| 824 | +:param c_ele (list,string): only sites with noted elements<br> |
| 825 | + if None all site<br> |
| 826 | +:param elems (list,string): only distances with noted elements<br> |
| 827 | + if None all site<br> |
| 828 | +:param min_d: minimum distance <br> |
| 829 | +:param max_d: maximum distance<br> |
| 830 | +:return dictionary:</tt></dd></dl> |
| 831 | + |
806 | 832 | <dl><dt><a name="Superstructure-start_gui"><strong>start_gui</strong></a>(self)</dt><dd><tt>Start <a href="#Crystal">Crystal</a> GUI<br> |
807 | 833 | :return: None</tt></dd></dl> |
808 | 834 |
|
|
0 commit comments