本文整理匯總了Python中mantid.geometry.SpaceGroupFactory.isSubscribedSymbol方法的典型用法代碼示例。如果您正苦於以下問題:Python SpaceGroupFactory.isSubscribedSymbol方法的具體用法?Python SpaceGroupFactory.isSubscribedSymbol怎麽用?Python SpaceGroupFactory.isSubscribedSymbol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mantid.geometry.SpaceGroupFactory
的用法示例。
在下文中一共展示了SpaceGroupFactory.isSubscribedSymbol方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _generate_UBList
# 需要導入模塊: from mantid.geometry import SpaceGroupFactory [as 別名]
# 或者: from mantid.geometry.SpaceGroupFactory import isSubscribedSymbol [as 別名]
def _generate_UBList(self):
CreateSingleValuedWorkspace(OutputWorkspace='__ub')
LoadIsawUB('__ub',self.getProperty("UBMatrix").value)
ub=mtd['__ub'].sample().getOrientedLattice().getUB().copy()
DeleteWorkspace(Workspace='__ub')
symOps = self.getProperty("SymmetryOps").value
if symOps:
try:
symOps = SpaceGroupFactory.subscribedSpaceGroupSymbols(int(symOps))[0]
except ValueError:
pass
if SpaceGroupFactory.isSubscribedSymbol(symOps):
symOps = SpaceGroupFactory.createSpaceGroup(symOps).getSymmetryOperations()
else:
symOps = SymmetryOperationFactory.createSymOps(symOps)
logger.information('Using symmetries: '+str([sym.getIdentifier() for sym in symOps]))
ub_list=[]
for sym in symOps:
UBtrans = np.zeros((3,3))
UBtrans[0] = sym.transformHKL([1,0,0])
UBtrans[1] = sym.transformHKL([0,1,0])
UBtrans[2] = sym.transformHKL([0,0,1])
UBtrans=np.matrix(UBtrans.T)
ub_list.append(ub*UBtrans)
return ub_list
else:
return [ub]
示例2: validateInputs
# 需要導入模塊: from mantid.geometry import SpaceGroupFactory [as 別名]
# 或者: from mantid.geometry.SpaceGroupFactory import isSubscribedSymbol [as 別名]
def validateInputs(self):
issues = dict()
inWS = self.getProperty("InputWorkspace").value
dimX=inWS.getXDimension()
dimY=inWS.getYDimension()
dimZ=inWS.getZDimension()
if dimX.name != '[H,0,0]' or dimY.name != '[0,K,0]' or dimZ.name != '[0,0,L]':
issues['InputWorkspace'] = 'dimensions must be [H,0,0], [0,K,0] and [0,0,L]'
for d in range(inWS.getNumDims()):
dim = inWS.getDimension(d)
if not np.isclose(dim.getMaximum(), -dim.getMinimum(), atol=1e-5):
issues['InputWorkspace'] = 'dimensions must be centered on zero'
if self.getProperty("Convolution").value and self.getProperty("Method").value == 'Punch and fill':
try:
import astropy # noqa
except ImportError:
issues["Convolution"] = 'python-astropy required to do convolution'
size = self.getProperty("Size").value
if len(size) != 1 and len(size) != 3:
issues["Size"] = 'Must provide 1 or 3 sizes'
if self.getProperty("SpaceGroup").value:
space_group=self.getProperty("SpaceGroup").value
try:
if not SpaceGroupFactory.isSubscribedNumber(int(space_group)):
issues["SpaceGroup"] = 'Space group number is not valid'
except ValueError:
if not SpaceGroupFactory.isSubscribedSymbol(space_group):
issues["SpaceGroup"] = 'Space group name is not valid'
sphereMin = self.getProperty("SphereMin").value
if len(sphereMin) != 1 and len(sphereMin) != 3:
issues["SphereMin"] = 'Must provide 1 or 3 diameters'
sphereMax = self.getProperty("SphereMax").value
if len(sphereMax) != 1 and len(sphereMax) != 3:
issues["SphereMax"] = 'Must provide 1 or 3 diameters'
if self.getProperty("WindowFunction").value == 'Tukey':
try:
ssignal.tukey
except AttributeError:
issues["WindowFunction"] = 'Tukey window requires scipy >= 0.16.0'
return issues
示例3: validateInputs
# 需要導入模塊: from mantid.geometry import SpaceGroupFactory [as 別名]
# 或者: from mantid.geometry.SpaceGroupFactory import isSubscribedSymbol [as 別名]
def validateInputs(self):
issues = dict()
if self.getProperty("SymmetryOps").value:
syms=self.getProperty("SymmetryOps").value
try:
if not SpaceGroupFactory.isSubscribedNumber(int(syms)):
issues["SymmetryOps"] = 'Space group number '+syms+' is not valid'
except ValueError:
if not SpaceGroupFactory.isSubscribedSymbol(syms):
for sym in syms.split(';'):
if not SymmetryOperationFactory.exists(sym):
issues["SymmetryOps"] = sym+' is not valid symmetry or space group name'
return issues