{ "info": { "author": "Dan Porter", "author_email": "d.g.porter@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.7" ], "description": "# Dans_Diffaction\nReads crystallographic cif files and simulates diffraction\n\n**Version 1.x**\n\nBy Dan Porter, Diamond Light Source\n2018\n\n#### TL;DR:\n```text\n$ ipython -i -m Dans_Diffraction\n```\n\n```python\nimport Dans_Diffraction as dif\nxtl = dif.Crystal('some_file.cif')\nxtl.info() # print Crystal structure parameters\n\n# Print reflection list:\nprint(xtl.Scatter.print_all_reflections(energy_kev=5)) \n\n# Plot Powder pattern:\nxtl.Plot.simulate_powder(energy_kev=8)\nplt.show()\n\n# Start graphical user interface:\nxtl.start_gui()\n```\n\nFor comments, queries or bugs - email dan.porter@diamond.ac.uk\n\n# Installation\n**Requirements:** \nPython 2.8+/3+ with packages: *Numpy*, *Matplotlib*, *Scipy*, *Tkinter*\n\nStable version from PyPI:\n```text\n$ pip install Dans-Diffraction\n```\n\nLatest version from GitHub:\n```text\n$ git clone https://github.com/DanPorter/Dans_Diffraction.git\n```\n\n# Operation\nDans_Diffraction is best run within an interactive python environment:\n```text\n$ ipython -i -m Dans_Diffraction\n```\n\nDans_Diffraction can also be run in scripts as an import, example scripts are provided in the [Examples](Examples) folder.\n### Read CIF file\n```python\nimport Dans_Diffraction as dif\nxtl = dif.Crystal('some_file.cif')\nxtl.info() # print Crystal structure parameters\n```\n\n### Alter atomic positions\n```python\nxtl.Cell.latt([2.85,2.85,10.8,90,90,120]) # set lattice parameters\nxtl.Atoms.info() # Print Symmetric positions\nxtl.Structure.info() # Print All positions in P1 symmetry (same structure and functions as xtl.Atoms)\n# Symmetric positions\nxtl.Atoms.changeatom(idx=0, u=0, v=0, w=0, type='Co', label='Co1')\nxtl.Atoms.addatom(idx=0, u=0, v=0, w=0, type='Co', label='Co1')\n# After adding or changing an atom in the Atoms class, re-generate the full structure using symmetry arguments:\nxtl.generate_lattice()\n# Full atomic structure in P1 symmetry\nxtl.Structure.changeatom(idx=0, u=0, v=0, w=0, type='Co', label='Co1')\nxtl.Structure.addatom(idx=0, u=0, v=0, w=0, type='Co', label='Co1')\n# Plot crystal Structure\nxtl.Plot.plot_crystal() # 3D plot\nxtl.Plot.plot_layers() # 2D plot for layered materials\n```\n![3D Plot](Screenshots/3Dstructrue_Ca3CoMnO6.png)\n\n\n### Alter crystal symmetry\n```python\nxtl.Symmetry.info() # print symmetry arguments\nxtl.Symmetry.addsym('x,y,z+1/2') # adds single symmetry operation\nxtl.Symmetry.changesym(0, 'x,y,z+1/4')\n# After adding or changing symmetry operations, regengerate the symmetry matrices\nxtl.Symmetry.generate_matrices()\n```\n\n### Calculate Structure Factors\nX-ray or neutron structure factors/ intensities are calculated based on the full unit cell structure, including atomic \nform-factors (x-rays) or coherent scattering lengths (neutrons).\n```python\n# Choose scattering options (see help(xtl.Scatter.setup_scatter))\nxtl.Scatter.setup_scatter(type='x-ray', energy_keV=8.0)\n# Allowed radiation types:\n# 'xray','neutron','xray magnetic','neutron magnetic','xray resonant'\nxtl.intensity([h,k,l]) # Returns intensity\nxtl.print_all_refelctions() # Returns formated string of all allowed reflections\n# Plot Experimental Intensities\nxtl.Plot.simulate_powder() # Powder pattern\nxtl.Plot.simulate_hk0() # Reciprocal space plane\n```\n![Powder Pattern](Screenshots/powder_diamond.png)\n![HK0 Simulation](Screenshots/supercell_diffraction.png)\n\nMagnetic scattering is also available for neutrons and x-rays (both resonant and non-resonant), using the appropriate magnetic form-factors.\n```python\nImag = xtl.Scatter.magnetic_neutron(HKL=[0,0,3])\nIres = xtl.Scatter.xray_resonant_magnetic(HKL=[0,0,3], energy_kev=2.838, azim_zero=[1, 0, 0], psi=0, polarisation='s-p', F0=0, F1=1, F2=0)\n```\n\n### Properties\nThe Crystal class contains a lot of atomic properties that can be exposed in the Properties class:\n```python\nxtl.Properties.info()\n```\n\nAll the properties are stored in the folder Dans_Diffraction/data.\n\n### Superstructures\nSuperstructures can be built using the Superstructure class, requring only a matrix to define the new phase:\n```python\nsu = xtl.generate_superstructrue([[2,0,0],[0,2,0],[0,0,1]])\n```\n\nSuperstucture classes behave like Crystal classes, but have an additional 'Parent' property that references the original \ncrystal structure and additional behaviours partiular to superstructures.\n\n```python\nsu.parent.info() # Parent structure\nsu.P # superstructure matrix \n```\n\n### Graphical Front End\n![All GUI elements](Screenshots/GUI_all.png)\n\nStart a new GUI, then select a cif file:\n```python\ndif.Startgui()\n```\nUsing an already generated crystal:\n```python\nxtl.start_gui()\n```\n\n### FDMNES functionality\nFDMNES is a powerful tool for simulating resonant x-ray diffraction, created by [Y. Joly and O. Bunau.](http://neel.cnrs.fr/spip.php?rubrique1007&lang=en)\n\nThe Dans_Diffraction FDMNES class allows for the automatic creation of input files and simple analysis of results.\nThe following command should be used to activate these features (only needs to be issued once). \n```python\ndif.activate_fdmnes()\n```\nOnce activated, the FDMNES classes become available.\n```python\nfdm = dif.Fdmnes(xtl) # Create input files and run FDMNES\nfdma = dif.FdmnesAnalysis(output_path, output_name) # Load output files and plot results\n```\nSee class documentation for more information.\n\n\nOnce activated, FDMNES GUI elements become available from the main window, emulating functionality of the classes.\n\n![FDMNES Run](Screenshots/GUI_08.png)\n![FDMNES Analyse](Screenshots/GUI_09.png)\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/DanPorter/Dans_Diffraction/archive/0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/DanPorter/Dans_Diffraction", "keywords": "crystal,cif,diffraction,crystallography,science,x-ray,neutron,resonant,magnetic,magnetism", "license": "", "maintainer": "", "maintainer_email": "", "name": "Dans-Diffraction", "package_url": "https://pypi.org/project/Dans-Diffraction/", "platform": "", "project_url": "https://pypi.org/project/Dans-Diffraction/", "project_urls": { "Download": "https://github.com/DanPorter/Dans_Diffraction/archive/0.1.tar.gz", "Homepage": "https://github.com/DanPorter/Dans_Diffraction" }, "release_url": "https://pypi.org/project/Dans-Diffraction/1.4.0/", "requires_dist": [ "numpy", "matplotlib", "scipy" ], "requires_python": "", "summary": "Generate diffracted intensities from crystals", "version": "1.4.0" }, "last_serial": 5531963, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f12adba6469fe6ce11fdab28cb503a34", "sha256": "ba7787a1669617f543f38f565c6a577514855b7099a6cf646c5656214616f575" }, "downloads": -1, "filename": "Dans_Diffraction-1.0.0.zip", "has_sig": false, "md5_digest": "f12adba6469fe6ce11fdab28cb503a34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2022415, "upload_time": "2018-03-19T14:16:26", "url": "https://files.pythonhosted.org/packages/7a/e2/c6c9d5339b92cb73eac638f707aeddaddc46132619a61211a03c7432c129/Dans_Diffraction-1.0.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "de64e4eb88b43b0e3f8bc9ae50af8183", "sha256": "8382d93507fa47f9cddf2ea14202d86b8473677f68e62f38e9123f34f5d36cb1" }, "downloads": -1, "filename": "Dans_Diffraction-1.0.1.zip", "has_sig": false, "md5_digest": "de64e4eb88b43b0e3f8bc9ae50af8183", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2029531, "upload_time": "2018-05-24T08:07:24", "url": "https://files.pythonhosted.org/packages/09/c4/cf6887df9780863e0e169a61fb2d92afb3a256cf8302e80b3629fccc132d/Dans_Diffraction-1.0.1.zip" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "1403b9d0974d1c6e1742975ff23f3c39", "sha256": "47fd008efd15c16d540c9e7f02dfc8e94fe0f5177124d484041ba9dcbdf73622" }, "downloads": -1, "filename": "Dans_Diffraction-1.3.0.tar.gz", "has_sig": false, "md5_digest": "1403b9d0974d1c6e1742975ff23f3c39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1981166, "upload_time": "2019-02-23T14:15:25", "url": "https://files.pythonhosted.org/packages/05/12/f4d0f84ac14ecf51bf0894cfe7071d59e5d4e9ae79e5ea1b22760a76792c/Dans_Diffraction-1.3.0.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "aa5b4b77a4ef0060ab35b46873032728", "sha256": "20e9ca36cee040a7070d07986422a80f51c5a69e9aefbab5bfefe9bd79c8100b" }, "downloads": -1, "filename": "Dans_Diffraction-1.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "aa5b4b77a4ef0060ab35b46873032728", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2055962, "upload_time": "2019-07-14T20:25:13", "url": "https://files.pythonhosted.org/packages/89/c4/19217793a8a19057947f8b347e8d4d171ccc77be64e1ee4a7518a5c05797/Dans_Diffraction-1.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7eb1f5fd054743d6afb40d714ea8c94c", "sha256": "f7720876ab63067e687c9176ef8521401500b870ebd8f5764e1ee79f080deb63" }, "downloads": -1, "filename": "Dans_Diffraction-1.4.0.tar.gz", "has_sig": false, "md5_digest": "7eb1f5fd054743d6afb40d714ea8c94c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1993623, "upload_time": "2019-07-14T20:25:18", "url": "https://files.pythonhosted.org/packages/db/f3/a5a4b59ef9379e29b509303e18155f2cc65fac8b9ad4fc22fd0c495bbd7f/Dans_Diffraction-1.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa5b4b77a4ef0060ab35b46873032728", "sha256": "20e9ca36cee040a7070d07986422a80f51c5a69e9aefbab5bfefe9bd79c8100b" }, "downloads": -1, "filename": "Dans_Diffraction-1.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "aa5b4b77a4ef0060ab35b46873032728", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2055962, "upload_time": "2019-07-14T20:25:13", "url": "https://files.pythonhosted.org/packages/89/c4/19217793a8a19057947f8b347e8d4d171ccc77be64e1ee4a7518a5c05797/Dans_Diffraction-1.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7eb1f5fd054743d6afb40d714ea8c94c", "sha256": "f7720876ab63067e687c9176ef8521401500b870ebd8f5764e1ee79f080deb63" }, "downloads": -1, "filename": "Dans_Diffraction-1.4.0.tar.gz", "has_sig": false, "md5_digest": "7eb1f5fd054743d6afb40d714ea8c94c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1993623, "upload_time": "2019-07-14T20:25:18", "url": "https://files.pythonhosted.org/packages/db/f3/a5a4b59ef9379e29b509303e18155f2cc65fac8b9ad4fc22fd0c495bbd7f/Dans_Diffraction-1.4.0.tar.gz" } ] }