Changeset 1004


Ignore:
Timestamp:
Jul 21, 2013 8:38:32 PM (10 years ago)
Author:
toby
Message:

recapture focus on plot window so keyboard commands work

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r981 r1004  
    346346Reflection Lists              \           A dict with an entry for each phase in the
    347347                                          histogram. The contents of each dict item
    348                                           is a list or reflections as described in the
     348                                          is a list of reflections as described in the
    349349                                          :ref:`Powder Reflections <PowderRefl_table>`
    350350                                          description.
     
    462462 6           sig, Gaussian width
    463463 7           gam, Lorenzian width
    464  8           Fobs**2
    465  9           Fcalc**2
     464 8           :math:`F_{obs}^2`
     465 9           :math:`F_{calc}^2`
    466466 10          reflection phase, in degrees
    467467 11          the equivalent reflections as a (m x 3)
     
    472472             reflections as a length (m) array
    473473 13          intensity correction for reflection, this times
    474              Fobs**2 or Fcalc**2 gives Iobs or Icalc
     474             :math:`F_{obs}^2` or :math:`F_{calc}^2` gives Iobs or Icalc
     475 14          dict with the form factor (f or b) by atom type
     476             symbol at the reflection position.
     477==========  ====================================================
     478
     479Single Crystal Tree Items
     480-------------------------
     481
     482.. _Xtal_table:
     483
     484.. index::
     485   single: Single Crytsal data object description
     486   single: Data object descriptions; Single crystal data
     487
     488Every single crystal diffraction histogram is stored in the GSAS-II data tree
     489with a top-level entry named beginning with the string "HKLF ". The
     490diffraction data for that information are directly associated with
     491that tree item and there are a series of children to that item. The
     492routine :func:`~GSASII.GSASII.GetUsedHistogramsAndPhasesfromTree` will
     493load this information into a dictionary where the child tree name is
     494used as a key, and the information in the main entry is assigned
     495a key of ``Data``, as outlined below.
     496
     497.. tabularcolumns:: |l|l|p{4in}|
     498
     499======================  ===============  ====================================================
     500  key                      sub-key        explanation
     501======================  ===============  ====================================================
     502Data
     503                                          A list of lists, where each inner item
     504                                          is an individual reflection
     505                                          as described in the
     506                                          :ref:`Single Crystal Reflections
     507                                          <XtalRefl_table>`
     508                                          description.
     509
     510Instrument Parameters         \           A list containing two dicts where the possible
     511                                          keys in each dict are listed below. The value
     512                                          for most items is a list containing two values:
     513                                          the initial value, the current value.
     514                                          The first and second
     515                                          values are floats unless otherwise noted.
     516\                         Lam             Specifies a wavelength in Angstroms (two floats)
     517\                         Type            Histogram type (two str values):
     518                                           * 'SXC' for constant wavelength x-ray
     519                                           * 'SNC' for constant wavelength neutron
     520                                           * 'SNT' for time of flight neutron
     521\                         InstrName       A name for the instrument, used in preparing
     522                                          a CIF (str).
     523
     524wtFactor                      \           A weighting factor to increase or decrease
     525                                          the leverage of data in the histogram (float).
     526                                          A value of 1.0 weights the data with their
     527                                          standard uncertainties and a larger value
     528                                          increases the weighting of the data (equivalent
     529                                          to decreasing the uncertainties).
     530
     531hId                           \           The number assigned to the histogram when
     532                                          the project is loaded or edited (can change)
     533======================  ===============  ====================================================
     534
     535Single Crystal Reflection Data Structure
     536----------------------------------------
     537
     538.. _XtalRefl_table:
     539
     540.. index::
     541   single: Single Crystal reflection object description
     542   single: Data object descriptions; Single Crystal Reflections
     543   
     544For every phase in a histogram, the ``Reflection Lists`` value is a list of
     545reflections. The items in that list are documented below.
     546
     547==========  ====================================================
     548  index         explanation
     549==========  ====================================================
     550 0,1,2       h,k,l (float)
     551 3           multiplicity
     552 4           d-space, Angstrom
     553 5           :math:`F_{obs}^2`
     554 6           :math:`\sigma(F_{obs}^2)`
     555 7           :math:`F_{calc}^2`
     556 8           :math:`F_{obs}^2T`
     557 9           :math:`F_{calc}^2T`
     558 10          reflection phase, in degrees
     559 11          the equivalent reflections as a (m x 3)
     560             np.array.
     561 12          phase shift for each of the equivalent
     562             reflections as a length (m) array
     563 13          intensity correction for reflection, this times
     564             :math:`F_{obs}^2` or :math:`F_{calc}^2`
     565             gives Iobs or Icalc
     566             (not used in single crystals?)
    475567 14          dict with the form factor (f or b) by atom type
    476568             symbol at the reflection position.
  • trunk/GSASIIplot.py

    r998 r1004  
    122122        self.status.SetStatusWidths([150,-1])
    123123        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
     124        self.nb.Bind(wx.EVT_KEY_UP,self.OnNotebookKey)
    124125       
    125126        self.plotList = []
    126127           
     128    def OnNotebookKey(self,event):
     129        '''Called when a keystroke event gets picked up by the notebook window
     130        rather the child. This is not expected, but somehow it does sometimes
     131        on the Mac and perhaps Linux.
     132
     133        Assume that the page associated with the currently displayed tab
     134        has a child, .canvas; give that child the focus and pass it the event.
     135        '''
     136        Page = self.nb.GetPage(self.nb.GetSelection())
     137        try:
     138            Page.canvas.SetFocus()
     139            wx.PostEvent(Page.canvas,event)
     140        except AttributeError:
     141            pass
     142
    127143    def addMpl(self,name=""):
    128144        'Add a tabbed page with a matplotlib plot'
     
    10101026            cb.SetValue(' key press')
    10111027            wx.CallAfter(OnPlotKeyPress,event)
     1028        try:
     1029            Page.canvas.SetFocus() # redirect the Focus from the button back to the plot
     1030        except:
     1031            pass
     1032
    10121033                       
    10131034    def OnMotion(event):
     
    21272148            if event.key in 'l':
    21282149                wx.CallAfter(OnImPlotKeyPress,event)
     2150        try:
     2151            Page.canvas.SetFocus() # redirect the Focus from the button back to the plot
     2152        except:
     2153            pass
    21292154                       
    21302155    def OnImPick(event):
     
    27252750            cb.SetValue(' save as/key:')
    27262751            wx.CallAfter(OnKey,event)
     2752        try:
     2753            Page.canvas.SetFocus() # redirect the Focus from the button back to the plot
     2754        except:
     2755            pass
    27272756
    27282757    def OnKey(event):           #on key UP!!
Note: See TracChangeset for help on using the changeset viewer.