This package calculates general spatial correlation functions of scalar, vector, and tensor fields contained in numpy.array like data structures. These data structures can be in the form:
To find the correlation function, call one of CorrelationFunctionsOf{Scalar,Vector,Scalar}Field or RadialCorrelationFunctions if you can assume radial symmetry. A radial correlation function can also be produced from a correlation function made from the first set of functions.
For some examples:
1 2 3 4 5 6 7 8 9 10 | import numpy as np
import pylab as pl
import CorrelationFuncions as cf
# create a 3d vector field on a 2d grid
vec = np.random.random((3,128,128))
# calculate the radial correlation
corr = cf.RadialCorrelationFunctions(vec, type='vector')
pl.loglog(corr[0], corr[1], 'o-')
|
‘default’: typical autocorrelation function from convolution ‘height-height’: height-height correlation function ‘zero-average’: remove any non-zero offset from all data
then take default autocorrelation
Return the correlation function of variety ‘type’ for a 3x3 component tensor field, adding all components together. ‘type’ can be one of:
‘default’ : typical autocorrelation function from convolution
‘height-height’: height-height correlation function
- ‘zero-average’ : remove any non-zero offset from all data
then take default autocorrelation
Return the correlation function of variety ‘type’ for a three component vector field, adding all components together. ‘type’ can be one of:
‘default’: typical autocorrelation function from convolution
‘height-height’: height-height correlation function
- ‘zero-average’: remove any non-zero offset from all data
then take default autocorrelation
Averages angle dependence in correlation function assuming spherical symmetry (in the appropriate dimension).
Averages angle dependence in correlation function assuming spherical symmetry (in the appropriate dimension). This version uses weave to increase speed.
Calculates the radial correlation function of a field of type fieldtype.
fieldtype can be one of {‘tensor’, ‘vector’, ‘scalar’}
{‘total’, ‘permutation’, ‘trace’}
{‘default’, ‘height-height’, ‘zero-average’}
Performs RadialCorrelationFunctions on an inputfile that holds field data in the space separated values of arbitrary arrangement (i.e. rows / columns don’t matter).
Input is either by filename or by numpy.array. If input is specified it is taken to be the data array. If not, the inputfile is opened and read for data.
Designed for Periodic Boundary Condition.
Designed for Periodic Boundary Condition.
Designed for Periodic Boundary Condition.