本文整理汇总了Python中pyview.lib.datacube.Datacube.children方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.children方法的具体用法?Python Datacube.children怎么用?Python Datacube.children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyview.lib.datacube.Datacube
的用法示例。
在下文中一共展示了Datacube.children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Datacube
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import children [as 别名]
titleString = "2 Qubit Anticrossing"
outputFilename = "anticrossing"
dataFile = r"data/Spectroscopy Survey - qubit1-7.txt"
print "Loading data..."
datacube = Datacube()
datacube.loadtxt(dataFile)
##
from numpy import *
from numpy.linalg import *
m1 = zeros((len(datacube.children()[0]),len(datacube)))
m2 = zeros((len(datacube.children()[0]),len(datacube)))
for i,child in enumerate(datacube.children()):
m1[:,i] = child["p1x"]
m2[:,i] = child["px1"]
##Generate a model of the qubit anticrossing
def tensor(a,b):
return kron(b,a)
idatom = matrix(eye(2))
H_1 = lambda f1:tensor(matrix([[-f1/2.,0],[0,f1/2.]]),idatom)
H_2 = lambda f2:tensor(idatom,matrix([[-f2/2.,0],[0,f2/2.]]))
示例2: len
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import children [as 别名]
i+=2
if i >= len(lines):
break
curve = Datacube("l1 = %g nH" % lq)
curves.addChild(curve,lq = lq)
curve.parameters()["defaultPlot"] = [("freq","mag")]
elif len(elements) == 2:
(freq,mag) = map(lambda x:float(x),lines[i].split(","))
curve.set(freq = freq,mag = mag)
curve.commit()
i+=1
curves.savetxt("sonnet_model")
##
import os
from numpy import *
m = zeros((len(curves.children()[0]),len(curves.children())))
i = 0
for child in curves.children():
print mean(child["mag"]),max(child["mag"])
m[:,i] = child["mag"]
i+=1
m = m [::-1]
figure(10)
clf()
hsv()
imshow(m,aspect = 'auto',interpolation = 'bilinear',extent = (curves.attributesOfChild(curves.children()[0])["lq"],curves.attributesOfChild(curves.children()[-1])["lq"],child["freq"][0],child["freq"][-1]))
ticklabel_format(style = 'plain',axis = 'y',useOffset = False)
#figtext(0.1,0.95,os.getcwd()+"/"+filename,size = 7)
#ylim(11,12)
#xlim(2,2.3)
xlabel("$L_{qb}$ [nH]")