本文整理汇总了Python中Analysis.middle_percent方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.middle_percent方法的具体用法?Python Analysis.middle_percent怎么用?Python Analysis.middle_percent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis.middle_percent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadmat
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import middle_percent [as 别名]
D = loadmat(filename, squeeze_me=True, struct_as_record=True)
xld = D["xl"]
yld = D["yl"]
xrd = D["xr"]
yrd = D["yr"]
varl = D["varxl"]
varr = D["varxr"]
del D
################################ Filter the Data ######################
# Get rid of anything where the width of the fit is too far
# outside of norms
varllo, varlhi = Analysis.middle_percent(abs(varl), 0.02)
varrlo, varrhi = Analysis.middle_percent(abs(varr), 0.02)
print "Variance tolerance left:", varllo, varlhi
print "Variance tolerance right:", varrlo, varrhi
var_sel = (varllo <= abs(varl)) * (abs(varl) <= varlhi) * (varrlo <= abs(varr)) * (abs(varr) <= varrhi)
stepper = rand(len(xld)) < frac
if opts.trim_edge: # Trim the outside border (where points are less reliable)
xlo, xhi = Analysis.middle_percent(xld, 0.02)
ylo, yhi = Analysis.middle_percent(yld, 0.02)
selA = (xlo < xld) * (xld < xhi) * (ylo < yld) * (yld < yhi)
# Get rid of anything where the match isn't actually that good.
xdiff = median(xld - xrd)
ydiff = median(yld - yrd)