本文整理汇总了Python中myquaternaryutility.QuaternaryPlot.filterbydistancefromline方法的典型用法代码示例。如果您正苦于以下问题:Python QuaternaryPlot.filterbydistancefromline方法的具体用法?Python QuaternaryPlot.filterbydistancefromline怎么用?Python QuaternaryPlot.filterbydistancefromline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myquaternaryutility.QuaternaryPlot
的用法示例。
在下文中一共展示了QuaternaryPlot.filterbydistancefromline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 别名]
pylab.title('PURE ELEMENTS. color=element(CMYK). #=thickness', fontsize=18)
pylab.legend(loc=1)
if 1:
quatxfig=pylab.figure()
quatx=QuaternaryPlot(111, ellabels=ellabels, offset=0)
cbax=quatxfig.add_axes((.83, .3, .04, .4))
quatx.label()
compverts=[[.5,.5, 0, 0], [.5, 0, .5, 0], [0, 0, .1, .9]]
calctype=1
critdist=.05
betweenbool=1
invertbool=0
if calctype==0:
selectinds, distfromlin, lineparameter=quatx.filterbydistancefromline(compsall[code0inds], compverts[0], compverts[1], critdist, betweenpoints=betweenbool, invlogic=invertbool, returnall=True)
lineparameter=lineparameter[selectinds]
elif calctype==1:
selectinds, distfromplane, xyparr, xyp_verts,intriangle=quatx.filterbydistancefromplane(compsall[code0inds], compverts[0], compverts[1], compverts[2], critdist, withintriangle=betweenbool, invlogic=invertbool, returnall=True)
xyparr=xyparr[selectinds]
fomselectx=fomall[code0inds][selectinds]
compsselectx=compsall[code0inds][selectinds]
xsecfig=pylab.figure()
xsecax=pylab.subplot(111)
if calctype==0:
quatx.line(compverts[0], compverts[1])
quatx.plotfomalonglineparameter(xsecax, lineparameter, fomselectx, compend1=compverts[0], compend2=compverts[1], lineparticks=numpy.linspace(0, 1, 4), ls='none', marker='.')
elif calctype==1:
quatx.plotfominselectedplane(xsecax, xyparr, fomselectx, xyp_verts=xyp_verts, vertcomps_labels=[compverts[0], compverts[1], compverts[2]], s=20, edgecolor='none', cmap=cmap, norm=norm)
示例2: len
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 别名]
platesdlist=[]
plotcomps=[]
lined={}
lined['distfromlin']=[]
lined['lineparameter']=[]
lined['compend1']=compend1
lined['compend2']=compend2
lined['critdist']=critdist
lined['betweenpoints']=betweenpoints
for p in pl:
f=open(p, mode='r')
dlist=pickle.load(f)
f.close()
comps=numpy.array([d['compositions'] for d in dlist])
inds, distfromlin, lineparameter=stpq.filterbydistancefromline(comps, compend1, compend2, critdist, betweenpoints=betweenpoints, invlogic=False, returnall=True)
platesdlist+=[dlist[i] for i in inds]
plotcomps+=list(comps[inds])
lined['distfromlin']+=list(distfromlin[inds])
lined['lineparameter']+=list(lineparameter[inds])
print len(inds), ' points'
smpls=[d['Sample'] for d in platesdlist]
s='\n'.join(['%d' %x for x in smpls])
lined['distfromlin']=numpy.array(lined['distfromlin'])
lined['lineparameter']=numpy.array(lined['lineparameter'])
if 1:
f=open(savep, mode='w')
pickle.dump(platesdlist, f)
示例3: quatsliceDialog
# 需要导入模块: from myquaternaryutility import QuaternaryPlot [as 别名]
# 或者: from myquaternaryutility.QuaternaryPlot import filterbydistancefromline [as 别名]
#.........这里部分代码省略.........
self.ellabels = self.dataclass.ellabels
self.vminmaxLineEdit.setText(` self.dataclass.vmin ` + "," + ` self.dataclass.vmax `)
for le, v in zip(
[self.belowrangecolLineEdit, self.aboverangecolLineEdit],
[self.dataclass.belowrangecolstr, self.dataclass.aboverangecolstr],
):
le.setText(` v `)
i0 = self.ternskipComboBox.currentIndex()
self.ternskipComboBox.clear()
for i, l in enumerate(self.ellabels):
self.ternskipComboBox.insertItem(i, l)
self.ternskipComboBox.setCurrentIndex(i0)
self.calctype = self.compcutComboBox.currentIndex()
critdist = self.critdistSpinBox.value()
print "1"
self.compverts = []
for i in range(2 + self.calctype):
sl = str(self.complineeditlist[i].text()).split(",")
c = [myeval(s.strip()) for s in sl]
c = c[:4]
c += [0.0] * (4 - len(c))
c = numpy.float64(c)
c /= c.sum()
self.compverts += [c]
betweenbool = self.compboundCheckBox.isChecked()
invertbool = self.invertCheckBox.isChecked()
if self.calctype == 0:
self.selectinds, distfromlin, self.lineparameter = self.quatcalc.filterbydistancefromline(
self.comps,
self.compverts[0],
self.compverts[1],
critdist,
betweenpoints=betweenbool,
invlogic=invertbool,
returnall=True,
)
self.lineparameter = self.lineparameter[self.selectinds]
elif self.calctype == 1:
self.selectinds, distfromplane, self.xyparr, self.xyp_verts, intriangle = self.quatcalc.filterbydistancefromplane(
self.comps,
self.compverts[0],
self.compverts[1],
self.compverts[2],
critdist,
withintriangle=betweenbool,
invlogic=invertbool,
returnall=True,
)
self.xyparr = self.xyparr[self.selectinds]
self.selectcomps = self.comps[self.selectinds]
self.plot()
def plot(self):
s = 25
self.plotw_tern.axes.cla()
self.plotw_quat.axes.cla()
self.cbax_quat.cla()
self.cbax_tern.cla()
fom = self.fom