onlineVideos.append('https://anl.box.com/v/MerohedraltwinrefinementinGSAS') onlineVideos.append('https://anl.box.com/v/ParametricFitting') onlineVideos.append('https://anl.box.com/v/SequentialRefinementofSmallAng') onlineVideos.append('https://anl.box.com/v/SequentialTutorial') onlineVideos.append('https://anl.box.com/v/SimpleMagnetic') onlineVideos.append('https://anl.box.com/v/SimTutorial-') onlineVideos.append('https://anl.box.com/v/SmallAngleSizeDistribution') onlineVideos.append('https://anl.box.com/v/StackingFaults-I') onlineVideos.append('https://anl.box.com/v/StartingGSAS') onlineVideos.append('https://anl.box.com/v/Strainfittingof2DdatainGSAS-II') onlineVideos.append('https://anl.box.com/v/Textureanalysisof2DdatainGSAS-') onlineVideos.append('https://anl.box.com/v/TOFSequentialSinglePeakFit') #onlineVideos.append(' if __name__ == '__main__': GSASIIpath.SetBinaryPath() import GSASIIctrlGUI as G2G G2BaseURL = G2G.G2BaseURL tutorialIndex = G2G.tutorialIndex tutURL = G2BaseURL + '/Tutorials' outname = os.path.join(GSASIIpath.path2GSAS2, 'help', 'Tutorials.html') dirList = [l[0] for l in tutorialIndex if len(l) >= 3] # loop through directories in Tutorials repository dirs = [ d[:-1] for d in GSASIIpath.svnList(tutURL, False).split('\n') if d and d[-1] == '/' ] for d in dirs: if d not in dirList:
# idea: select image file type & set filter from that # from __future__ import division, print_function import os import copy import glob import time import re import math import sys import wx import wx.lib.mixins.listctrl as listmix import wx.grid as wg import numpy as np import GSASIIpath GSASIIpath.SetBinaryPath(True) GSASIIpath.SetVersionNumber("$Revision: 4491 $") import GSASIIIO as G2IO import GSASIIctrlGUI as G2G import GSASIIobj as G2obj import GSASIIpy3 as G2py3 import GSASIIimgGUI as G2imG import GSASIIfiles as G2fil import GSASIIscriptable as G2sc import multiprocessing as mp try: # fails during doc build wxMainFrameStyle = wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX except: wxMainFrameStyle = None
def __init__(self, GPXfile=None): ''' Initialize the setup using an existing GPXfile ''' if not GPXfile: # TO DO: Raise name error raise NameError('Must input some GPX file') # Initallizing variables from input file GPXfile G2path.SetBinaryPath() varyList = [] parmDict = {} symmetry = {} Controls = G2stIO.GetControls(GPXfile) calcControls = {} calcControls.update(Controls) constrDict, fixedList = G2stIO.GetConstraints(GPXfile) restraintDict = G2stIO.GetRestraints(GPXfile) Histograms, Phases = G2stIO.GetUsedHistogramsAndPhases(GPXfile) rigidbodyDict = G2stIO.GetRigidBodies(GPXfile) rbIds = rigidbodyDict.get('RBIds', {'Vector': [], 'Residue': []}) rbVary, rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict, Print=False) (Natoms, atomIndx, phaseVary, phaseDict, pawleyLookup, FFtables, BLtables, MFtables, maxSSwave) = G2stIO.GetPhaseData(Phases, restraintDict, rbIds, Print=False) calcControls['atomIndx'] = atomIndx calcControls['Natoms'] = Natoms calcControls['FFtables'] = FFtables calcControls['BLtables'] = BLtables calcControls['MFtables'] = MFtables calcControls['maxSSwave'] = maxSSwave hapVary, hapDict, controlDict = G2stIO.GetHistogramPhaseData( Phases, Histograms, Print=False) calcControls.update(controlDict) histVary, histDict, controlDict = G2stIO.GetHistogramData(Histograms, Print=False) calcControls.update(controlDict) varyList = rbVary + phaseVary + hapVary + histVary parmDict.update(rbDict) parmDict.update(phaseDict) parmDict.update(hapDict) parmDict.update(histDict) G2stIO.GetFprime(calcControls, Histograms) # define phase symmetries, currently only works for one phase phase = G2stIO.GetPhaseNames(GPXfile) phaseData = {} for name in phase: phaseData[name] = G2stIO.GetAllPhaseData(GPXfile, name) symmetry[name] = phaseData[name]['General']['SGData']['SGSys'] # Save the instance parameters self._Histograms = Histograms self._varyList = varyList self._parmDict = parmDict self._Phases = Phases self._calcControls = calcControls self._pawleyLookup = pawleyLookup self._restraintDict = restraintDict self._rigidbodyDict = rigidbodyDict self._rbIds = rbIds self._symmetry = symmetry self._phase = phase try: self._lowerLimit = Histograms[list( Histograms.keys())[0]][u'Limits'][1][0] self._upperLimit = Histograms[list( Histograms.keys())[0]][u'Limits'][1][1] self._tth = Histograms[list(Histograms.keys())[0]]['Data'][0][0:-1] self._tthsample = self._tth[np.where( (self._tth > self._lowerLimit) & (self._tth < self._upperLimit) == True)] # noqa: E712 self._SingleXtal = False except: # noqa: E722 self._tth = None self._MaxDiffSig = None self._Fosq = 0 self._FoSig = 0 self._Fcsq = 0 self._SingleXtal = True