Closed sgbaird closed 3 years ago
When the option "StructureSize"
is used in CrystalPlot
, the structure is only stored temporarily. In this case, I suggest “making” the crystal first, then extract the coordinates.
Making the crystal:
ExpandCrystal["GalliumArsenide", "NewLabel" -> "GaAs"](* Defaults to 1x1x1 *)
Plot it if you like with CrystalPlot["GaAs"]
. Extract the columns with chemical element and coordinates:
$CrystalData[["GaAs", "AtomData", All, {"Element", "FractionalCoordinates"}]]
Also, you can export the atomic position of a structure in a "DISCUS"
format like this:
ExportCrystalData["DISCUS", "GaAs", "~/Desktop/GaAs.txt"]
Extract the columns with chemical element and coordinates:
$CrystalData[["GaAs", "AtomData", All, {"Element", "FractionalCoordinates"}]]
Also, you can export the atomic position of a structure in a
"DISCUS"
format like this:ExportCrystalData["DISCUS", "GaAs", "~/Desktop/GaAs.txt"]
This only seems to work as intended if alpha == beta == gamma == 90 degrees Otherwise the coordinates need to be transformed via the correct basis vectors.
For example,
R = GetCrystalMetric["GalliumArsenide", ToCartesian -> True];
coords = coords . R\[Transpose];
Yes, crystallographic coordinates are used by default, but CrystalPlot
objects contain Cartesian coordinates.
In the latest commit, I've added the function GetAtomCoordinates
which can extract coordinates of crystal (labels) and CrystalPlot
objects. It has a Boolean option "Cartesian"
for toggling the output coordinate system.
The way I'm doing it right now (with the correlated atoms) is:
Displayed as:
Not sure if there's an easier built-in way.