Skip to content

Commit 7de43e5

Browse files
committed
Add eA def to help; major revision to installation instructions with new pip methods and more on setting up a development environment
1 parent 05209b1 commit 7de43e5

File tree

11 files changed

+1222
-468
lines changed

11 files changed

+1222
-468
lines changed

MDhelp/docs/phasedata.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,40 @@ For single crystal data, the only parameters are scale, extinction and disordere
2626

2727
* **Scale factor** - Used for single crystal data: relates \(F^2_{obs}\) to \(F^2_{calc}\).
2828

29-
* **Crystallite size peak broadening** – This is computed from size factor(s) in microns (1 μm = \(10^{-6}\) m), with the Scherrer constant assumed as unity. Sizes can be computed in three ways: isotropic, uniaxial and ellipsoidal.
29+
* **Crystallite size peak broadening**
30+
Peaks can be broadened due to the finite size of crystallites or due to microstrain (see below). Microstrain is more common other than in nanoparticles.
31+
The broadening is computed from size factor(s) in microns (1 μm = \(10^{-6}\) m), with the Scherrer constant assumed as unity. Sizes can be computed with a choice of three models: isotropic, uniaxial and ellipsoidal.
3032
Typical sensitivity for crystallite size is to no more than 4 μm (less for lower resolution instruments); beyond that the particles are effectively infinite for a diffraction experiment.
3133

32-
* In isotropic broadening, crystallites are assumed to average as uniform in all directions and a single size value is supplied;
33-
* with uniaxial broadening, a preferred direction (as a crystallographic axis, such as (001) is supplied) -- note that for most crystal systems only one axis makes sense -- and two size parameters are defined, one for along the axis and one for in the perpendicular plane;
34-
* with ellipsoidal, six terms are used to define a broadening tensor that has arbitrary orientation -- this model may require constraints and is seldom needed.
34+
* In **isotropic** broadening, crystallites are assumed to average as uniform in all directions and a single size value is supplied;
35+
* with **uniaxial** broadening, a preferred direction (as a crystallographic axis, such as (001) is supplied) -- note that for most crystal systems only one axis makes sense -- and two size parameters are defined, one for along the axis and one for in the perpendicular plane;
36+
* with **ellipsoidal**, six terms are used to define a broadening tensor that has arbitrary orientation -- this model may require constraints and is seldom needed.
3537

36-
Note that size broadening is usually Lorentzian, which corresponds to a LGmix value of 1.0; if this value is between 0. and 1., both Gaussian and Lorentz size broadening is modeled and a value of 0.0 is pure Gaussian. Values less than 0. or greater than 1. make no physical sense. LGmix is not commonly refined.
38+
Note that size broadening is usually Lorentzian, which corresponds to a LGmix value of 1.0; if this value is between 0 and 1, both Gaussian and Lorentz size broadening is modeled and a value of 0.0 is pure Gaussian. Values less than 0 or greater than 1 make no physical sense. LGmix is not commonly refined.
3739

