pencil_ccyang.read ================== .. py:module:: pencil_ccyang.read Attributes ---------- .. autoapisummary:: pencil_ccyang.read.hsize Classes ------- .. autoapisummary:: pencil_ccyang.read.Dict Functions --------- .. autoapisummary:: pencil_ccyang.read.allprocs_avg2d pencil_ccyang.read.allprocs_grid pencil_ccyang.read.allprocs_pvar pencil_ccyang.read.allprocs_var pencil_ccyang.read.avg1d pencil_ccyang.read.avg2d pencil_ccyang.read.dimensions pencil_ccyang.read.grid pencil_ccyang.read.parameters pencil_ccyang.read.pardim pencil_ccyang.read.proc_avg2d pencil_ccyang.read.proc_dim pencil_ccyang.read.proc_grid pencil_ccyang.read.proc_pvar pencil_ccyang.read.proc_var pencil_ccyang.read.pvar pencil_ccyang.read.slices pencil_ccyang.read.time_series pencil_ccyang.read.var pencil_ccyang.read.varlist pencil_ccyang.read.varname Module Contents --------------- .. py:data:: hsize :value: 4 .. py:class:: Dict(**kw) A class that emulates NamedTuple but is picklable. Instance Variables All the keyword arguments when constructed. Initiate the object with all the keyword arguments. **kw Keyword values to be recorded in the object. .. py:method:: keys() Returns all the keywords recorded in the object. .. py:function:: allprocs_avg2d(datadir='./data', direction='z') Returns the time series of the 2D averages read from allprocs/. :keyword datadir: Name of the data directory. :keyword direction: Direction of the average: 'x', 'y', or 'z'. .. py:function:: allprocs_grid(datadir='./data', dim=None) Returns the grid under allprocs/. :keyword datadir: Name of the data directory. :keyword dim: Dimensions supplied by dimensions(). If None, they will be read in at runtime. .. py:function:: allprocs_pvar(datadir='./data', pdim=None, pvarfile='pvar.dat') Returns the particles in one snapshot under allprocs/. :keyword datadir: Name of the data directory. :keyword pdim: Particle dimensions returned by pardim(). If None, they will be read in at runtime. :keyword pvarfile: Name of the snapshot file. .. py:function:: allprocs_var(datadir='./data', dim=None, par=None, varfile='var.dat') Returns one snapshot under allprocs/. :keyword datadir: Name of the data directory. :keyword dim: Dimensions supplied by dimensions(). If None, the dimensions will be read in at runtime. :keyword par: Parameters supplied by parameters(). If None, the parameters will be read in at runtime. :keyword varfile: Name of the snapshot file. .. py:function:: avg1d(datadir='./data', plane='xy', tsize=None, unformatted=True, verbose=True) Returns the time series of 1D averages. :keyword datadir: Name of the data directory. :keyword plane: Plane of average: 'xy', 'xz', or 'yz'. :keyword tsize: If not None, the time series is interpolated onto regular time intervals with tsize elements and endpoints included. :keyword unformatted: Set True if the data file is written in binary format. :keyword verbose: Whether or not to print information. .. py:function:: avg2d(datadir='./data', direction='z', par=None) Returns the time series of the 2D averages. :keyword datadir: Name of the data directory. :keyword direction: Direction of average: 'x', 'y', or 'z'. :keyword par: Parameters supplied by parameters(). If None, the parameters will be read in at runtime. .. py:function:: dimensions(datadir='./data') Returns the dimensions of the Pencil Code data from datadir. :keyword datadir: Name of the data directory. .. py:function:: grid(datadir='./data', interface=False, par=None, trim=True) Returns the coordinates and their derivatives of the grid. :keyword datadir: Name of the data directory. :keyword interface: If True, the coordinates of the interfaces between cells are returned; otherwise, those of the cell centers are returned. :keyword par: Parameters supplied by parameters() needed when the keyword interface is True. If None, parameters() will be called. :keyword trim: Whether or not to trim the ghost cells. If the keyword interface is True, ghost cells are automatically trimmed and this keyword has no effect. .. py:function:: parameters(datadir='./data', par2=False, warning=True) Returns runtime parameters. :keyword datadir: Name of the data directory. :keyword par2: Read param2.nml if True; read param.nml otherwise. :keyword warning: Give warning messages or not. .. py:function:: pardim(datadir='./data') Returns the numbers associated with particles. :keyword datadir: Name of the data directory .. py:function:: proc_avg2d(datadir='./data', direction='z', proc=0) Returns the time series of one chunk of the 2D averages from one process. :keyword datadir: Name of the data directory. :keyword direction: Direction of the average: 'x', 'y', or 'z'. :keyword proc: Process ID. .. py:function:: proc_dim(datadir='./data', proc=0) Returns the dimensions of the data from one process. :keyword datadir: Name of the data directory :keyword proc: Process ID .. py:function:: proc_grid(datadir='./data', dim=None, proc=0) Returns the grid controlled by one process. :keyword datadir: Name of the data directory. :keyword dim: Dimensions supplied by proc_dim(). If None, proc_dim() will be called. :keyword proc: Process ID. .. py:function:: proc_pvar(datadir='./data', pdim=None, proc=0, pvarfile='pvar.dat') Returns the particles in one snapshot held by one process. :keyword datadir: Name of the data directory. :keyword pdim: Particle dimensions returned by pardim(). If None, they will be read in at runtime. :keyword proc: Process ID. :keyword pvarfile: Name of the snapshot file. .. py:function:: proc_var(datadir='./data', dim=None, par=None, proc=0, varfile='var.dat') Returns the patch of one snapshot saved by one process. :keyword datadir: Name of the data directory. :keyword dim: Dimensions supplied by proc_dim(). If None, proc_dim() will be called. :keyword par: Parameters supplied by parameters(). If None, parameters() will be called. :keyword proc: Process ID. :keyword varfile: Name of the snapshot file. .. py:function:: pvar(allprocs=True, datadir='./data', ivar=None, pvarfile='pvar.dat', verbose=True) Returns particles in one snapshot. :keyword allprocs: If True, the snapshot is read under allprocs/. :keyword datadir: Name of the data directory. :keyword ivar: If not None, an integer specifying the snapshot number and the argument pvarfile takes no effect. :keyword pvarfile: Name of the snapshot file. :keyword verbose: Verbose output or not. .. py:function:: slices(field, datadir='./data', return_pos=False) Reads the video slices. Returned Values: 1. Array of time points. 2. Slice planes of field at each time. 3. (optional) Slice positions of each plane at each time. Positional Argument: field Field name. Keyword Argument: datadir Name of the data directory. return_pos Also return slice positions if True. .. py:function:: time_series(datadir='./data', unique=False) Returns a NumPy recarray from the time series. :keyword datadir: Name of the data directory :keyword unique: If True, discard duplicate entries. .. py:function:: var(allprocs=True, compact=True, datadir='./data', ivar=None, par=None, trim=True, unshear=False, varfile='var.dat', verbose=True) Returns one snapshot. :keyword allprocs: If True, the snapshot is read under allprocs/. :keyword compact: If True, dimensions of one are removed. :keyword datadir: Name of the data directory. :keyword ivar: If not None, an integer specifying the snapshot number and the argument varfile takes no effect. :keyword par: Parameters supplied by parameters(). If None, parameters() will be called. :keyword trim: Whether or not to trim the ghost cells. :keyword unshear: Whether or not to make x periodic :keyword varfile: Name of the snapshot file. :keyword verbose: Verbose output or not. .. py:function:: varlist(datadir='./data', listname='varN.list') Reads and returns the names and times of the snapshots. :keyword datadir: Name of the data directory. :keyword listname: Name of the file containing the list of snapshots. Returned Values varfile A list of file names. time A list of the corresponding times. .. py:function:: varname(datadir='./data', filename='varname.dat') Returns the names of variables. :keyword datadir: Name of the data directory :keyword filename: Name of the file containing variable names