Skip to content

Commit

Permalink
Merge pull request #29 from dnjohnstone/v0.10.0
Browse files Browse the repository at this point in the history
V0.10.0
  • Loading branch information
dnjohnstone authored Nov 9, 2019
2 parents ff3c33e + ee15ea7 commit cb158d5
Show file tree
Hide file tree
Showing 8 changed files with 2,320 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This functionaility has been checked to run in pyxem-0.9.0 (July 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
"This functionaility has been checked to run in pyxem-0.10.0 (November 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
]
},
{
Expand Down Expand Up @@ -246,7 +246,8 @@
"metadata": {},
"outputs": [],
"source": [
"dp.center_direct_beam(radius_start=2,\n",
"dp.center_direct_beam(method='cross_correlate',\n",
" radius_start=2,\n",
" radius_finish=5,\n",
" square_width=10)"
]
Expand Down
44 changes: 13 additions & 31 deletions 02 GaAs Nanowire - Phase Mapping - Orientation Mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This functionaility has been checked to run in pyxem-0.9.0 (July 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
"This functionaility has been checked to run in pyxem-0.10.0 (November 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
]
},
{
Expand Down Expand Up @@ -302,9 +302,10 @@
"metadata": {},
"outputs": [],
"source": [
"from diffsims.generators.structure_library_generator import StructureLibraryGenerator\n",
"from diffsims.libraries.structure_library import StructureLibrary\n",
"from diffsims.generators.diffraction_generator import DiffractionGenerator\n",
"from diffsims.generators.library_generator import DiffractionLibraryGenerator\n",
"from diffsims.utils.sim_utils import rotation_list_stereographic\n",
"\n",
"from pyxem.generators.indexation_generator import IndexationGenerator"
]
Expand All @@ -330,18 +331,14 @@
"outputs": [],
"source": [
"structure_zb = diffpy.structure.loadStructure('./GaAs_mp-2534_conventional_standard.cif')\n",
"structure_wz = diffpy.structure.loadStructure('./GaAs_mp-8883_conventional_standard.cif')\n",
"\n",
"phase_descriptions = [('ZB', structure_zb, 'cubic'),\n",
" ('WZ', structure_wz, 'hexagonal')]\n",
"phase_names = [phase[0] for phase in phase_descriptions]"
"structure_wz = diffpy.structure.loadStructure('./GaAs_mp-8883_conventional_standard.cif')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Initialize a structure library generator for the specified phases"
"Create a basic rotations list. "
]
},
{
Expand All @@ -350,7 +347,8 @@
"metadata": {},
"outputs": [],
"source": [
"struc_lib_gen = StructureLibraryGenerator(phase_descriptions)"
"rot_list_cubic = rotation_list_stereographic(structure_zb,(0, 0, 1),(1, 0, 1),(1, 1, 1),np.linspace(0, 2*np.pi, 360/10),np.deg2rad(10))\n",
"rot_list_hex = rotation_list_stereographic(structure_wz,(0, 0, 0, 1), (1, 0, -1, 0), (1, 1, -2, 0),np.linspace(0, 2*np.pi, 360/10),np.deg2rad(10))"
]
},
{
Expand All @@ -366,11 +364,9 @@
"metadata": {},
"outputs": [],
"source": [
"inplane_rotations = [[0], [0]] # The library only needs the base in-plane rotation. The other ones are generated\n",
"rotation_list_resolution = 1\n",
"\n",
"struc_lib = struc_lib_gen.get_orientations_from_stereographic_triangle(\n",
" inplane_rotations, rotation_list_resolution)"
"struc_lib = StructureLibrary(['ZB','WZ'],\n",
" [structure_zb,structure_wz],\n",
" [rot_list_cubic,rot_list_hex])"
]
},
{
Expand Down Expand Up @@ -450,7 +446,7 @@
"metadata": {},
"outputs": [],
"source": [
"diff_lib.pickle_library('./GaAs_cubic_hex_1deg.pickle')"
"diff_lib.pickle_library('./GaAs_cubic_hex.pickle')"
]
},
{
Expand All @@ -468,7 +464,7 @@
"source": [
"from diffsims.libraries.diffraction_library import load_DiffractionLibrary\n",
"\n",
"diff_lib = load_DiffractionLibrary('./GaAs_cubic_hex_1deg.pickle', safety=True)"
"diff_lib = load_DiffractionLibrary('./GaAs_cubic_hex.pickle', safety=True)"
]
},
{
Expand Down Expand Up @@ -948,20 +944,6 @@
"source": [
"crystal_map.save_mtex_map('vector_match_results.csv')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -980,7 +962,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This functionaility was introduced in pyxem-0.9.0 (July 2019) and has been checked to run. Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
"This functionaility has been checked to run in pyxem-0.10.0 (November 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
]
},
{
Expand Down
29 changes: 18 additions & 11 deletions 04 Simulate Data - Phase Mapping - Orientation Mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This functionaility has been checked to run in pyxem-0.9.0 (July 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
"This functionaility has been checked to run in pyxem-0.10.0 (November 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
]
},
{
Expand Down Expand Up @@ -65,14 +65,14 @@
"metadata": {},
"outputs": [],
"source": [
"%matplotlib tk\n",
"%matplotlib qt\n",
"import numpy as np\n",
"import hyperspy.api as hs\n",
"import pyxem as pxm\n",
"import diffpy.structure\n",
"from matplotlib import pyplot as plt\n",
"\n",
"from diffsims.generators.structure_library_generator import StructureLibraryGenerator\n",
"from diffsims.utils.sim_utils import rotation_list_stereographic\n",
"from diffsims.libraries.structure_library import StructureLibrary\n",
"from diffsims.generators.diffraction_generator import DiffractionGenerator\n",
"from diffsims.generators.library_generator import DiffractionLibraryGenerator, VectorLibraryGenerator\n",
Expand Down Expand Up @@ -222,12 +222,19 @@
"metadata": {},
"outputs": [],
"source": [
"structure_library_generator = StructureLibraryGenerator(\n",
" [('Si', si, 'cubic'),\n",
" ('Ga', ga, 'hexagonal')])\n",
"structure_library = structure_library_generator.get_orientations_from_stereographic_triangle(\n",
" [(0,), (0,)], # In-plane rotations\n",
" 5) # Angular resolution of the library"
"rot_list_cubic = rotation_list_stereographic(si,(0, 0, 1),(1, 0, 1),(1, 1, 1),np.linspace(0, 2*np.pi, 360/10),np.deg2rad(10))\n",
"rot_list_hex = rotation_list_stereographic(ga,(0, 0, 0, 1), (1, 0, -1, 0), (1, 1, -2, 0),np.linspace(0, 2*np.pi, 50),np.deg2rad(3))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"structure_library = StructureLibrary(['si','ga'],\n",
" [si,ga],\n",
" [rot_list_cubic,rot_list_hex])"
]
},
{
Expand Down Expand Up @@ -255,7 +262,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Correlate with the patterns contained in the library with the test data. At this stage the top 3 (`n_largest`) matching results are retained. Test all in-plane rotations at 5 degree increments from 0 to 360."
"Correlate with the patterns contained in the library with the test data. At this stage the top 3 (`n_largest`) matching results are retained."
]
},
{
Expand All @@ -265,7 +272,7 @@
"outputs": [],
"source": [
"indexer = IndexationGenerator(test_data, template_library)\n",
"match_results = indexer.correlate(n_largest=3, inplane_rotations=np.arange(0, 360, 5))"
"match_results = indexer.correlate(n_largest=3)"
]
},
{
Expand Down
13 changes: 10 additions & 3 deletions 05 Simulate Data - Strain Mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"All functionality has been checked to run using pyxem-0.9.0"
"This functionaility has been checked to run in pyxem-0.10.0 (November 2019). Bugs are always possible, do not trust the code blindly, and if you experience any issues please report them here: https://github.com/pyxem/pyxem-demos/issues"
]
},
{
Expand Down Expand Up @@ -351,8 +351,8 @@
"metadata": {},
"outputs": [],
"source": [
"spg = SubpixelrefinementGenerator(dp,np.asarray([x_peak,y_peak]))\n",
"Vs = spg.center_of_mass_method(6)"
"spg = SubpixelrefinementGenerator(dp, np.asarray([x_peak,y_peak]))\n",
"Vs = spg.center_of_mass_method(20)"
]
},
{
Expand Down Expand Up @@ -388,6 +388,13 @@
"source": [
"strain_map.plot(cmap='seismic',vmax=0.04,vmin=-0.04)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit cb158d5

Please sign in to comment.