pencil.read.allslices

Contains the classes and methods to read slice files.

Classes

SliceSeries

SliceSeries -- holds Pencil Code slices data and methods.

Functions

slices(*args, **kwargs)

Wrapper for SliceSeries.read()

Module Contents

class pencil.read.allslices.SliceSeries

Bases: object

SliceSeries – holds Pencil Code slices data and methods.

Fill members with default values.

t
keys()
read(field='', extension='', datadir='data', proc=-1, old_file=False, precision='f', iter_list=list(), quiet=True, tstart=0, tend=None, downsample=1)
read(field=’’, extension=’’, datadir=’data’, proc=-1, old_file=False,

precision=’f’, iter_list=list(), quiet=True, tstart=0, tend=None, downsample=1)

Read Pencil Code slice data.

Parameters:
  • field (string or list of strings) – Name of the field(s) to be read.

  • extension (string or list of strings) – Specifies the plane slice(s).

  • datadir (string) – Directory where the data is stored.

  • proc (int) – Processor to be read. If -1 read all and assemble to one array.

  • old_file (bool) – Flag for reading old file format.

  • precision (string) – Precision of the data. Either float ‘f’ or double ‘d’.

  • iter_list (list) – Iteration indices for which to sample the slices.

  • quiet (bool) – Flag for switching off output.

  • tstart (float) – Start time interval from which to sample slices.

  • tend (float) – End time interval from which to sample slices.

  • downsample (integer) – Sample rate to reduce slice array size.

Return type:

Class containing the fields and slices as attributes.

Notes

  • Use the attribute keys to get a list of attributes

  • self.coordinate is the 1-based index of the slice including ghost zones at each output time

  • self.position is the coordinate value of the slice at each output time

Examples

>>> vsl = pc.read.slices()
>>> vsl.keys()
t
xy
xy2
xz
yz
position
coordinate
pencil.read.allslices.slices(*args, **kwargs)

Wrapper for SliceSeries.read()