Пример #1
0
    v1 /= vs[0]
    v2 /= vs[1]

    # - - - - - - - - - - - - - - - - - - - - - - - - - -  #
    # Extract the fluctuations
    v1m = np.mean(v1, axis=(0))
    v2m = np.mean(v2, axis=(0))

    # Extract fluctuating part and normalize by variance
    # Reuse the v1 and  v2 variables to store values
    v1 -= v1m
    v2 -= v2m

    # - - - - - - - - - - - - - - - - - - - - - - - - - -  #
    # Now check whether the given indices make sense
    ijk1 = sensibleIds(np.array(ijk1), x, y, z)
    ijk2 = sensibleIds(np.array(ijk2), x, y, z)
    print(' Check (1): i, j, k = {}'.format(ijk1))
    print(' Check (2): i, j, k = {}'.format(ijk2))

    nvz = (ijk2[2] - ijk1[2]) + 1
    idz = range(ijk1[2], ijk2[2] + 1)
    nvy = (ijk2[1] - ijk1[1]) + 1
    idy = range(ijk1[1], ijk2[1] + 1)
    nvx = (ijk2[0] - ijk1[0]) + 1
    idx = range(ijk1[0], ijk2[0] + 1)
    Cv = np.zeros((nt, nvz, nvy, nvx))
    d = np.zeros((nvz, nvy, nvx))
    # - - - - - - - - - - - - - - - - - - - - - - - - - -  #
    # Compute covariance
    for i in xrange(nvx):
Пример #2
0
nameDict['yname'] = args.yname
nameDict['zname'] = args.zname

# First fluctuation component
nameDict['varname'] = varname[0]
cl = 1
ncDict = read3dDataFromNetCDF( filename , nameDict, cl )
v = ncDict['v']   # 'v' is a generic name for a variable in ncDict

# Spatial coords and time
x = ncDict['x']; y = ncDict['y']; z = ncDict['z']
time = ncDict['time']

# Now check whether the given indices make sense 
# Here we set i = 0 and j = 0.
ijk1 = sensibleIds( np.array([0,0,kIds[0]]), x, y, z )
ijk2 = sensibleIds( np.array([0,0,kIds[1]]), x, y, z )
print(' Check (1): i, j, k = {}'.format(ijk1))
print(' Check (2): i, j, k = {}'.format(ijk2))

# = = = = = = = = = = = = =
# Mean and variance
vmean = np.mean(v, axis=(0))

# Extract fluctuating part and normalize by variance
# Reuse the v variable
v -= vmean

# Assemble the quadrant analysis dict 
wlDict = dict()
wlDict['wavelet'] = wavelet