Changeset 5020


Ignore:
Timestamp:
Sep 2, 2021 4:10:06 PM (3 months ago)
Author:
toby
Message:

index changes for CCTBX; new scrolled output routine; document external routines

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4997 r5020  
    8282                                   used in Bind elsewhere in the code.
    8383:func:`G2MessageBox`               Displays text typically used for errors or warnings.
     84:func:`ShowScrolledInfo`           Displays longer text where scrolling is possibly needed
    8485:func:`GetItemOrder`               Creates a dialog for ordering items into columns
    8586:func:`GetImportFile`              Gets one ore more file from the appropriate import
     
    24122413    dlg.ShowModal()
    24132414    dlg.Destroy()
     2415
     2416def ShowScrolledInfo(parent,txt,width=600,height=400,header='Warning info'):
     2417    '''Simple code to display possibly extensive error or warning text
     2418    in a scrolled window.
     2419
     2420    :param wx.Frame parent: parent window for
     2421    :param str txt: text to be displayed
     2422    :param int width: lateral of window in pixels (defaults to 600)
     2423    :param int height: vertical dimension of window in pixels (defaults to 400)
     2424    :param str header: width of window in pixels (defaults to 600)
     2425    '''
    24142426   
     2427    dlg = wx.Dialog(parent.GetTopLevelParent(),wx.ID_ANY,header, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
     2428    spanel = wxscroll.ScrolledPanel(dlg, wx.ID_ANY, size=(width-20, height))
     2429    mainSizer = wx.BoxSizer(wx.VERTICAL)
     2430    mainSizer.Add(spanel,1,wx.ALL|wx.EXPAND,1)
     2431
     2432    txtSizer = wx.BoxSizer(wx.VERTICAL)
     2433    txt = wx.StaticText(spanel,wx.ID_ANY,txt)
     2434    txt.Wrap(600)
     2435    txt.SetBackgroundColour(wx.WHITE)
     2436    txtSizer.Add(txt,1,wx.ALL|wx.EXPAND,1)
     2437    spanel.SetSizer(txtSizer)
     2438    btnsizer = wx.BoxSizer(wx.HORIZONTAL)
     2439    btn = wx.Button(dlg, wx.ID_CLOSE)
     2440    btn.Bind(wx.EVT_BUTTON,lambda event: dlg.EndModal(wx.ID_CANCEL))
     2441    btnsizer.Add(btn)
     2442    mainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
     2443    dlg.SetSizer(mainSizer)
     2444    mainSizer.Fit(dlg)
     2445    spanel.SetAutoLayout(1)
     2446    spanel.SetupScrolling()
     2447    #dlg.SetMaxSize((-1,400))
     2448    dlg.CenterOnParent()
     2449    dlg.ShowModal()
     2450    dlg.Destroy()
     2451
    24152452################################################################################
    24162453class PickTwoDialog(wx.Dialog):
  • trunk/GSASIIindex.py

    r4866 r5020  
    832832    return len(HKL),M20,X20,A
    833833       
    834 def findBestCell(dlg,ncMax,A,Ntries,ibrav,peaks,V1,ifX20=True):
     834def findBestCell(dlg,ncMax,A,Ntries,ibrav,peaks,V1,ifX20=True,cctbx_args=None):
    835835    'needs a doc string'
    836836# dlg & ncMax are used for wx progress bar
     
    871871       
    872872        if IndexPeaks(peaks,HKL)[0] and len(HKL) > mHKL[ibrav]:
    873             Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
     873            Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20,cctbx_args=cctbx_args)
    874874            Asave.append([calc_M20(peaks,HKL,ifX20),Aref[:]])
    875875            if ibrav in [9,10,11]:                          #A,B,or C-centered orthorhombic
    876876                for i in range(2):
    877877                    Abeg = rotOrthoA(Abeg[:])
    878                     Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
     878                    Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20,cctbx_args=cctbx_args)
    879879                    HKL = G2lat.GenHBravais(dmin,ibrav,Aref)
    880880                    peaks = IndexPeaks(peaks,HKL)[1]
     
    882882            # elif ibrav == 15:                      #C-centered monoclinic
    883883            #     Abeg = swapMonoA(Abeg[:])
    884             #     Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20)
     884            #     Lhkl,M20,X20,Aref = refinePeaks(peaks,ibrav,Abeg,ifX20,cctbx_args=cctbx_args)
    885885            #     HKL = G2lat.GenHBravais(dmin,ibrav,Aref)
    886886            #     peaks = IndexPeaks(peaks,HKL)[1]
     
    892892    X = sortM20(Asave)
    893893    if X:
    894         Lhkl,M20,X20,A = refinePeaks(peaks,ibrav,X[0][1],ifX20)
     894        Lhkl,M20,X20,A = refinePeaks(peaks,ibrav,X[0][1],ifX20,cctbx_args=cctbx_args)
    895895        return GoOn,Skip,Lhkl,M20,X20,A       
    896896    else:
     
    959959
    960960def DoIndexPeaks(peaks,controls,bravais,dlg,ifX20=True,
    961             timeout=None,M20_min=2.0,X20_max=None,return_Nc=False):
     961            timeout=None,M20_min=2.0,X20_max=None,return_Nc=False,
     962            cctbx_args=None):
    962963    'needs a doc string'
    963964   
     
    10101011                                if not N2:
    10111012                                    A = []
    1012                                     GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,A,Nm[ibrav]*N1s[ibrav],ibrav,peaks,V1,ifX20)
     1013                                    GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,A,Nm[ibrav]*N1s[ibrav],ibrav,peaks,V1,ifX20,cctbx_args=cctbx_args)
    10131014                                    if Skip:
    10141015                                        break
    10151016                                if A:
    1016                                     GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,A[:],N1s[ibrav],ibrav,peaks,0,ifX20)
     1017                                    GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,A[:],N1s[ibrav],ibrav,peaks,0,ifX20,cctbx_args=cctbx_args)
    10171018                            else:
    1018                                 GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,0,Nm[ibrav]*N1s[ibrav],ibrav,peaks,V1,ifX20)
     1019                                GoOn,Skip,Nc,M20,X20,A = findBestCell(dlg,ncMax,0,Nm[ibrav]*N1s[ibrav],ibrav,peaks,V1,ifX20,cctbx_args=cctbx_args)
    10191020                            if Skip:
    10201021                                break
  • trunk/docs/source/packages.rst

    r4658 r5020  
    5151  GSAS-II to download updates to our code.
    5252
    53 
    5453Scripting  Requirements
    5554-----------------------
     
    6564http://www.pythonware.com/products/pil/), or h5py + hdf5 to function
    6665but scripts will load and run without these.
     66
     67
     68External and Supplied Programs
     69--------------------------------
     70
     71GSAS-II provides interfaces to use a number of programs developed by
     72others. Some are included with GSAS-II and others must be installed
     73separately. When these programs are accessed, citation
     74information is provided.
     75
     76GSAS-II includes copies of these programs:
     77
     78  **DIFFaX**
     79    Simulate layered structures with faulting
     80   
     81  **CifFile**
     82    A software library used to read data and structures from CIF
     83   
     84  **Shapes**
     85    Model small angle scattering with shaped particles
     86   
     87  **NIST FPA**
     88    Use Fundamental Parameters to determine GSAS-II profile function
     89
     90No additional steps beyond a standard installation
     91are needed to access their functionality.
     92
     93**Bilboa Crystallographic Server**: GSAS-II directly access the
     94Bilboa Crystallographic Server (provided
     95the computer has internet access). This allows automated use of the
     96k-SUBGROUPSMAG, k-SUBGROUPS and PseudoLattice web utilities for
     97computation of space group subgroups, color (magnetic) subgroups &
     98lattice search.
     99
     100At the request of the program authors, these programs are not included
     101with GSAS-II and must be installed separately:
     102
     103  **RMCProfile**
     104    Large-box PDF & S(Q) fitting. We have heard from users that V6.7.7
     105    of RMCProfile is compatible with the input created by GSAS-II,
     106    but not V6.7.9.
     107
     108  **fullrmc**
     109    A modern software toolkit for large-box PDF & S(Q) fitting. Use
     110    version 5.0 or later.
     111
     112  **Dysnomia**
     113    Computes enhanced Fourier maps with Maximum Entropy estimated
     114    extension of reflection sphere
Note: See TracChangeset for help on using the changeset viewer.