def topological_defect_array(orientation_field):
"""
Returns a matrix of topological defects for the given orientation field.
Each entry in the matrix is the charge of the defect.
"""
JX = np.diff(orientation_field, axis=0)
JY = np.diff(orientation_field, axis=1)
JX += math.pi * (JX < -math.pi/2.0 ) - math.pi * (JX > math.pi/2.0)
JY += math.pi * (JY < -math.pi/2.0 ) - math.pi * (JY > math.pi/2.0)
return np.rint((np.diff(JY, axis=0) - np.diff(JX, axis=1))/math.pi)
standard_analysis.py 文件源码
python
阅读 42
收藏 0
点赞 0
评论 0
评论列表
文章目录