Skip to content

Commit 60dcaa1

Browse files
committed
track down master refs; update help for comments searching; new startup tests for dev; update Windows reset .bat
1 parent f45bcaf commit 60dcaa1

File tree

6 files changed

+66
-23
lines changed

6 files changed

+66
-23
lines changed

MDhelp/docs/powdersample.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
This window shows the various sample-dependent parameters for the selected powder pattern. Some are related to the measurement conditions, such as diffractometer setting angles, or the data collection temperature. Others, such as the histogram scale factor, adjust the fit to match the collected data.
77
The presence of a refine button indicates that a parameter can be refined (all others are fixed.) All values shown in this window can be edited.
88

9-
Note that the last three parameters (named internally as `FreePrm`*X*, *X*=1,2,3), which are labeled by default as "Sample humidity", "Sample Voltage" and "Applied Load" are fields where the labels that can be changed. If changed in one histogram, the same label is used for all histograms. Thus, a minimum of three parametric variables are available in addition to temperature, pressure and time. Also, note when a label `FreePrm` is changed, the Comments tree item for each PWDR histogram is searched for a matching "Label=value" pair (differences in letter case between the two label strings is ignored). When found, the value is converted to a float and saved as the appropriate Sample Parameter.
9+
Note that the last three parameters (named internally as `FreePrm`*X*, *X*=1,2,3), which are labeled by default as "Sample humidity", "Sample Voltage" and "Applied Load" are fields where the labels that can be changed. If changed in one histogram, the same label is used for all histograms. Thus, a total of six parametric variables are available,
10+
including the more common variable of temperature, pressure and time. Also, note when a label `FreePrm` is changed to "ParmName", the Comments tree item for each PWDR histogram is searched for a matching "\*ParmName\*=value" or "\*ParmName\*:value" pair (i.e. the string "ParmName" will be looked for within the label+value pairs in the comments, ignoring differences in letter case between the two label strings). Thus if the Sample Parameters label is specified as "focus", then a Comments string of "/Instrument/BeamFocus_at_sample=10" will be matched. When found, the value is converted to a float and saved as the value for the newly-labeled Sample Parameter. Also, note the similar action in the ["Set from comments" command](#SetFromComments), below.
1011

1112
Be sure the correct instrument type is selected (Debye-Scherrer or Bragg-Brentano). Also, ensure the goniometer radius is correct (in mm) so that sample displacements are properly scaled (in μm).
1213

@@ -46,3 +47,6 @@ Note that the first line(s) in the file can be a header, but each header line mu
4647

4748
* **Rescale all** - Allows a series of selected PWDR histograms to be put on a common scale by integrating them over a specific two-theta region and then scaling them so that the integration range will match the first pattern.
4849

50+
<a name="SetFromComments"></a>
51+
* **Set from comments** - The histogram comments section, depending on the importer used to read in the data (or image the data is derived from) often contains values that are recorded on the diffraction instrument. These are commonly recorded as "Label=value" or "Label:value".
52+
This command can be used to scan the comments and transfer them to the sample parameters. This is done by selecting a sample parameter as well as a Label found in the comments. One then specifies the histograms where the search will be performed. This is particularly of use for parametric variables and for sample setting angles.

webdocs/compile.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ binaries that have been distributed with GSAS-II, but they can be
3535
compiled by users and in some cases that will be necessary. The
3636
documentation here discusses these files.
3737

38-
Note that there are two methods used for compiling GSAS-II. For Python
39-
3.11 and earlier, a build process with a utility called ``Scons`` was used, but this
40-
stopped working for GSAS-II with Python 3.12 and a new build process
41-
using the ``meson`` tool was implemented. At present, there are two
42-
branches for GSAS-II. The ``master`` branch uses Scons and the
43-
``main`` branch uses meson. The master branch is the current default
44-
branch but will eventually be retired in favor of the newer ``main``
45-
branch.
38+
Note that GSAS-II is compiled using a utility called ``meson``.
39+
For Python prior to 3.10, a build process with a utility called
40+
``Scons`` may be needed, but this
41+
stopped working for GSAS-II with Python 3.12.
42+
The now obsolete ``master`` branch uses Scons and the
43+
``main`` branch uses meson.
4644

4745
Most people will not need this, but some specific
4846
installation details are discussed in the source code documentation,

webdocs/developers.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,42 @@ Adding startup code
127127
When doing repetitive testing, it can be time consuming to have to run
128128
the same commands from the GUI each time that GSAS-II is started. In
129129
debug mode, GSAS-II can run specific code when the program is started
130-
and a .gpx file is loaded (in routine ``GSASIIdataGUI.GSASII.StartProject``)
131-
by creating a file named ``debug_setup.py`` that is placed in the
130+
or when a .gpx file is loaded (in routine
131+
``GSASIIdataGUI.GSASII.StartProject``).
132+
133+
134+
Run at startup
135+
===============
136+
137+
To run code at startup, creating a file named ``debug_startup.py``
138+
that is placed in the directory with the rest of the GSAS-II files. An
139+
example that tests a section of code from an exporter::
140+
141+
print(f'\n{70*"="}\nrunning debug_startup.py\n{70*"="}')
142+
import wx
143+
G2frame = wx.App.GetMainTopWindow()
144+
from .imports import G2img_HDF5
145+
reader = G2img_HDF5.HDF5_Reader()
146+
reader.ContentsValidator('/Users/toby/Scratch/MPE_H5/test.h5')
147+
148+
and this code loads an image file when GSAS-II starts::
149+
150+
print(f'\n{70*"="}\nrunning debug_startup.py\n{70*"="}')
151+
import wx
152+
self = G2frame = wx.App.GetMainTopWindow()
153+
self.CheckNotebook()
154+
rdlist = self.OnImportGeneric(None,self.ImportImageReaderlist,
155+
'image',multiple=True,Preview=False,load2Tree=True,
156+
filename='/tmp/MPE_H5/Cr3_Zry4_Temp_2cps_650C_016665.ge1.h5')
157+
if rdlist:
158+
self.GPXtree.SelectItem(GetGPXtreeItemId(self,self.Image,'Image Controls'))
159+
160+
161+
Run after reading a project
162+
=============================
163+
164+
Provide Python commands that will be run after a project is read by
165+
creating a file named ``debug_setup.py`` that is placed in the
132166
directory with the rest of the GSAS-II files. Some examples follow.
133167

134168
This triggers refinement of a .gpx file that is placed on the command

webdocs/help.rst

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,24 @@ overwrite your changes with the latest GSAS-II version.
2525
On Windows
2626
----------------
2727

28-
At present, two windows .BAT files are created in the directory where
29-
GSAS-II is installed, one named ``Reset2FreshGSASII.bat`` the other
30-
``start_G2_bootstrap.bat``. Thus, if GSAS-II is installed in directory
31-
``C:\Users\toby\gsas2main`` the files will be named
32-
``C:\Users\toby\gsas2main\Reset2FreshGSASII.bat`` and
33-
``C:\Users\toby\gsas2main\start_G2_bootstrap.bat``.
34-
Either will restore the GSAS-II files, but the
35-
``Reset2FreshGSASII`` file, will ask you to confirm before acting. The
36-
files can run by locating them in the Windows File Explorer and
28+
A Windows .BAT file is created in the directory where
29+
GSAS-II is installed, named ``2Reset2FreshGSASII.bat``
30+
Thus, if GSAS-II is installed in directory
31+
``C:\Users\toby\gsas2main`` the file will be named
32+
``C:\Users\toby\gsas2main\2Reset2FreshGSASII.bat``.
33+
This file will remove any changes you have made locally to the GSAS-II
34+
files and will install the latest version of those files from the
35+
GitHub server. The
36+
file can run by locating them in the Windows File Explorer and
3737
double-clicking on it or by typing the file name into the cmd.exe
38-
window.
38+
window.
39+
40+
Note that the GSAS-II installers prior to 2026 did not create this
41+
file or created a similarly named file that would not work. If the
42+
file ``2Reset2FreshGSASII.bat`` is not present, download and reinstall
43+
GSAS-II. You can use a new location and keep the old version or delete
44+
the old version and install the new one in the location used
45+
previously.
3946

4047
On MacOS and Linux
4148
------------------------

webdocs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ well as extensive visualization capabilities.
5353
codes or reference later work, with citations provided
5454
as they are used. *Please* cite them as well.
5555

56-
GSAS-II is made available for free use (`see license <https://raw.githubusercontent.com/AdvancedPhotonSource/GSAS-II/master/LICENSE>`_) with open access to the `source code <https://github.com/AdvancedPhotonSource/GSAS-II>`_.
56+
GSAS-II is made available for free use (`see license <https://raw.githubusercontent.com/AdvancedPhotonSource/GSAS-II/main/LICENSE>`_) with open access to the `source code <https://github.com/AdvancedPhotonSource/GSAS-II>`_.
5757

5858
Also, please do sign up for the GSAS-II mailing list `see below <mailinglist.html>`_.
5959
We add new features to GSAS-II quite frequently, so we may break

webdocs/install_dev.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ directly editing the ``.../GSAS-II/.git/config`` file from::
339339

340340
[remote "origin"]
341341
url = https://github.com/AdvancedPhotonSource/GSAS-II.git
342-
fetch = +refs/heads/master:refs/remotes/origin/master
342+
fetch = +refs/heads/main:refs/remotes/origin/main
343343

344344
to::
345345

0 commit comments

Comments
 (0)