Hi Ray, As of right now, it does not appear that I have written an API to set the model type and parameters for preferred orientation. GSASIIscriptable only is able to turn on and off the refinement flag. This does not mean it can’t be done, but it needs some special attention. You can use phase.getHAPvalues() (https://gsas-ii.readthedocs.io/en/latest/GSASIIscriptable.html#GSASIIscriptable.G2Phase.getHAPvalues) on an .gpx file edited with the GUI to see the dict with all the parameter values so you can see what you want to change and then use .setHAPentryValue (or modify the dict directly) to make the changes.
What you want is something that probably should be implemented, but my recollection is that it is not a simple task, as the Laue group for a phase determines now many terms are allowed for a given SH order and that means to implement a generalized scripting routine that allows one to set the SH order requires creating access to a bunch of routines currently only implemented in the GUI. I know I am not going to get to that anytime soon, but f important to your work keep asking iand I’ll add it to my to do list. Brian On Aug 18, 2022, at 1:13 PM, Gunawidjaja, Ray via GSAS-II <[email protected]<mailto:[email protected]>> wrote: Hello, I am trying to include preferred orientation refinement into the example script below (in red font), but can’t find the right command on the website (https://gsas-ii.readthedocs.io/en/latest/). I would like to achieve the same result as selecting the Spherical harmonics Preferred orientation model with, e.g., a harmonic order of 2 in the Data table in GSASII GUI. to Please help. from __future__ import division, print_function import os,sys sys.path.insert(0,'/Users/toby/software/G2/GSASII') # needed to "find" GSAS-II modules import GSASIIscriptable as G2sc datadir = "/Users/Scratch/" gpx = G2sc.G2Project(os.path.join(datadir,'test2.gpx')) gpx.histogram(0).add_back_peak(4.5,30000,5000,0) pardict = {'set': {'Sample Parameters': ['Absorption', 'Contrast', 'DisplaceX'], 'Background': {'type': 'chebyschev-1', 'refine': True, 'peaks':[[0,True]]}, 'Pref.Ori. ':{ 'type': 'SH', ???????} }} gpx.set_refinement(pardict) I appreciate your help. Thanks, Ray _______________________________________________ GSAS-II mailing list [email protected]<mailto:[email protected]> https://mailman.aps.anl.gov/mailman/listinfo/gsas-ii
_______________________________________________ GSAS-II mailing list [email protected] https://mailman.aps.anl.gov/mailman/listinfo/gsas-ii
