utils Package¶
quaternion Module¶
-
class
hide.utils.quaternion.Rotator(q)[source]¶ Bases:
objectQuaternion based rotator implementation for theta, phi
-
class
hide.utils.quaternion.VecRotator(q)[source]¶ Bases:
objectQuaternion based rotator implementation for theta, phi
-
hide.utils.quaternion.mult(p, q)[source]¶ Multiply arrays of quaternions, ndarray objects with 4 columns defined as x y z w see: http://en.wikipedia.org/wiki/Quaternions#Quaternions_and_the_geometry_of_R3
signal Module¶
Created on Nov 10, 2015
author: jakeret
-
hide.utils.signal.noisegen(beta=0, N=8192)[source]¶ Noise will be generated that has spectral densities that vary as powers of inverse frequency, more precisely, the power spectra P(f) is proportional to 1 / fbeta for beta >= 0. When beta is 0 the noise is referred to white noise, when it is 2 it is referred to as Brownian noise, and when it is 1 it normally referred to simply as 1/f noise which occurs very often in processes found in nature.
The basic method involves creating frequency components which have a magnitude that is generated from a Gaussian white process and scaled by the appropriate power of f. The phase is uniformly distributed on 0, 2pi.
from http://paulbourke.net/fractals/noise/
Parameters: - beta –
- N – number of samples (can also be shape of array)
Returns out: the sampled noise
sphere Module¶
Created on Dec 22, 2014
author: jakeret
-
class
hide.utils.sphere.ArcKDTree(theta, phi)[source]¶ Bases:
objectWraps the scipy.spatial.cKDTree such that the tree can be used with spherical coords
-
query(theta, phi, k=1, eps=0, p=2, distance_upper_bound=inf)[source]¶ Query the kd-tree for nearest neighbors using theta, phi :param theta: :param phi: :param k: :param eps: :param p: :param distance_upper_bound:
Returns d, i: The distances to the nearest neighbors, the locations of the neighbors in self.data.
-
-
hide.utils.sphere.rotate_map(Map, rotator, mask=None)[source]¶ Map is map in system A rotator is rotator from system B to A mask is a mask in system B returns new map in system B
-
hide.utils.sphere.separation(d1, a1, d2, a2)[source]¶ great circle distance http://en.wikipedia.org/wiki/Great-circle_distance#Computational_formulas
Parameters: - d1 – dec 1
- a1 – ra 1
- d2 – dec 2
:param a2:ra 2