pencil.read.powers

Contains the classes and methods to read the power spectra.

Classes

Power

Power -- holds power spectrum data.

Functions

power(*args, **kwargs)

Wrapper for Power.read()

Module Contents

class pencil.read.powers.Power

Bases: object

Power – holds power spectrum data.

Fill members with default values.

t = []
keys()
read(datadir='data', file_name=None, quiet=False, time_range=None, lazy=False, sim=None)

read(datadir=’data’, file_name=’’, quiet=False)

Read the power spectra.

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

  • file_name (string) – Filename to read. If a filename is given, only that power spectrum is read. By default it reads all the power spectrum files.

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

  • lazy (bool) – If True, the HDF5 files will not be completely read into memory; rather, just the relevant portions will be read into memory and returned when the user applies indices. Default: False

  • sim (Simulation object) – If passed, get datadir from this.

Return type:

Class containing the different power spectrum as attributes.

Notes

Use the attribute keys to get a list of attributes

Examples

>>> pw = pc.read.power()
>>> pw.keys()
t
kin
krms
hel_kin
pencil.read.powers.power(*args, **kwargs)

Wrapper for Power.read()