Exemple #1
0
    def __init__(self, cfgFile=data.materials, matFile=data.all_materials):
        """Constructor for Experiment

        INPUTS

        cfgFile -- name of the config file to use for initialization;
                   an empty string indicates that default values for
                   options are used
        matFile -- name of the materials data file; a real file name
                   is required here
        """
        #
        #  Reader inputs and info
        #
        self.__active_rdr = ReaderInput()
        self.__savedReaders = [self.__active_rdr]
        #
        self.__active_img = None
        self.__curFrame = 0
        self.__numFrame = 0
        #
        #  Load material lists
        #
        self.matList = loadMaterialList(matFile)
        self.activeMaterial = 0
        #
        #  Detector and calibration information.
        #
        self._detInfo = DetectorInfo()
        self._calInput = CalibrationInput(self.matList[0])
        #
        #  Spots information.
        #
        self._spotOpts = SpotOptions()
        self._spots = []
        self._spots_ind = []
        self._spot_readers = []
        #
        #  Index Information
        #
        self._index_opts = IndexOptions()
        self._fitRMats = []
        #
        #  Image Lists
        #
        self._img_list = []
        self._img_names = []
        #
        #  Add hydra interface (not really functional)
        #
        self._hydra = Hydra()

        return
Exemple #2
0
    def __init__(self, cfgFile, matFile):
        """Constructor for Experiment

        INPUTS

        cfgFile -- name of the config file to use for initialization;
                   an empty string indicates that default values for
                   options are used
        matFile -- name of the materials data file; a real file name
                   is required here
        """
        #
        #  Reader inputs and info
        #
        self.__active_rdr   = ReaderInput()
        self.__savedReaders = [self.__active_rdr]
        #
        self.__active_img = None
        self.__curFrame = 0
        self.__numFrame = 0
        #
        #  Load material lists
        #
        self.matList = loadMaterialList(matFile)
        self.activeMaterial = 0
        #
        #  Detector and calibration information.
        #
        self._detInfo  = DetectorInfo()
        self._calInput = CalibrationInput(self.matList[0])
        #
        #  Spots information.
        #
        self._spotOpts = SpotOptions()
        self._spots = []
        self._spots_ind = []
        self._spot_readers = []
        #
        #  Index Information
        #
        self._index_opts = IndexOptions()
        self._fitRMats = []
        #
        #  Image Lists
        #
        self._img_list = []
        self._img_names = []
        #
        #  Add hydra interface (not really functional)
        #
        self._hydra = Hydra()

        return
Exemple #3
0
import numpy as num
import optparse

from hexrd import valunits
from hexrd import orientations as ors

from hexrd.xrd            import grain, xrdutil, detector, spotfinder, indexer
from hexrd.xrd.spotfinder import Spots
from hexrd.xrd.material   import Material, loadMaterialList

# from examples.rubyNIST import planeData
#
## from examples import fe
## planeData = fe.getAlphaPD()
mat_list = loadMaterialList("../hexrd/data/all_materials.cfg")

planeData = mat_list[2].planeData
planeData.exclusions = num.zeros( len(planeData.exclusions), dtype=bool )
planeData.tThMax = 0.17

USAGE = '%s [options]' % __file__ + '\n\n' + usage

'defaults'
degToRad = num.pi/180.
omeMin =  -90.*degToRad
omeMax =   90.*degToRad
nOme   =   360
cutoffMult = 3.0 # to keep things less computationally expensive
threshold = 200 # 20
import numpy as num
import optparse

from hexrd import valunits
from hexrd import orientations as ors

from hexrd.xrd import grain, xrdutil, detector, spotfinder, indexer
from hexrd.xrd.spotfinder import Spots
from hexrd.xrd.material import Material, loadMaterialList

# from examples.rubyNIST import planeData
#
## from examples import fe
## planeData = fe.getAlphaPD()
mat_list = loadMaterialList("../hexrd/data/all_materials.cfg")

planeData = mat_list[2].planeData
planeData.exclusions = num.zeros(len(planeData.exclusions), dtype=bool)
planeData.tThMax = 0.17

USAGE = '%s [options]' % __file__ + '\n\n' + usage

'defaults'
degToRad = num.pi / 180.
omeMin = -90. * degToRad
omeMax = 90. * degToRad
nOme = 360
cutoffMult = 3.0  # to keep things less computationally expensive
threshold = 200  # 20
Exemple #5
0
    maxTTh = float(maxTTh_str)            # in DEGREES
    # if maxTTh_str.strip() == '1' or maxTTh_str.strip().lower() == 'true':
    #     maxTTh = detector.getTThMax()*r2d
    # elif maxTTh_str.strip() != '0' or maxTTh_str.strip().lower() == 'false':
    #     maxTTh = float(maxTTh_str)            # in DEGREES

    # put a block ID on it
    fileroot = analysis_name + '_block_%03d' %blockID
    filename = fileroot + '-spots_%05d.out'

    """
    ####### INITIALIZATION
    """
    # material class
    material_name = parser.get('material', 'material_name')
    matl = material.loadMaterialList(os.path.join(working_dir, material_name+'.ini'))[0]

    # planeData and reader
    pd = matl.planeData
    pd.exclusions = np.zeros_like(pd.exclusions, dtype=bool)
    pd.exclusions = pd.getTTh() >= d2r*maxTTh

    bMat = np.ascontiguousarray(pd.latVecOps['B']) # hexrd convention; necessary to re-cast (?)
    wlen = pd.wavelength                           # Angstroms

    # parameters for detector
    old_par = np.loadtxt(parser.get('detector',   'parfile_name'))
    new_par = np.loadtxt(parser.get('pull_spots', 'parfile_name'))

    detector_params = new_par[:10]