hexrd.gridutil module
- hexrd.gridutil.cellConnectivity(m, n, p=1, origin='ul')[source]
p x m x n (layers x rows x cols)
origin can be upper left – ‘ul’ <default> or lower left – ‘ll’
choice will affect handedness (cw or ccw)
- hexrd.gridutil.cellIndices(edges, points_1d)[source]
get indices in a 1-d regular grid.
edges are just that:
above the deltas are + and the index for the point is 1
here the deltas are - and the index for the point is 2
can handle grids with +/- deltas
be careful when using with a cyclical angular array! edges and points must be mapped to the same branch cut, and abs(edges[0] - edges[-1]) = 2*pi
- hexrd.gridutil.computeIntersection(line1, line2)[source]
compute intersection of two-dimensional line intersection
this is an implementation of two lines:
line1 = [ [x0, y0], [x1, y1] ] line1 = [ [x3, y3], [x4, y4] ]