本文整理匯總了Python中larch.Group.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Group.__init__方法的具體用法?Python Group.__init__怎麽用?Python Group.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類larch.Group
的用法示例。
在下文中一共展示了Group.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, filename=None, _larch=None,
label=None, s02=None, degen=None, e0=None,
ei=None, deltar=None, sigma2=None,
third=None, fourth=None, **kws):
kwargs = dict(name='FeffPath: %s' % filename)
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = _larch
self.filename = filename
def_degen = 1
if filename is not None:
self._feffdat = FeffDatFile(filename=filename, _larch=_larch)
self.geom = self._feffdat.geom
def_degen = self._feffdat.degen
self.degen = degen if degen is not None else def_degen
self.label = label if label is not None else filename
self.s02 = 1 if s02 is None else s02
self.e0 = 0 if e0 is None else e0
self.ei = 0 if ei is None else ei
self.deltar = 0 if deltar is None else deltar
self.sigma2 = 0 if sigma2 is None else sigma2
self.third = 0 if third is None else third
self.fourth = 0 if fourth is None else fourth
self.k = None
self.chi = None
示例2: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, folder=None, _larch=None, **kws):
kwargs = dict(name='Feff85exafs unit test: %s' % folder)
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = Interpreter()
self.doplot = True
self.doscf = False # True = use self-consistency
self.verbose = True # True = print Feff's screen messages and other screenmessages
self.feffran = False # True = Feff calculation has been run
self.count = 0
self.feffcount = 0
self.datacount = 0
self.failed = list()
self.folder = folder
if self.folder[-1] == '/': self.folder = self.folder[:-1]
self.testrun = realpath(join(self.folder, 'testrun'))
self.testpaths()
if not isdir(folder):
print colored(folder + " is not one of the available tests", 'magenta', attrs=['bold'])
return None
self.path = realpath(folder)
self.repotop = realpath(join('..','..'))
# the f85e shell script emulates the behavior of the monolithic Feff application
self.f85escript = join(self.repotop, 'bin', 'f85e')
self.epsilon = 0.00001
self.epsfit = 0.001
self.wrapper_available = wrapper_available
if wrapper_available:
self.sp = scatpath()
示例3: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, kmin=0, kmax=20, kweight=2, dk=4, dk2=None,
window='kaiser', nfft=2048, kstep=0.05,
rmin = 0, rmax=10, dr=0, dr2=None, rwindow='hanning',
fitspace='r', wavelet_mask=None, _larch=None, **kws):
Group.__init__(self, **kws)
self.kmin = kmin
self.kmax = kmax
self.kweight = kweight
if 'kw' in kws:
self.kweight = kws['kw']
self.dk = dk
self.dk2 = dk2
self.window = window
self.rmin = rmin
self.rmax = rmax
self.dr = dr
self.dr2 = dr2
if dr2 is None: self.dr2 = self.dr
self.rwindow = rwindow
self.__nfft = 0
self.__kstep = None
self.nfft = nfft
self.kstep = kstep
self.rstep = pi/(self.kstep*self.nfft)
self.fitspace = fitspace
self.wavelet_mask = wavelet_mask
self._cauchymask = None
self._larch = _larch
self.kwin = None
self.rwin = None
self.make_karrays()
示例4: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, folder=None, _larch=None, **kws):
kwargs = dict(name='FeffPath wrapper')
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = Interpreter()
self.wrapper = feffpathwrapper.FEFFPATH()
feffpathwrapper.create_path(self.wrapper)
self.wrapper.phpad = ''
self.ipot = []
self.rat = []
self.geom = []
示例5: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, name=None, shape='gaussian',
amplitude=1, center=0, sigma=1,
sigma_params=None, **kws):
kwargs = {'name': name}
kwargs.update(kws)
self.amplitude = amplitude
self.center = center
self.sigma = sigma
Group.__init__(self)
self.name = name
if name is not None:
self._define(name, shape=shape,
sigma_params=sigma_params)
示例6: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, energy=None, mu=None, z=None, edge='K', mback_kws=None, _larch=None, **kws):
kwargs = dict(name='diffKK')
kwargs.update(kws)
Group.__init__(self, **kwargs)
self.energy = energy
self.mu = mu
self.z = z
self.edge = edge
self.mback_kws = mback_kws
if _larch == None:
self._larch = Interpreter()
else:
self._larch = _larch
示例7: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, filename='spykscan.001', configfile=None,
auto_increment=True, _larch=None, **kwargs):
Group.__init__(self, **kwargs)
self.motors = {}
self.detectors = []
self.bare_counters = []
self._scan = LarchStepScan(filename=filename,
auto_increment=auto_increment,
_larch=_larch)
self.datafilename = filename
if configfile is not None:
self.configfile = configfile
self.read_config(filename=configfile)
self.lup = self.dscan
示例8: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, filename=None, bad=None, **kws):
kwargs = {'name': 'GSE MCA File: %s' % filename}
kwargs.update(kws)
Group.__init__(self, **kwargs)
self.mcas = []
self.__mca0 = None
self.bad = bad
if bad is None:
self.bad = []
self.filename = filename
if filename:
self.read(filename=filename)
示例9: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, feffinp=None, verbose=True, repo=None, _larch=None, **kws):
kwargs = dict(name='Feff runner')
kwargs.update(kws)
Group.__init__(self, **kwargs)
if _larch == None:
self._larch = Interpreter()
else:
self._larch = _larch
self.feffinp = feffinp
self.verbose = verbose
self.mpse = False
self.repo = repo
self.resolved = None
self.threshold = []
self.chargetransfer = []
示例10: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, feffinp='feff.inp', folder=None, verbose=True,
repo=None, _larch=None, **kws):
kwargs = dict(name='Feff runner')
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = _larch
self.folder = folder or '.'
self.feffinp = feffinp
self.verbose = verbose
self.mpse = False
self.repo = repo
self.resolved = None
self.threshold = []
self.chargetransfer = []
示例11: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, data=None, pathlist=None, transform=None,
_larch=None, **kws):
self._larch = _larch
Group.__init__(self, **kws)
self.pathlist = pathlist
self.data = data
if transform is None:
transform = TransformGroup()
self.transform = transform
self.model = Group()
self.model.k = None
self.__chi = None
self.__prepared = False
示例12: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, data2D=None, xpixels=2048, ypixels=2048,
data1D=None, nwedge=2, nchan=5001,
name='xrd',**kws):
self.name = name
self.xpix = xpixels
self.ypix = ypixels
self.data2D = data2D
self.nwedge = nwedge
self.nchan = nchan
self.data1D = data1D
## Also include calibration data file?
## mkak 2016.08.20
Group.__init__(self)
示例13: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, left=0, right=0, name='', bgr_width=3, counts=None,
address=''):
"""
Parameters:
-----------
* left Left limit in index/channels numbers
* right Right limit in index/channels numbers
* name Name of the ROI
* bgr_width Number of channels to use for background subtraction
"""
self.name = name
self.address = address
self.bgr_width = int(bgr_width)
self.total = 0
self.net = 0
self.set_bounds(left, right)
if counts is not None:
self.get_counts(counts)
Group.__init__(self)
示例14: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, folder=None, _larch=None, **kws):
kwargs = dict(name='Feff85exafs unit test: %s' % folder)
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = Interpreter()
self.doplot = True
self.doscf = False # True = use self-consistency
self.verbose = True # True = print Feff's screen messages and other screen messages
self.feffran = False # True = Feff calculation has been run
self.count = 0
self.feffcount = 0
self.datacount = 0
self.failed = list()
if folder[-1] == '/': folder = folder[:-1] # strip trailing /
self.folder = folder
if not isdir(folder):
folder = join('tests', folder)
if not isdir(folder):
print_error(folder + " isn't one of the available tests")
return None
self.path = realpath(folder)
self.testrun = realpath(join(self.path, 'testrun'))
self.fefflog = realpath(join(self.path, 'testrun', 'feff8l.log'))
self.__testpaths()
self.repotop = getcwd()
if not self.repotop.endswith('feff85exafs'): self.repotop = realpath(join('..'))
# the f85e shell script emulates the behavior of the monolithic Feff application
self.eps5 = 0.00001
self.eps4 = 0.0001
self.eps3 = 0.001
self.epsilon = self.eps4
self.epsfit = self.eps3
self.epserr = 5.0 * self.epsfit
self.firstshell = False
self.fittest = None
if WRAPPER_AVAILABLE:
self.sp = Feff8L_XAFSPath(_larch=self._larch)
示例15: __init__
# 需要導入模塊: from larch import Group [as 別名]
# 或者: from larch.Group import __init__ [as 別名]
def __init__(self, _larch=None, **kws):
kwargs = dict(name='Feff test framework')
kwargs.update(kws)
Group.__init__(self, **kwargs)
self._larch = Interpreter()
self.materials = ("Copper", "NiO", "FeS2", "UO2", "BaZrO3", "bromoadamantane", "uranyl")
self.tests = ('scf', 'iorder', 'mpse')
self.__material = None
self.__test = None
self.testmodule = None
self.json = None
self.mustache = None
self.dryrun = False
self.dopathfinder = False
self.tableformat = 'pipe' # 'plain', 'simple', 'grid', 'fancy_grid', 'pipe', 'orgtbl'
# 'rst', 'mediawiki', 'html', 'latex', 'latex_booktabs'
## some things to make the cohabitation with f85ut happy
self.doplot = False
self.verbose = False
self.firstshell = False
self.folder = None
self.path = None