-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have combined relevant modules into folders: * crystal : Lattice, Sample, Material, Symmetry, structure_factors, etc * fileio : load_data, load_instrument, etc * instrument : instrument, tools, goniometer, monochromator, analyzer, etc * scattering : pattern (new, renamed from scattering), polarization, etc. * data : analysis, data Plot modules are contained within the appropriate subfolder for relevant modules to prevent circular imports Added UTF encoding strings to all files to avoid import errors in python 2 Added loaders folder to fileio which will contain filetype-specific loaders for loading data, instruments, etc.
- Loading branch information
pseudocubic
committed
Apr 10, 2016
1 parent
656d1a6
commit 43fcb58
Showing
47 changed files
with
1,471 additions
and
1,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from .atom import Atom, MagneticAtom | ||
from .lattice import Lattice | ||
from .material import Material | ||
from .sample import Sample | ||
from .symmetry import SpaceGroup | ||
from . import symmetry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
r'''Handles lattice geometries to find rotations and transformations | ||
''' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import numpy as np | ||
|
||
|
||
class PlotMaterial(object): | ||
r'''Class containing plotting methods for Material object | ||
Methods | ||
------- | ||
plot_unit_cell | ||
''' | ||
def plot_unit_cell(self): | ||
r'''Plots the unit cell and atoms of the material. | ||
''' | ||
|
||
import matplotlib.pyplot as plt | ||
from mpl_toolkits.mplot3d import Axes3D # @UnresolvedImport | ||
from itertools import product, combinations | ||
|
||
fig = plt.figure() | ||
ax = fig.gca(projection='3d') | ||
|
||
# draw unit cell | ||
for s, e in combinations(np.array(list(product([0, self.abc[0]], [0, self.abc[1]], [0, self.abc[2]]))), 2): | ||
if np.sum(np.abs(s - e)) in self.abc: | ||
ax.plot3D(*zip(s, e), color="b") | ||
|
||
# plot atoms | ||
x, y, z, m = [], [], [], [] | ||
for item in self.atoms: | ||
x.append(item.pos[0] * self.abc[0]) | ||
y.append(item.pos[1] * self.abc[1]) | ||
z.append(item.pos[2] * self.abc[2]) | ||
m.append(item.mass) | ||
|
||
ax.scatter(x, y, z, s=m) | ||
|
||
plt.axis('scaled') | ||
plt.axis('off') | ||
|
||
plt.show() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .data import Data | ||
from .rawdata import RawData |
Oops, something went wrong.