pencil.export.pc2vtk

Contains the routines for converting PencilCode data data into vtk format.

Functions

var2vtk([var_file, datadir, proc, variables, b_ext, ...])

Convert data from PencilCode format to vtk.

slices2vtk([field, extension, datadir, destination, proc])

Convert slices from PencilCode format to vtk.

Module Contents

pencil.export.pc2vtk.var2vtk(var_file='var.dat', datadir='data', proc=-1, variables=None, b_ext=False, magic=[], destination='work', quiet=True, trimall=True, ti=-1, tf=-1)

Convert data from PencilCode format to vtk.

call signature:

var2vtk(var_file='', datadir='data', proc=-1,
       variables='', b_ext=False,
       destination='work', quiet=True, trimall=True, ti=-1, tf=-1)

Read var_file and convert its content into vtk format. Write the result in destination.

Keyword Arguments:
  • *var_file* – The original var_file.

  • *datadir* – Directory where the data is stored.

  • *proc* – Processor which should be read. Set to -1 for all processors.

  • *variables* – List of variables which should be written. If None all.

  • *b_ext* – Add the external magnetic field.

  • *destination* – Destination file.

  • *quiet* – Keep quiet when reading the var files.

  • *trimall* – Trim the data cube to exclude ghost zones.

  • tf* (*ti,) – Start and end index for animation. Leave negative for no animation. Overwrites variable var_file.

pencil.export.pc2vtk.slices2vtk(field='', extension='', datadir='data', destination='slices', proc=-1)

Convert slices from PencilCode format to vtk.

call signature:

slices2vtk(field='', extension='', datadir='data', destination='slices', proc=-1)

Read slice files specified by variables and convert them into vtk format for the specified extensions. Write the result in destination. NB: You need to have called src/read_videofiles.x before using this script.

Keyword Arguments:
  • *field* – All allowed fields which can be written as slice files, e.g. b2, uu1, lnrho, … See the pencil code manual for more (chapter: “List of parameters for `video.in’”).

  • *extension* – List of slice positions.

  • *datadir* – Directory where the data is stored.

  • *destination* – Destination files.

  • *proc* – Processor which should be read. Set to -1 for all processors.