Beispiel #1
0
Python script for running multiple refinements in GSAS II
Main script

@author: Joel Eugênio Cordeiro Junior
last updated on: 3/1/2020

"""

import os, sys
import shutil
from config import *
sys.path.insert(0, GSPATH)
import GSASIIscriptable as G2sc

# set verbosity level
G2sc.SetPrintLevel('warn')

# ----------------------------------------------
# Create projects
# ----------------------------------------------

# select powder data files
powders = []
for file in os.listdir(INDIR):
    if file.lower().endswith(PWDEXT):
        powders.append(file)

# sort list of powder files by name
powders.sort()

# select phase files
    gsasii_temp_dir = tempfile.gettempdir()

sys.path.insert(0, gsasii_dirname)

project_file = os.path.join(gsasii_temp_dir, "temp.gpx")

from PyQt5.QtCore import Qt, QSettings

GSASII_MODE_ONLINE = 0
GSASII_MODE_EXTERNAL = 1

try:
    import GSASIIscriptable as G2sc

    G2sc.SetPrintLevel("none")

    print("GSAS-II found in ", gsasii_dirname)
except Exception as e:
    print("GSAS-II not available")


class GSASIIReflectionData:
    def __init__(self, h, k, l, pos, multiplicity, F2):
        self.h = int(h)
        self.k = int(k)
        self.l = int(l)
        self.pos = pos
        self.multiplicity = int(multiplicity)
        self.F2 = F2