PYME.LMVis.rendGauss module

PYME.LMVis.rendGauss.Gauss2D(Xv, Yv, A, x0, y0, s)
PYME.LMVis.rendGauss.gaussKernel(kernel_size=21, sigma=3)

Returns a 2D Gaussian kernel :param kernel_size: should not be even :param sigma: sigma of the gaussian :return: array containing the gaussian values

PYME.LMVis.rendGauss.rand(d0, d1, ..., dn)

Random values in a given shape.

Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).

Parameters:

d0, d1, ..., dn : int, optional

The dimensions of the returned array, should all be positive. If no argument is given a single Python float is returned.

Returns:

out : ndarray, shape (d0, d1, ..., dn)

Random values.

See also

random

Notes

This is a convenience function. If you want an interface that takes a shape-tuple as the first argument, refer to np.random.random_sample .

Examples

>>> np.random.rand(3,2)
array([[ 0.14022471,  0.96360618],  #random
       [ 0.37601032,  0.25528411],  #random
       [ 0.49313049,  0.94909878]]) #random
PYME.LMVis.rendGauss.randn(d0, d1, ..., dn)

Return a sample (or samples) from the “standard normal” distribution.

If positive, int_like or int-convertible arguments are provided, randn generates an array of shape (d0, d1, ..., dn), filled with random floats sampled from a univariate “normal” (Gaussian) distribution of mean 0 and variance 1 (if any of the \(d_i\) are floats, they are first converted to integers by truncation). A single float randomly sampled from the distribution is returned if no argument is provided.

This is a convenience function. If you want an interface that takes a tuple as the first argument, use numpy.random.standard_normal instead.

Parameters:

d0, d1, ..., dn : int, optional

The dimensions of the returned array, should be all positive. If no argument is given a single Python float is returned.

Returns:

Z : ndarray or float

A (d0, d1, ..., dn)-shaped array of floating-point samples from the standard normal distribution, or a single such float if no parameters were supplied.

See also

random.standard_normal
Similar, but takes a tuple as its argument.

Notes

For random samples from \(N(\mu, \sigma^2)\), use:

sigma * np.random.randn(...) + mu

Examples

>>> np.random.randn()
2.1923875335537315 #random

Two-by-four array of samples from N(3, 6.25):

>>> 2.5 * np.random.randn(2, 4) + 3
array([[-4.49401501,  4.00950034, -1.81814867,  7.29718677],  #random
       [ 0.39924804,  4.68456316,  4.99394529,  4.84057254]]) #random
PYME.LMVis.rendGauss.rendGauss(res, X, Y, roiSize=5, errScale=1, cutoffErr=10, cutoffSigma=3)
PYME.LMVis.rendGauss.rendGaussNested(res, X, Y, roiSize=5, errScale=1, cutoffErr=[0, 100], cutoffSigma=[85.1063829787234, 170.2127659574468], cutoffA=[10, 200])
PYME.LMVis.rendGauss.rendGaussNestedPS(res, X, Y, roiSize=5, errScale=1, cutoffErr=10, cutoffZ0=1000, cutoffA=0.02)
PYME.LMVis.rendGauss.rendGaussNestedXYCorr(res, X, Y, roiSize=5, errScale=1, cutoffErr=100, cutoffSigma=170.2127659574468)
PYME.LMVis.rendGauss.rendGaussP(x, y, sx, X, Y, roiSize=5, errScale=1, cutoffErr=10, cutoffSigma=3)
PYME.LMVis.rendGauss.rendHist(xs, ys, dsShape, pixSize=1)
PYME.LMVis.rendGauss.rendHistF(res, X, Y, roiSize=5, errScale=1, cutoffErr=10, cutoffSigma=3)