pencil_ccyang.find

Functions

avgt1d([tmin])

Finds the time average of the 1D averages.

par_disp([datadir, save_to])

Finds the displacement of each particle as a function of time.

eta_z(z[, datadir])

Finds the vertical profile of the resistivity, if any.

midplane(**kwarg)

Finds horizontally-averaged mid-plane properties as a function of

sigma0([datadir])

Returns the background gas column density inside the

slice([axis, var, z0])

Finds a slice normal to one of the axis direction in one

stratz([datadir, par, trim])

Finds the vertical background stratification.

time_average([datadir, diagnostics, tmin, verbose])

Finds the time average of each given diagnostic variable.

Module Contents

pencil_ccyang.find.avgt1d(tmin=None, **kwarg)

Finds the time average of the 1D averages.

Keyword Arguments:
  • tmin – Minimum time to be included in the average. If None, the whole time series is used.

  • **kwarg – Keyword arguments to be passed to read.avg1d().

pencil_ccyang.find.par_disp(datadir='./data', save_to=None)

Finds the displacement of each particle as a function of time.

Keyword Arguments:
  • datadir – Path to the data directory.

  • save_to – If not None, a string of the filename (without .npz extension) to save the results (t and dxp) to a numpy data file under datadir.

Returned Values:
t

A numpy array of times, starting from zero.

dxp, dyp, dzp

A tuple of three 2D numpy arrays, where dxp[i,j], dyp[i,j], and dzp[i,j] are the components of the displacement of particle j at t[i]. A component is returned None if the dimension is neither active nor periodic.

pencil_ccyang.find.eta_z(z, datadir='./data')

Finds the vertical profile of the resistivity, if any.

Positional Arguments:
z

Numpy array of vertical coordinates.

Keyword Arguments:

datadir – Data directory.

Returned values:

Magnetic diffusivity at the corresponding z.

pencil_ccyang.find.midplane(**kwarg)

Finds horizontally-averaged mid-plane properties as a function of time.

Returned Values:

Time and mid-plane properties.

Keyword Arguments:

**kwarg – Keyword arguments to be passed to read.avg1d(), except keyword plane.

pencil_ccyang.find.sigma0(datadir='./data')

Returns the background gas column density inside the computational domain.

Keyword Arguments:

datadir – Name of the data directory.

pencil_ccyang.find.slice(axis=2, var=None, z0=0, **kwarg)

Finds a slice normal to one of the axis direction in one snapshot.

Keyword Arguments:
  • axis – Axis that is normal to the slice.

  • z0 – Coordinate of the slice on the axis.

  • var – List of variables; all variables are retrieved if None.

  • **kwarg – Keyword arguments to be passed to read.var().

Returned Values:

Time of and fields on the slice.

pencil_ccyang.find.stratz(datadir='./data', par=None, trim=False)

Finds the vertical background stratification.

Returned Values:

The z coordinates and the corresponding density stratification.

Keyword Arguments:
  • datadir – Name of the data directory.

  • par – If not None, parameters given by read.parameters().

  • trim – Whether or not to trim ghost cells.

pencil_ccyang.find.time_average(datadir='./data', diagnostics=None, tmin=0, verbose=True)

Finds the time average of each given diagnostic variable.

Returned Values:

The mean and standard deviation of each diagnostics for t >= tmin.

Keyword Arguments:
  • datadir – Name of the data directory.

  • diagnostics – (A list of) diagnostic variable(s). If None, all diagnostics but it and t are processed.

  • tmin – Starting time of the time average.

  • verbose – Directly print out the averages when True.