hexrd.ipfcolor.sphere_sector module

hexrd.ipfcolor.sphere_sector.eps = 1.4901161193847656e-08

In this section we will list the vertices of the spherical triangles for each of the point group. this will be in the form of a dictionary conforming to the symbols in unitcell.py

the entries are organized as follows:

key : point group symmetry

entry 0 in list: number of SST triangles needed to specify the fundamental region. this could have values 0, 1 or 2. If it is 0, then the whole sphere is valid (either upper or ower or both depending on symmetry). If this is 1, then only 1 triangle is needed. If two, then two triangles are needed i.e. 4 coordinates

entry 1 in list: specify coordinates of the triangle(s). this will be empty array if size is 0 in previous entry. If size in previous entry is 1, then this will 3x3. Finally if size in previous entry is 2, this will be 3x4.

entry 2 in list is the connectivity of the triangles. This is only useful for the cases of T, Th, O and symmetry groups.

entry 3 in list: if both upper anf lower hemispheres are to be considered. For the case of x-rays only upper hemisphere is considered because of Friedel’s law, which imposes and artificial inversion symmetry such that hkl and -hkl can’t be distinguished. However, for the formulation is general and can handle all symmetry groups. This will say ‘upper’ or ‘both’ depending on what hemisphere is considered.

there are no triangles for the triclininc cases and needs to be handles differently

class hexrd.ipfcolor.sphere_sector.sector(pgsym, lauesym, supergroupsym, supergrouplauesym)[source]

Bases: object

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/28/2020 SS 1.0 original @DETAIL this class is used to store spherical patch for a given point group.

the class also has methods to compute the color of a direction by computing the hue, saturation and lightness values in [0,1]. these values can be converted to rgb for display with the well known conversion formula.

All the methodology and equations have been taken from the paper: Orientations – perfectly colored, G. Nolze and R. Hielscher, J. Appl. Cryst. (2016). 49, 1786–1802

calc_hue(dir3, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/28/2020 SS 1.0 original

11/23/2020 SS 1.2 added mask argument which tell the directions for which the supergroup reductions dont match the point or laue group reductions. mask has size dir3.shape[0] 12/09/2020 SS 2.0 completely rewrite the way in which computation is performed. all the routines have been rewritten

@PARAM dir3 direction in fundamental sector. behavior is undefined if

direction is outside the fundamental sector switch color by laue group or point group? acceptable values are ‘super’, ‘superlaue’

‘super’ —-> point group coloring ‘superlaue’ —-> laue group coloring

@DETAIL calculate hue. this is aggigned based on the azimuthal angle in the stereographic triangle. the laueswitch controls which fundamental sector to use.

calc_lightness(dir3, mask, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/28/2020 SS 1.0 original

11/12/2020 SS 1.1 added laueswitch as argument 11/16/2020 SS 1.2 more balanced lightness key from the JAC paper the factor lambda is hard coded to 1/4 11/23/2020 SS 1.2 added mask argument which tell the directions for which the supergroup reductions dont match the point or laue group reductions. mask has size dir3.shape[0] 12/09/2020 SS 2.0 completely rewrite the way in which computation is performed. all the routines have been rewritten

@PARAM dir3 direction in fundamental sector. behavior is undefined if

laueswitch get colors in laue group or pg mask boolean mask for points where the symmetry reductions donot match the supergroup symmetry reductions

@DETAIL this function is used to calculate the hsl color for direction vectors

in dir3. if laueswitch is True, then color is assigned based on laue group

calc_saturation(l)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/28/2020 SS 1.0 original

11/12/2020 SS 1.1 added laueswitch as argument 11/16/2020 SS 2.0 more balanced saturation from JAC papaer the factor lambda_s is hard coded to 1/4. Since lighness is needed, the function now uses L as an input instead of dir3 to avoid recomputing L 11/23/2020 SS 1.2 added mask argument which tell the directions for which the supergroup reductions dont match the point or laue group reductions. mask has size dir3.shape[0]

@PARAM L lightness values @DETAIL calculate saturation. this is always set to 1.

calculate_rho(dir3, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM dir3 direction in fundamental sector. size is nx3

switch color using pg or laue group

@DETAIL this function is used to calculate the azimuthal angle

of a bunch of directions. it is assumed all directions are indide the SST

calculate_theta(dir3, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM dir3 direction in fundamental sector. size is nx3

switch color using pg or laue group

@DETAIL this function is used to calculate the polar angle of direction vectors. it is assumed that the direction vector lies inside the SST

check_hemisphere()[source]
check_norm(dir3)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/29/2020 SS 1.0 original @PARAM dir3 direction in fundamental sector. size is nx3 @DETAIL this function is used to make sure the directions are all unit norm

fillet_region(dir3, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM vertex vertices of the spherical triangle

dir3 normalized direction vectors switch which group to check. acceptable arguments are ‘super’, ‘superlaue’

‘super’ —-> point group coloring ‘superlaue’ —-> laue group coloring

this function will check which fillet the point lies in returns 0 if its barycenter, vertex 0 and vertex 1 returns 1 if its barycenter, vertex 1 and vertex 2 returns 2 if its barycenter, vertex 2 and vertex 3

it is implicitly assumed that the point lies inside the spherical triangle. behavior is unknown if it is not the case

first make the vertices of the three fillets

get_color(dir3, mask, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 10/28/2020 SS 1.0 original

11/12/2020 SS 1.1 added laueswitch as argument 11/23/2020 SS 1.2 added mask argument which tell the directions for which the supergroup reductions dont match the point or laue group reductions. mask has size dir3.shape[0]

@PARAM dir3 direction in fundamental sector. behavior is undefined if

mask True if symmetry reduction of dir3 using point group does not match the super group and False otherwise switch get colors in laue group or pg

@DETAIL this function is used to calculate the hsl color for direction vectors

in dir3. if laueswitch is True, then color is assigned based on laue group

hue_speed(rho)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM rho azimuthal angle @DETAIL calculate the hue speed for a vector of azimuthal angles

this is utilized in increasing the area of the red, blue and green regions

hue_speed_normalization_factor()[source]
inside_sphericalpatch(vertex, dir3)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM vertex vertices of the spherical triangle

dir3 normalized direction vectors switch which group to check. acceptable arguments are ‘pg’, ‘laue’, ‘supergroup’ and ‘supergroup_laue’

@DETAIL check if direction is inside a spherical patch

the logic used as follows: if determinant of [x A B], [x B C] and [x C A] are all same sign, then the sphere is inside the traingle formed by A, B and C returns a mask with inside as True and outside as False

point_on_boundary(dir3, switch)[source]

@AUTHOR Saransh Singh, Lawrence Livermore National Lab, saransh1@llnl.gov @DATE 12/09/2020 SS 1.0 original @PARAM dir3 direction in fundamental sector. size is nx3

switch color using pg or laue group

@DETAIL this function figures out the equivalent point on the boundary given that the point is inside the spherical triangle