Changeset 4895 for trunk


Ignore:
Timestamp:
Apr 27, 2021 10:14:41 PM (4 years ago)
Author:
toby
Message:

allow w to be on before publish; update powder plot help

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIplot.py

    r4871 r4895  
    19861986            if msg: msg += '\n'
    19871987            msg += " * only when the intensity scale is linear/sqrt (not log)"
    1988         if G2frame.Weight:
    1989             if msg: msg += '\n'
    1990             msg += " * only when weight plot is set to no weight plot"
    19911988        if msg:
    19921989            msg = 'Publication export is only available under limited plot settings\n'+msg
    19931990            G2G.G2MessageBox(G2frame,msg,'Wrong plot settings')
    19941991            print(msg)
     1992        elif G2frame.Weight:
     1993            G2frame.Weight = False
     1994            PlotPatterns(G2frame,newPlot=newPlot,plotType=plottype,extraKeys=extraKeys)
     1995            PublishRietveldPlot(G2frame,Pattern,Plot,Page)
     1996            G2frame.Weight = True
     1997            PlotPatterns(G2frame,newPlot=newPlot,plotType=plottype,extraKeys=extraKeys)
     1998            return
    19951999        else:
    19962000            PublishRietveldPlot(G2frame,Pattern,Plot,Page)
     
    22562260                q = xpos
    22572261                if q <= 0:
    2258                     G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q)
     2262                    G2frame.G2plotNB.status.SetStatusText('Q = %9.5f'%q)
    22592263                    return
    22602264                try:
     
    22622266                    xpos = G2lat.Dsp2pos(Parms,2.0*np.pi/q)
    22632267                except ValueError:      #avoid bad value in asin beyond upper limit
    2264                     G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q)
     2268                    G2frame.G2plotNB.status.SetStatusText('Q = %9.5f'%q)
    22652269                    return
    22662270                if 'T' in Parms['Type'][0]: # TOF
     
    22722276                q = xpos
    22732277                if q <= 0:
    2274                     G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q)
     2278                    G2frame.G2plotNB.status.SetStatusText('Q = %9.5f'%q)
    22752279                    return
    22762280                dsp = 2.*np.pi/q
     
    22962300            if G2frame.Contour: #PWDR only
    22972301                if 'T' in Parms['Type'][0]:
    2298                     G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d =%9.5f q = %9.5f pattern ID =%5d'%(xpos,dsp,q,int(ypos)),1)
     2302                    G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d=%9.5f Q=%9.5f pattern ID =%5d'%(xpos,dsp,q,int(ypos)),1)
    22992303                else:
    2300                     G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d =%9.5f q = %9.5f pattern ID =%5d'%(xpos,dsp,q,int(ypos)),1)
     2304                    G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q= %9.5f pattern ID =%5d'%(xpos,dsp,q,int(ypos)),1)
    23012305            else:
    23022306                if 'T' in Parms['Type'][0]:
    23032307                    if Page.plotStyle['sqrtPlot']:
    2304                         G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d =%9.5f q =%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)
     2308                        G2frame.G2plotNB.status.SetStatusText('TOF = %9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)
    23052309                    else:
    2306                         G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d =%9.5f q =%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1)
     2310                        G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d=%9.5f Q=%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1)
    23072311                else:
    23082312                    if 'PWDR' in plottype:
    23092313                        if Page.plotStyle['sqrtPlot']:
    2310                             G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d =%9.5f q = %9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)
     2314                            G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q=%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1)
    23112315                        else:
    2312                             G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d =%9.5f q = %9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1)
     2316                            G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f d=%9.5f Q=%9.5f Intensity =%9.2f'%(xpos,dsp,q,ypos),1)
    23132317                    elif plottype == 'SASD':
    23142318                        G2frame.G2plotNB.status.SetStatusText('q =%12.5g Intensity =%12.5g d =%9.1f'%(q,ypos,dsp),1)
     
    59445948        if xpos:                                        #avoid out of frame mouse position
    59455949            ypos = event.ydata
    5946             G2frame.G2plotNB.status.SetStatusText('q =%.3f%s %sq/q =%.4f'%(xpos,Angstr+Pwrm1,GkDelta,ypos),1)                   
     5950            G2frame.G2plotNB.status.SetStatusText('Q =%.3f%s %sQ/Q =%.4f'%(xpos,Angstr+Pwrm1,GkDelta,ypos),1)                   
    59475951           
    59485952    def OnKeyPress(event):
  • TabularUnified trunk/help/gsasII.html

    r4833 r4895  
    43874387part of your project are shown on this page. They can be displayed as a stack
    43884388of powder patterns, just a single pattern or as a contour image of the peak
    4389 intensities. What can be done here will depend on which is displayed.
    4390 </P><p class=MsoNormal style='margin-left:1.0in'>
    4391 The difference curve position can be moved
    4392 vertically by clicking on it and then "dragging" it up or down.
    4393 Reflection positions
    4394 can also be repositioned vertically by dragging them.
    4395 The indicies (hkl values) for reflections can be displayed by
    4396 selecting the "Reflection Lists" entry and then if needed the
    4397 appropriate phase. Letting
    4398 the mouse rest at the position of a reflection in 2-theta, Q,
    4399 etc. (the vertical position does not matter). After a short delay a
    4400 "tool tip" will be displayed for any reflections close to the lateral
    4401 mouse position.
     4389intensities. What can be done here will depend on home many patterns
     4390  are shown as well as what mode is selected.
     4391Note that when the tick marks and difference curve positions can be
     4392  customized, as <a href="#PWDR_dragticks">discussed below</a>.
     4393</P><p class=MsoNormal style='margin-left:1.0in'>
     4394  Similar plots to the one here are displayed when different
     4395  subtree items are selected and on those plots it is possible to
     4396  view and in some cases edit information associated with the
     4397  histogram. As examples:
     4398  <UL style='margin-left:1.0in'>
     4399    <a name="otherPWDR"></a>
     4400    <LI>By selecting
     4401      the <a href="#PWDR_Limits">Limits</a> entry, range of data used,
     4402    as well as possible excluded regions, can be set.
     4403    <LI>Selecting <a href="#PWDR_Reflection_Lists">Reflection Lists</a>
     4404      allows display of reflection indicies (hkl values) for a
     4405    selected phase.
     4406    Letting the mouse rest unmoved at the position of a reflection
     4407    in 2-theta, Q, etc. (the vertical position does not matter) will
     4408    cause these to be displayed. After a short delay a
     4409    "tool tip" will appear with indicies for any reflections close
     4410    to the lateral mouse position.
     4411    <LI>Selecting <a href="#PWDR_Background">Background</a> allows
     4412    a mouse to be used to define
     4413    fixed points where a background curve
     4414    can be fitted to those points.
     4415    <LI>Selecting <a href="#PWDR_Instrument_Parameters">Instrument
     4416    Parameters</a>displays plot of peak widths as a function of 2theta
     4417    or Q.
     4418    <LI>Selecting <a href="#PWDR_Peak_List">Peak List</a> allows
     4419    postions of peaks to be defined for use in direct peak fitting.
     4420    <LI>Selecting <a href="#PWDR_Unit_Cells_List">Unit Cells List</a>
     4421    can show the positions of reflections for an arbitrary set of
     4422    unit cell parameters, optionally with space group extinctions
     4423    applied.
    44024424</P>
    44034425
     4426</UL>
    44044427<h5 style='margin-left:.5in'><span
    44054428style='mso-fareast-font-family:"Times New Roman"'>
     
    44074430
    44084431<DL style='margin-left:0.5in'>
    4409 <DT>Move mouse
     4432  <DT>Move mouse
    44104433  <DD>As the mouse cursor is moved across the plot, the plot status line
    44114434will show the cursor position as 2Theta, d-spacing and the
    4412     intensity. For a Q-plot, Q is shown instead of 2Theta.
     4435    intensity. For a Q-plot, Q is shown instead of 2Theta.
     4436
     4437  <DT>Press keyboard keys
     4438  <DD><a href="#PWDR_keylist">See below</a>. The "s" and "w" modes are commonly used.
     4439   
     4440  <a name="PWDR_dragticks"></a>
     4441  <DT>Drag tickmarks
     4442  <DD>Click on any tick mark and while holding the left mouse button
     4443  down move them to where you want them to
     4444  be displayed (press the s key for Sqrt(I) mode to reset to the
     4445  defaults). With multiple phases, clicking on the 2nd phase,
     4446  etc. changes the vertical spacing between tickmarks.
     4447
     4448  <DT>Drag the difference curve
     4449  <DD>When the "normal" obs-calc plot is shown (as opposed to the
     4450  preferred "w" mode plot where (obs-calc)/sigma is displayed, click
     4451  on any point in the difference curve and while holding the left mouse button
     4452  down move the curve to where you want it to
     4453  be displayed (press the s key for Sqrt(I) mode to reset it to the
     4454    default).
     4455   
     4456  <DT>Display/edit histogram information
     4457  <DD>By selecting different tree items within the current
     4458    histogram, it is possible to display and in some cases edit
     4459    information associated with the histogram.
     4460    <a href="#otherPWDR">See above.</a>
     4461   
     4462  <DT>Create a Publication-ready plot
     4463  <DD>Press the green "P" button to generate a customizable version
     4464    of the displayed plot that can be exported at high resolution.
    44134465</DL>
    4414 <P style='margin-left:.5in'>
     4466<a name="PWDR_keylist"></a><P style='margin-left:.5in'>
    44154467The following key press characters are defined (not for all plot
    44164468modes). These actions can also be initiated from the <B>Key Press</B>
     
    44194471<I>For line plots:</I></H4>
    44204472<DL style='margin-left:0.75in'>
     4473<DT><B>    s: Sqrt(I) on/off</b><dd>changes the y-axis to be the
     4474  square-root of the intensity. The tick mark and the
     4475  difference curve location is reset.
     4476<DT><B> w: toggle diff plot mode</b><dd>for the pattern selected from the
     4477  data tree, this will replace the difference (obs-calc) curve with
     4478  the differences divided by their standard uncertainty (esd) values
     4479  [(obs-calc)/sigma], which shows the significance of the deviations
     4480  in the fit of the pattern. <i>(Recommended)</I>.
    44214481<DT><B>    b: subtract background</b><dd>Subtracts the fitted
    44224482  background from the powder pattern. Pressing this again turns the
     
    44344494    x-axis scale. May not be very useful with data over a wide range.
    44354495
    4436 <DT><B> w: toggle diff plot</b><dd>for the pattern selected from the
    4437   data tree, this will replace the difference (obs-calc) curve with
    4438   the differences divided by their standard uncertainty (esd) values,
    4439   which shows the significance of the deviations.
     4496<DT><B>    e: set excluded region</b>
     4497<dd>Defines a new excluded region: press the "e" key with the mouse on
     4498  one side of the region. Move the mouse to the other side and and
     4499  press "e" again. The region markers (magenta dashed lines) can be
     4500  dragged to new positions. Available only when
     4501  the <a href="#PWDR_Limits">Limits</a> tree entry is selected.
     4502<DT><B>    x: show excluded region</b>
     4503<dd>Normally all observed data is plotted. When the "x" key is
     4504  pressed, data inside excluded regions are not shown.
     4505<DT><B>    .: scaling diagnostic</b>
     4506<dd>When the '.' key is pressed, data are plotted where the intensity
     4507  scale shows the equivalent number of counts so that uncertainty on
     4508  each point is the sqrt(I).
     4509<DT><B>    g: grid lines</b>
     4510<dd>Draws vertical and horizontal grid lines at all axis label
     4511  positions.
     4512<DT><B>    a: add magnification region</b>
     4513<dd>Adds a magnification region to the plot and sets the magnification
     4514  amount to x2. This can be edited (or deleted) in the table that is
     4515  shown when the main PWDR tree entry is selected.
     4516 
     4517
    44404518</DL>
    44414519
    4442 <P style='margin-left:.5in'>
    4443 For line plots with more than one powder pattern:</p>
     4520<H4 style='margin-left:.5in'><I>
     4521For line plots with more than one powder pattern:
     4522</I></H4>
    44444523<DL style='margin-left:0.75in'>
    44454524<DT><B>    c: contour on/off</b><dd>if multiple powder profiles, then a contour plot is shown
    44464525of the observed intensities. All data sets must be the same length as the first
    44474526one to be included in the contour plot.
     4527<DT><B>    S: set color Scheme</b>
     4528<dd>Select the color map used for contour plots
     4529
    44484530<DT><B> m: toggle single/multiple plot</b><dd>for multiple powder profiles, this will show only the one
    4449 selected from the data tree. The offset options are not active.
     4531selected from the data tree. The offset options (below) are not active.
    44504532<DT><B>f: select data</b><dd>Allows only some powder patterns to be
    44514533    plotted, rather than all.
    4452 <DT><B> +: no selection</b><dd>for multiple powder profiles, only the observed curve is shown.</span></p>
     4534<DT><B> +,=: no selection</b><dd>for multiple powder profiles, only
     4535  the observed curve is shown when this mode is turned on ('+' and '='
     4536  do exactly the same thing).</span></p>
     4537<DT><B> /: normalize</b><dd>for multiple powder profiles, all
     4538  diffraction datasets are normalized so that the maximum intensity is 1.
     4539  </span></p>
    44534540</DL>
    44544541 
    4455 <P style='margin-left:.5in'>For line plots in waterfall mode (multiple
    4456 patterns are shown) these key press items are defined:</p>
     4542<H4 style='margin-left:.5in'><I>
     4543Offset modes for line plots in waterfall mode (multiple patterns only):
     4544</I></H4>
    44574545<DL style='margin-left:0.75in'>
    44584546<DT><B>l: offset left</b><dd>
     
    44654553offset to the right (or decrease the left offset.)
    44664554
    4467 <DT><B>    d: offset down</b><dd>for a waterfall plot of multiple
    4468   powder profiles, increase the offset down.
    4469 
    4470 <DT><B>    u: offset up</b><dd>for a waterfall plot of multiple powder
     4555<DT><B>    d,D: offset down</b><dd>for a waterfall plot of multiple
     4556  powder profiles, increase the offset down.
     4557  (D does the same as d but to a much larger amount)
     4558
     4559<DT><B>    u,U: offset up</b><dd>for a waterfall plot of multiple powder
    44714560  profiles, increase the offset up.
     4561  (U does the same as u but to a much larger amount)
    44724562
    44734563<DT><B>    o: reset offset</b><dd>for a waterfall plot of multiple powder
     
    45014591</DL>
    45024592
     4593<H4 style='margin-left:.5in'><I>
     4594For display of reflections from magnetic unit space groups
     4595</I></H4>
     4596<DL style='margin-left:0.75in'>
     4597  <DT><B>j: show next; reset use flag</b><dd>
     4598    Show the next magnetic space group in the list, clearing the "Use"
     4599    flag for the currently displayed space group.
     4600    (available from Index Unit Cells only).
     4601  <DT><B>k: show next</b><dd>
     4602    Show the next magnetic space group in the list. The "Use"
     4603    flag for the currently displayed space group is unchanged.
     4604    (available from Index Unit Cells only).
     4605    </DL>
    45034606<h4 style='margin-left:0.25in'><a name="PWDR_Comments"><u>Comments</u></a></h4>
    45044607
     
    45754678
    45764679<p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family:
    4577 "Times New Roman"'>1). A continuous empirical function (‘<span class=SpellE>chebyschev</span>’,
     4680"Times New Roman"'>1). A continuous empirical function (‘chebyschev’,
     4681‘chebyschev-1’,
    45784682‘cosine’, ‘<span class=SpellE>lin</span> interpolate’, ‘inv interpolate’ &amp;
    45794683‘log interpolate’). The latter three select fixed points with spacing that is
    45804684equal, inversely equal or equal on a log scale of the x-coordinate. The set of
    45814685magnitudes at each point then comprise the background variables. All are
    4582 refined when refine is selected.<o:p></o:p></span></p>
     4686refined when refine is selected.
     4687Note that ‘chebyschev-1' is a better choice than ‘chebyschev’.
     4688<o:p></o:p></span></p>
    45834689
    45844690<p class=MsoNormal style='margin-left:.5in;tab-stops:0in'><span
     
    46244730<p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family:
    46254731"Times New Roman"'>where <span class=GramE>A,R</span> &amp; U are the possible
    4626 variables and can be individually selected as desired; Q = 2</span><span
    4627 style='font-family:Symbol;mso-fareast-font-family:"Times New Roman"'>p</span><span
    4628 style='mso-fareast-font-family:"Times New Roman"'>/d.<o:p></o:p></span></p>
     4732variables and can be individually selected as desired; Q = 2π/d.</p>
    46294733
    46304734<p class=MsoNormal style='margin-left:.5in'><span style='mso-fareast-font-family:
     
    75607664using Sphinx. </span></p>
    75617665
    7562 <P>&nbsp;</P>
     7666<A name="fullrmc">
     7667<h3><strong>Access to fullrmc</strong></h3>
     7668</a>
     7669<p class=MsoNormal>
     7670The fullrmc program is a large-box pair distribution function modeling
     7671library developed by Bachir Aoun ["Fullrmc, a Rigid Body Reverse Monte
     7672Carlo Modeling Package Enabled with Machine Learning and Artificial
     7673Intelligence", B. Aoun, <I>Jour. Comp. Chem.</I> <B>(2016)</B>, 37,
     76741102-1111.
     7675DOI: <a href="https://doi.org/10.1002/jcc.24304">10.1002/jcc.24304</a>].
     7676
     7677Extensive information about fullrmc is found, including a number of
     7678explanatory videos, along with the source code on GitHub:
     7679<A href="https://bachiraoun.github.io/fullrmc/">
     7680https://bachiraoun.github.io/fullrmc/</A>.
     7681
     7682Use of fullrmc requires a set of Python packages that can be installed along
     7683with the packages needed for GSAS-II, but Windows and MacOS users will
     7684likely find it easier to install a pre-compiled version of fullrmc by
     7685downloading it <A
     7686href="https://drive.google.com/drive/folders/10hxmQviKoMaW9R4MxsaiDyPSretxr_P7">
     7687from here</A>.
     7688
     7689To locate a version of Python containing fullrmc, the following
     7690locations are checked (in the order specified):
     7691<OL>
     7692  <LI>The GSAS-II <a href=#Preferences>configuration variable</a>
     7693  <tt>fullrmc_exec</tt> can point to a Python image.
     7694  <LI>The Python interpreter running GSAS-II is checked if fullrmc can
     7695  be imported
     7696  <LI>The location where GSAS-II is installed, the location where
     7697  Python is installed, the location where the GSAS-II binaries are
     7698  found, the current default location and all directories in the
     7699  system path are all checked for a file named
     7700  <tt>"fullrmc*macOS*i386-64bit"</tt> (MacOS), <tt>"fullrmc*.exe"</tt> (Windows) or
     7701  <tt>"fullrmc*"</tt> (Linux).
     7702</OL>
     7703</p>
     7704
    75637705
    75647706<hr size=2 width="100%" align=center>
    75657707<hr size=2 width="100%" align=center>
    75667708
    7567 <!-- hhmts start -->Last modified: Sun Feb 28 12:09:25 CST 2021 <!-- hhmts end -->
     7709<!-- hhmts start -->Last modified: Tue Apr 27 22:09:18 CDT 2021 <!-- hhmts end -->
    75687710
    75697711</div>
Note: See TracChangeset for help on using the changeset viewer.