本文整理汇总了Python中pyview.lib.datacube.Datacube.removeChild方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.removeChild方法的具体用法?Python Datacube.removeChild怎么用?Python Datacube.removeChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyview.lib.datacube.Datacube
的用法示例。
在下文中一共展示了Datacube.removeChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DataManager
# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import removeChild [as 别名]
filename = "qubit_chip_sonnet_model.csv"
dataManager = DataManager()
file = open(filename,"rb")
content = file.read()
file.close()
lines = content.split("\n")
curves = Datacube("curves")
dataManager.clear()
dataManager.addDatacube(curves)
i = 0
curve = None
while i < len(lines):
elements = lines[i].split(",")
if re.search("l1=(\d+\.\d+)",lines[i],re.I):
if curve != None and len(curve) == 0:
curves.removeChild(curve)
print lines[i]
lq = float(re.search("l1=(\d+\.\d+)",lines[i],re.I).group(1))
print lq
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")