本文整理汇总了Python中Analysis.makeLSQspline方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.makeLSQspline方法的具体用法?Python Analysis.makeLSQspline怎么用?Python Analysis.makeLSQspline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis.makeLSQspline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mean
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import makeLSQspline [as 别名]
print mean(sqrt(diffxs**2 + diffys**2))
if opts.map2:
xds, yds = mapping2(goodxs, goodys)
goodxs += xds/opts.pxsize
goodys += yds/opts.pxsize
diffxs = (xls[sel] - goodxs) * opts.pxsize
diffys = (yls[sel] - goodys) * opts.pxsize
print "In the second round, those colocalized at an error of",
print mean(sqrt(diffxs**2 + diffys**2))
else:
if opts.save_map2 \
or raw_input('Save Second Pass? y/[n]').lower()[0] == 'y':
Analysis.makeLSQspline(diffxs, diffys, goodxs, goodys,
savefile= 'offsets'+os.path.basename(fname),
n = floor(max(2,sqrt(len(goodys)/10))))
if len(goodxs):
goodxf = [goodxs[0]]
goodyf = [goodys[0]]
diffxf = [diffxs[0]]
diffyf = [diffys[0]]
print "Selecting low density..."
for goodx, goody, diffx, diffy in zip(goodxs, goodys, diffxs, diffys):
if min(sqrt((goodx - array(goodxf))**2 + (goody - array(goodyf))**2)) > opts.quiv_dist:
goodxf.append(goodx)
goodyf.append(goody)
diffxf.append(diffx)
示例2: IPShellEmbed
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import makeLSQspline [as 别名]
else:
xl = xld[sel]
yl = yld[sel]
xr = xrd[sel]
yr = yrd[sel]
if opts.interact:
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed([], banner="\a\a\aEntering Interpreter")
print "\a\a\a"
ipshell()
############################## Make the Spline #######################
# print "Splining!"
mapping = Analysis.makeLSQspline(xl, yl, xr, yr, n=opts.n, savefile=fname + "_1", multi=opts.multi)
############################## Evaluate spline quality ###############
# print "applying on all good data"
xn, yn = mapping(xrd[sel], yrd[sel])
diffx = xld[sel] - xn
diffy = yld[sel] - yn
diffmag = sqrt(diffx ** 2 + diffy ** 2)
diffmags = sorted(diffmag)
print "Median: ", median(diffmag), "1%", diffmags[int(0.01 * len(diffmags))], "5%", diffmags[
int(0.05 * len(diffmags))
], "10%", diffmags[int(0.10 * len(diffmags))], "20%", diffmags[int(0.20 * len(diffmags))], "30%", diffmags[
int(0.30 * len(diffmags))
], "40%", diffmags[
int(0.40 * len(diffmags))
], "60%", diffmags[