当前位置: 首页>>代码示例>>Python>>正文


Python Analysis.loadmapping方法代码示例

本文整理汇总了Python中Analysis.loadmapping方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.loadmapping方法的具体用法?Python Analysis.loadmapping怎么用?Python Analysis.loadmapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Analysis的用法示例。


在下文中一共展示了Analysis.loadmapping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: len

# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import loadmapping [as 别名]
             help = "Maximum allowed inter-color colocalization distance",
             default = 100, type = "float")
 parser.add_option('-q', '--quiet', dest = "quiet", 
             action = "store_true", default = False)
 parser.add_option('-d', '--quiver-distance', dest="quiv_dist", 
             help = "Minimum distance between points on the quiver map",
             default = 10)
 opts, args = parser.parse_args()
 
 
 if not opts.map:
     if opts.x1 and opts.x2 and opts.y1 and opts.y2:
         opts.xshift = opts.x2 - opts.x1
         opts.yshift = opts.y2 - opts.y1
 else:
     mapping = Analysis.loadmapping(opts.map)
 
 if opts.map2:
     mapping2 = Analysis.loadmapping(opts.map2)
 
 if len(args) == 1 and '*' in args[0]:
     args = glob(args[0])
 
 print "Found this many files", len(args)
 xrs = []
 xls = []
 yrs = []
 yls = []
 varxrs = []
 varxls = []
 for fname in args:
开发者ID:petercombs,项目名称:YildizLabCode,代码行数:33,代码来源:CombineMatlabSpots.py

示例2: mapping

# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import loadmapping [as 别名]
import Analysis, sys, math, numpy as np, pylab

mapping = Analysis.loadmapping(sys.argv[1])


num_rows = 256
num_cols = 512
colors = np.zeros((256,512,3))

starty = np.random.rand(1,100)*150 + 50
startx = np.random.rand(1,100)*400 + 50
endx, endy = mapping(startx, starty)

base_shift_x = 256 # (endx - startx).mean()
base_shift_y = 512 # (endy - starty).mean()


for x in range(num_cols):
    for y in range(num_rows):
        newx, newy = mapping(x,y)
        sat = 1
        hue = (90 + 180 / math.pi * math.atan2(newy - base_shift_y, newx - base_shift_x)) % 360
        val = min(.001 * math.sqrt((newy - base_shift_y)**2 + (newx - base_shift_x)**2), 1)

        hueprm = hue / 60
        C = val * sat
        X = C * (1 - abs((hueprm %2) -1 ))
        
        if hueprm < 1: r1, g1, b1 = C, X, 0
        elif hueprm < 2: r1, g1, b1 = X, C, 0
        elif hueprm < 3: r1, g1, b1 = X, C, 0
开发者ID:petercombs,项目名称:YildizLabCode,代码行数:33,代码来源:DrawMap.py


注:本文中的Analysis.loadmapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。