[GSAS-II] GSASII scriptable global scale factor

Meusburger, Johannes M. (ARC-STX)[Oak Ridge Associated Universities] johannes.m.meusburger at nasa.gov
Thu Mar 28 19:57:24 CDT 2024


Hi everyone,



I have problems retrieving the global scale factor ':0:Scale' in GSASIIScriptable to calculate the wt% from the phase scale factors.


The standard bit:


import os,sys
sys.path.insert(0,'/Users/Superuser/gsas2full/GSASII')
import GSASIIscriptable as G2sc
workdir = "./"
datadir = "./"

gpx = G2sc.G2Project(filename=f'./output/refinements/test/test.gpx')

hist = gpx.add_powder_histogram(os.path.join(datadir,"./Data/test.csv"),
                          os.path.join(datadir,"./Instrument/IPF.instprm"))

phase = gpx.add_phase(os.path.join(datadir,f'./cif/Phase.cif'),
                      phasename="Phase",fmthint='CIF',
                      histograms=[hist1])

hist.set_refinements({"Background": {"no. coeffs": 3, "refine": False, "coeffs":(5,10,10) },
                      'Sample Parameters': ['Scale'],
                      "Limits": [10, 50]})

gpx.refine()



Now the important part:


'gpx.get_VaryList()' retrieves [':0:Scale'] confirming I have refined the global scale factor



however, when I want to retrieve the value of the global scale factor:  gpx.get_Variable(':0:Scale' )

the following error message shows up:


    test = gpx.get_Variable(':0:Scale')
  File "C:\Users/Superuser/gsas2full/GSASII\GSASIIscriptable.py", line 2800, in get_Variable
    if var not in self['Covariance']['data']['parmDict']:
KeyError: 'parmDict'


Thanks in advance for your help and  fantastic work on GSASII and the scriptable python interface!


All the best,


Johannes

___________________________________________________________

Johannes Meusburger, Ph.D.

NASA Postdoctoral Program Fellow

Exobiology Branch

NASA Ames Research Center


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.aps.anl.gov/pipermail/gsas-ii/attachments/20240329/fb5496ae/attachment-0001.html>


More information about the GSAS-II mailing list