pencil.read.ogvar

Contains the read class for the OGVAR file reading, some simulation attributes and the data cube.

Classes

ogDataCube

DataCube -- holds Pencil Code OGVAR file data.

Functions

ogvar(*args, **kwargs)

ogvar(var_file='', datadir='data', proc=-1, iogvar=-1,

Module Contents

pencil.read.ogvar.ogvar(*args, **kwargs)
ogvar(var_file=’’, datadir=’data’, proc=-1, iogvar=-1,

quiet=True, trimall=False, magic=None, sim=None, precision=’f’)

Read OGVAR files from Pencil Code. If proc < 0, then load all data and assemble, otherwise load OGVAR file from specified processor.

The file format written by output() (and used, e.g. in ogvar.dat) consists of the followinig Fortran records: 1. data(mx, my, mz, nvar) 2. t(1), x(mx), y(my), z(mz), dx(1), dy(1), dz(1), deltay(1) Here nvar denotes the number of slots, i.e. 1 for one scalar field, 3 for one vector field, 8 for ogvar.dat in the case of MHD with entropy. but, deltay(1) is only there if lshear is on! need to know parameters.

Parameters:
  • var_file (string) – Name of the OGVAR file.

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

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

  • iogvar (int) – Index of the OGVAR file, if var_file is not specified.

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

  • trimall (bool) – Trim the data cube to exclude ghost zones.

  • magic (list of string) – Values to be computed from the data, e.g. B = curl(A).

  • sim (obj) – Simulation sim object.

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

class pencil.read.ogvar.ogDataCube

Bases: pencil.read.varfile.DataCube

DataCube – holds Pencil Code OGVAR file data.

Initialize the og data cube as the var data cube.

keys()
transform(trim_all)

Transform velocity coordinates from ur and uth to ux and uy.