Created on Oct 25, 2012
@author: andre
TODO: Deprecated arrayAsRowMatrix(). Use pystarlight.util.StarlightUtils.arrayAsRowMatrix
Rebinning function. Given the value array a, with generic positions e such that e.shape == a.shape, return the sum or the mean values of a inside the bins defined by bin_e.
Parameters : | a : array like
e : array like
bin_e : array like
mean : boolean
|
---|---|
Returns : | a_e : array
|
Examples
TODO: Add examples for gen_rebin.
Evaluate radius where the cumulative value of X reaches half of its value.
Parameters : | X : array like
r : array like
r_max : int
|
---|---|
Returns : | HXR : float
|
Examples
Find the radius containing half of the volume of a gaussian.
>>> import numpy as np
>>> xx, yy = np.indices((100, 100))
>>> x0, y0, A, a = 50.0, 50.0, 1.0, 20.0
>>> z = A * np.exp(-((xx-x0)**2 + (yy-y0)**2)/a**2)
>>> r = np.sqrt((xx - 50)**2 + (yy-50)**2)
>>> getGenHalfRadius(z, r)
16.786338066912215
TODO: getAverageFilledImage documentation.