38-
* **Microstrain peak broadening** - This is computed as unitless fraction of Δd/d (or equivalently ΔQ/Q) times \(10^6\). Microstrain can be represented in three ways: isotropic, uniaxial and generalized. Typical microstrain is ~1000, but may be significantly higher.
39-
* In isotropic broadening, microstrain broadening assumed to be the same in all crystallographic directions and a single value is supplied;
40-
* with uniaxial broadening, a preferred direction (as a crystallographic axis, such as 0,0,1) is supplied -- note that for most crystal systems only one axis makes sense -- and two microstrain parameters are defined, one for along the axis and one for in the perpendicular plane;
41-
* with generalized, the [Nicolae Popa](https://journals.iucr.org/j/issues/2020/06/00/es5029/index.html)/[Peter Stephens](https://journals.iucr.org/paper?hn0085) second-order expansion model is used and the number of terms will depend on the crystal system. It is typically possible to refine all terms when significant anisotropic strain broadening is present.
40+
* **Microstrain peak broadening** - This is computed as unitless fraction of Δd/d (or equivalently ΔQ/Q) times \(10^6\). Typical microstrain is ~1000, but may be significantly higher in physically processed materials. Note that the term residual stress is sometimes used for microstrain, but residual stress can be computed from microstrain when the elastic strain constants are known. Microstrain was can be computed in GSAS-II via a choice of three models: isotropic, uniaxial and generalized:
41+
* In **isotropic** broadening, microstrain broadening assumed to be the same in all crystallographic directions and a single value is supplied;
42+
* with **uniaxial** broadening, a preferred direction (as a crystallographic axis, such as 0,0,1) is supplied -- note that for most crystal systems only one axis makes sense -- and two microstrain parameters are defined, one for along the axis and one for in the perpendicular plane;
43+
* with **generalized**, the [Nicolae Popa](https://journals.iucr.org/j/issues/2020/06/00/es5029/index.html)/[Peter Stephens](https://journals.iucr.org/paper?hn0085) second-order expansion model is used and the number of terms will depend on the crystal system. It is typically possible to refine all terms when significant anisotropic strain broadening is present.
4244

43-
Note that microstrain broadening is usually Lorentzian, which corresponds to a LGmix value of 1.0; if this value is between 0.0 and 1.0, both Gaussian and Lorentz broadening is applied and a value of 0.0 is pure Gaussian. Values less than 0 or greater than 1 make no physical sense. LGmix is not commonly refined.
45+
Note that microstrain broadening is usually Lorentzian, which corresponds to a LGmix value of 1.0; if this value is between 0 and 1, both Gaussian and Lorentz size broadening is modeled and a value of 0.0 is pure Gaussian. Values less than 0 or greater than 1 make no physical sense. LGmix is not commonly refined.
4446

45-
* **Hydrostatic/elastic strain** – This shifts the lattice constants for the contribution of a phase into a histogram. The values are added to the [reciprocal lattice parameter tensor terms](http://gsas-ii.readthedocs.io/en/latest/GSASIIutil.html#gsasiilattice-unit-cell-computations). They must be refined in sequential refinements or where the lattice constants are slightly different in different histograms (as an example see the [Combined X-ray/CW-neutron refinement of \(\rm PbSO_4\) tutorial](https://advancedphotonsource.github.io/GSAS-II-tutorials/CWCombined/Combined%20refinement.htm). But these values and the phase's lattice parameters (on the General tab) should not be refined at the same time. When the values are non-zero, the lattice constants after application of these strain tensor terms is shown.
47+
* **Hydrostatic/elastic strain** – This shifts the lattice constants for the contribution of a phase into a histogram. These $D_{ij}$ values are added to the [reciprocal lattice parameter tensor terms](http://gsas-ii.readthedocs.io/en/latest/GSASIIutil.html#gsasiilattice-unit-cell-computations). They must be refined in sequential refinements or where the lattice constants are slightly different in different histograms (as an example, see the [Combined X-ray/CW-neutron refinement of \(\rm PbSO_4\) tutorial](https://advancedphotonsource.github.io/GSAS-II-tutorials/CWCombined/Combined%20refinement.htm)) or may account for changes to the lattice constants due to external stress (as occurs in a high-pressure measurement.) Note that *these values and the phase's lattice parameters (on the General tab) should not be refined at the same time*. When the values are non-zero, the lattice constants after application of these strain tensor terms is shown with these $D_{ij}$ values.
4648

47-
<a name="Phase-Preferred_orientation"></a>
48-
<a name="Preferred_orientation"></a>
49-
<a name="preferred_orientation"></a>
49+
For cubic material, an extra term, eA ($\epsilon_A$) with units of Å${}^{-2}$, is included that is particularly useful in high pressure work. This accounts for the shift of peaks due to macroscopic stress along the (111) directions:
50+
51+
$$\Delta 2 \theta = - 180.*d^2 * \Delta D_{hkl, \epsilon_A} * \tan(\theta) / \pi$$
52+
53+
$$\Delta T = -{\rm difC} * d^2 * \Delta D_{hkl, \epsilon_A} /2.$$
54+
55+
where $\Delta 2 \theta$ is in degrees and$\Delta T$ is TOF in $\mu$sec; $d$ is d-space (Å) and
56+
57+
$$\Delta D_{hkl, \epsilon_A} = \epsilon_A {(hk)^2 +(hl)^2 +(kl)^2 \over (h^2 +k^2 +l^2)^2}$$
58+
59+
60+
<a name="Phase-Preferred_orientation"></a>
61+
<a name="Preferred_orientation"></a>
62+
<a name="preferred_orientation"></a>
5063

5164
* **Preferred Orientation** – Preferred orientation (texture) can be treated in one of two different sections of GSAS-II, either the Preferred Orientation correction here in the Data tab, or the "[Texture](phasetexture.md)" tab, depending on what is desired.
5265
The Preferred Orientation correction here is typically used for crystallographic studies, where intensity corrections are desired to repair for undesired texture in the sample, while the Texture tab is used for studies where the goal is to characterize preferred orientation in a sample.

webdocs/compile.rst

Lines changed: 25 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
:alt: GSAS-II logo
88
:align: right
99

10-
.. index:: Compiling GSAS-II
10+
.. index:: Compiling GSAS-II
11+
12+
.. _Compiling GSAS-II:
1113

1214
======================
1315
Compiling GSAS-II
@@ -42,6 +44,11 @@ branches for GSAS-II. The ``master`` branch uses Scons and the
4244
branch but will eventually be retired in favor of the newer ``main``
4345
branch.
4446

47+
Most people will not need this, but some specific
48+
installation details are discussed in the source code documentation,
49+
`on compiling GSAS-II
50+
<https://advancedphotonsource.github.io/GSAS-II-tutorials/compile.html>`_.
51+
4552
Supplied Binary Files
4653
---------------------------
4754

@@ -130,12 +137,16 @@ Install the Python build routines and the compilers:
130137

131138
Linux::
132139

133-
sudo apt-get gcc gfortran git # or use the yum command:
134-
yum install gcc-gfortran git
140+
sudo apt-get gcc gfortran git
141+
142+
or use the dnf command::
143+
144+
dnf install gcc-gfortran git
135145

136-
and for Linux::
146+
Also for Linux make sure that meson and cython are installed (using
147+
conda or pip)::
137148
138-
conda python numpy install meson cython -c conda-forge
149+
conda install python numpy meson cython -c conda-forge
139150

140151
Note that the GSAS-II binaries will be compiled to work with a
141152
specific version of Python and numpy, if you have more than one conda
@@ -159,8 +170,8 @@ Create a scratch directory to compile GSAS-II into::
159170

160171
Note that this command will fail if cython, GFortran and a c
161172
complier is not found. If the flang compiler is found, meson will
162-
use it, but the resulting binaries will not work properly.
163-
173+
use it, but the resulting binaries may not work properly.
174+
164175
5.
165176
Move to the setup directory and compile::
166177
@@ -185,11 +196,11 @@ Install GSAS-II Binaries
185196

186197
meson compile local-install
187198

188-
This command will copy the compiled files to
189-
``~/.GSASII/bin``, which is appropriate for when one user
190-
will access the GSAS-II program. It also allows multiple
191-
GSAS-II installations (should a user wish to keep multiple
192-
versions available).
199+
This command will copy the compiled files to
200+
``~/.GSASII/bin``, which is appropriate for when one user
201+
will access the GSAS-II program. It also allows multiple
202+
GSAS-II installations (should a user wish to keep multiple
203+
versions available).
193204

194205
* Or when GSAS-II is installed on a server, the GSAS-II
195206
binaries can be placed with the GSAS-II source files
@@ -264,7 +275,7 @@ same installation causes problems with accessing libraries needed by the compile
264275
There are other ways potentially to install the tools
265276
needed for compilation, but use of conda will be much simpler, but
266277
will require use of command-line commands (in a cmd.exe window, the
267-
commands have not been worked out if they will done with PowerShell).
278+
commands have not been tested with PowerShell).
268279

269280
Note that if the gsas2main installer is used, this can replace
270281
steps (1) and (2), below. In that case, use command::
@@ -387,64 +398,4 @@ A script to Install & Compile GSAS-II
387398
======================================================
388399

389400
A simple way to install and compile GSAS-II uses the supplied
390-
``gitcompile.py`` script. Use these commands (on any platform) to
391-
install with local compilation::
392-
393-
cd ~/G2
394-
curl -L -O https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/raw/main/install/gitcompile.py
395-
python gitcompile.py
396-
397-
This will place the install script in directory ``~/G2`` (which you
398-
may wish to change above) and will use git to clone the
399-
AdvancedPhotonSource/GSAS-II repo placing all files in subdirectory
400-
``~/G2/GSAS-II``. The script does the following things:
401-
402-
* Checks that the Python installation has the packages that GSAS-II
403-
needs to run (`see here for details
404-
<https://gsas-ii.readthedocs.io/en/latest/packages.html#python-requirements>`_)
405-
and for compilation.
406-
* Installs or updates the GSAS-II files from the GitHub repo
407-
* Creates the and installs the appropriate binary files from the
408-
Fortran, C and Cython sources.
409-
* Does a byte-compile on all ``.py`` files
410-
* Creates shortcuts/icons for starting GSAS-II (OS specific)
411-
412-
Note that there are a number of options that can be used with the
413-
script, for example ``python gitcompile.py --reset`` overwrites any
414-
changes that have been made to GSAS-II files locally with the original
415-
versions of the files. The other options are not likely to be needed,
416-
but can be seen with ``python gitcompile.py --help``
417-
418-
Compiling with Scons
419-
---------------------------
420-
421-
Compilation with scons (as opposed to meson, as discussed above) is not
422-
recommended and will be removed from GSAS-II in the future. It will
423-
work only with Python 3.11 or older and only with the ``master``
424-
branch. Note that GSAS-II will fail with Python earlier than 3.7 and may have
425-
some errors even with Python 3.8-3.10 as it is no longer tested on
426-
those environments.
427-
428-
The compilation process requires installation of the gcc and GFortran
429-
compilers. Others will probablu not work. Also, the Python Scons
430-
package must be installed into Python. Compilation is then done with
431-
commands::
432-
433-
cd fsource
434-
scons
435-
436-
The scons file captures the compilation options needed for the supported platforms, but to compile on other platforms, it may be necessary to modify the ``Sconstruct`` file to configure for the new platform.
437-
438-
Installation of compilers is highly depend on the computer system being used, but in many cases they can be installed as a conda package, with a command such as::
439-
440-
conda install gfortran_osx-64 scons
441-
442-
Use the ``conda search gfortran`` command to find the name for the package.
443-
On most linux systems, one can use a command such as ``sudo apt-get gfortran`` or ``yum install gcc-gfortran``. Also see https://gcc.gnu.org/wiki/GFortranBinaries for more information.
444-
445-
Note that the intent is that this Scons-based process is no longer in
446-
use, but for reference some older web pages discussing compiling GSAS-II may be of use:
447-
448-
* https://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/CompilingWindows
449-
* https://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/InstallMacHardWay#CompilingFortranCode
450-
* https://subversion.xray.aps.anl.gov/trac/pyGSAS/wiki/InstallLinux#CompilingFortranCode
401+
``gitcompile.py`` script. See :ref:`gitcompile` for details.

webdocs/index.rst

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ well as extensive visualization capabilities.
3838
options.rst
3939
help.rst
4040
developers.rst
41-
compile.rst
4241
misc.rst
43-
master2main.rst
4442
AboutGSASII.rst
4543

4644
.. tip::
@@ -71,7 +69,7 @@ Installing GSAS-II: Overview
7169
There are several different ways to install GSAS-II, as are outlined below. Most people will use the GSAS2MAIN installer
7270

7371
.. toctree::
74-
:maxdepth: 3
72+
:maxdepth: 2
7573
:caption: Installation information:
7674

7775
install.rst
@@ -142,16 +140,6 @@ projects. Some starting information is here:
142140
.. toctree::
143141

144142
developers.rst
145-
146-
Compiling GSAS-II
147-
======================================
148-
149-
Creating the GSAS-II binaries when not using one of the standard
150-
installation methods.
151-
152-
.. toctree::
153-
154-
compile.rst
155143

156144
Miscellaneous GSAS-II Links
157145
======================================
@@ -161,10 +149,6 @@ Other things related to GSAS-II can be found here.
161149
.. toctree::
162150

163151
misc.rst
164-
165-
.. toctree::
166-
167-
master2main.rst
168152

169153

170154
GSAS-II Statisics: Usage & Size

webdocs/install-g2f-mac.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:alt: GSAS-II logo
88
:align: right
99

10-
MacOS GSAS2MAIN Installation Details
10+
MacOS: Detailed GSAS2MAIN Installation Instructions
1111
========================================================
1212

1313
.. image:: ./mac_inst_images/1.png

0 commit comments

Comments
 (0)