pencil.math.stats ================= .. py:module:: pencil.math.stats .. autoapi-nested-parse:: Differential operators in different coordinate systems. Submodules ---------- .. toctree:: :maxdepth: 1 /code/sourcePython/pencil/math/stats/struct/index Functions --------- .. autoapisummary:: pencil.math.stats.space_struct pencil.math.stats.time_struct pencil.math.stats.fit_gaussm1 pencil.math.stats.fit_expm1 pencil.math.stats.fit_gauss pencil.math.stats.fit_exp pencil.math.stats.fit_power pencil.math.stats.fit_linear Package Contents ---------------- .. py:function:: space_struct(arr, dims=[[], [], []], Dorder=2, dirs='zyx', lperi=(True, True, True), lplot=True, InitialGuess=[1.0, 1.0], deltay=0.0, chunksize=1000.0, figname=None, dlabel='data', quiet=True, downsample=[1, 1, 1], maxl=[-1, -1, -1], loopsample=[1, 1, 1]) Calculate the structure function in space. call signature: space_struct(arr, dims=[[],[],[]], Dorder=2, dirs='zyx', lperi=(True,True,True), lplot=True, InitialGuess = [1.0,1.0], deltay=0., figname = None, dlabel = 'data', quiet=False) Keyword arguments: *arr*: numpy data array of shape, e.g., [nz,ny,nz]. *z*: z dimension full array to replace default empty list. *y*: y dimension full array to replace default empty list. *x*: x dimension full array to replace default empty list. *Dorder*: Order of structure function, by default 2nd. *lperi*: Flag indicates for each dimension, whether boundary is periodic. *lplot* Flag to plot the result. *InitialGuess*: Initial parameters for curve fitting, default [1.0,1.0]. *figname*: String name for plot, if saving rather than only display. *dlabel*: legend label for data. *quiet* Flag for switching off output. :rtype: D1 Structure function, length array, fit parameters [sigma, L0]. .. rubric:: Notes Must provide list of dimension arrays to match dirs required. .. rubric:: Examples >>> D,ell,fit = pc.math.stats.space_struct(var.rho, dims=[gd.z,gd.y,gd.x], dirs='zyx') >>> D, ell, fit [0, ...,], [0, 0.0041, ...], [2.5,0.04] .. py:function:: time_struct(arr, time=[], order=2, lplot=True, InitialGuess=[1.0, 1.0], figname=None, dlabel='data', quiet=False) Calculate the structure function in time. call signature: time_struct(arr, time=[], order=2, lplot=True, InitialGuess = [1.0,1.0], figname = None, dlabel = 'data', quiet=False) Keyword arguments: *arr*: numpy data array of shape [ntime,:]. *time*: time series for time correlations. By default empty list. *Dorder*: Order of structure function, by default 2nd. *lplot* Flag to plot the result. *InitialGuess*: Initial parameters for curve fitting, default [1.0,1.0]. *figname*: String name for plot, if saving rather than only display. *dlabel*: legend label for data. *quiet* Flag for switching off output. :rtype: D1 Structure function, time array, fit parameters [sigma, L0]. .. rubric:: Notes Provide time series of D1 -- D3 sample sets of fixed spatial location. .. rubric:: Examples >>> Dt,t,fit = pc.math.stats.space_struct(var.rho, dims=[gd.z,gd.y,gd.x], dirs='zyx') >>> Dt, t, fit [0, ...,], [0, 0.0041, ...], [2.5,0.04] .. py:function:: fit_gaussm1(ell, sigma, L0) Fit for 2nd order structure function, Eq. 6 DOI 10.3847/1538-4357/aa93e7 correlation length = sqrt(pi/2)L0 .. py:function:: fit_expm1(t, sigma, L0) Fit for 2nd order structure function, Eq. 5 DOI 10.3847/1538-4357/aa93e7 correlation length = L0 .. py:function:: fit_gauss(ell, sigma, L0) Fit for 2nd order structure function, Eq. 6 DOI 10.3847/1538-4357/aa93e7 correlation length = sqrt(pi/2)L0 .. py:function:: fit_exp(t, sigma, L0) Fit for 2nd order structure function, Eq. 5 DOI 10.3847/1538-4357/aa93e7 correlation length = L0 .. py:function:: fit_power(t, sigma, L0) Fit for 2nd order structure function, Eq. 5 DOI 10.3847/1538-4357/aa93e7 correlation length = L0 .. py:function:: fit_linear(t, sigma, L0) Fit for 2nd order structure function, Eq. 5 DOI 10.3847/1538-4357/aa93e7 correlation length = L0