findtde.utils module#
Python module of utility functions for findTDE calculations.
- findtde.utils.angle_between(v1, v2)[source]#
Returns the angle in radians between vectors ‘v1’ and ‘v2’:
>>> angle_between((1, 0, 0), (0, 1, 0))
1.5707963267948966 >>> angle_between((1, 0, 0), (1, 0, 0)) 0.0 >>> angle_between((1, 0, 0), (-1, 0, 0)) 3.141592653589793
- findtde.utils.idw(samples, tx, ty, P=5)[source]#
Function to compute a single IDW interpolation of sample data. Change P value for different interpolation (P>2 is recommended).
- findtde.utils.idw_heatmap(inputdata, RES=360, P=5)[source]#
Perform full IDW interpolation on a (nsamples x 3) array (x, y, f(x, y)) and produce data able to be used in a heatmap. From Victor. Change P value for different interpolation (P>2 is recommended). RES is the resolution of the final image.
- findtde.utils.lat2sph(uvw, ai)[source]#
Function converting from lattice directions to spherical coordinates. Given two 2D arrays, one for lattice directions and one for lattice vectors, returns a 2D array of the spherical coordinates corresponding to the lattice directions.
- findtde.utils.lattice_iconv(indices, ind_type='UVTW')[source]#
Function converting between rectangular and hexagonal lattice indices. Given a tuple of indices and the initial index type as a keyword argument. Index type is either [uvw] for rectangular or [UVTW] for hexagonal. Returns a tuple of the opposite type.
- findtde.utils.scale_C3z_symmetry(rpt)[source]#
Function to scale all given spherical coordinates to a single zone based on threefold rotation symmetry about the c-axis. Given a 2D array of spherical coordinates, returns another 2D array of spherical coordinates with polar angle scaled by 120 deg increments to the desired range.
- findtde.utils.scale_C6z_symmetry(rpt)[source]#
Function to scale all given spherical coordinates to a single zone based on sixfold rotation symmetry about the c-axis. Given a 2D array of spherical coordinates, returns another 2D array of spherical coordinates with polar angle scaled by 60 deg increments to the desired range.