pencil.read.pstalk2 =================== .. py:module:: pencil.read.pstalk2 Classes ------- .. autoapisummary:: pencil.read.pstalk2.Struct Functions --------- .. autoapisummary:: pencil.read.pstalk2.pstalk2 Module Contents --------------- .. py:class:: Struct Bases: :py:obj:`dict` Simple dict-like container with attribute (dot) access. Initialize self. See help(type(self)) for accurate signature. .. py:function:: pstalk2(datadir='data', it0=0, it1=-1, swap_endian=False, quiet=False, noutmax=None, single=False, nstalk=None, ipar=None, read_last=False) Read Pencil Code particle stalker data (PSTALK) and return a Struct with dot-access fields: fs.t : (nout,) fs.ipar : (nstalk,) fs.: (nstalk, nout) for each field in particles_stalker_header.dat :param datadir: Base data directory (e.g. "data"). ~ expansion is supported. :type datadir: str :param it0: First time index to read (inclusive). :type it0: int :param it1: If >0, print a log line whenever it % it1 == 0. :type it1: int :param swap_endian: If True, swap endianness when reading the binary PSTALK files. :type swap_endian: bool :param quiet: If True, suppress most logging. :type quiet: bool :param noutmax: Maximum number of output times to read. None => use all available. Semantics match IDL: min(noutmax, noutmaxfile), with -1 meaning "all". :type noutmax: int or None :param single: If True, store output data in float32; otherwise float64. (Binary precision is auto-detected and then cast.) :type single: bool :param nstalk: Max number of stalked particles to keep. Defaults to pdim.npar_stalk. In non-sink mode, particles with index >= nstalk are ignored. In sink-particle mode, nstalk may be increased internally if needed. :type nstalk: int or None :param ipar: If given, read only these particle indices (memory-efficient). :type ipar: int or list of int or None :param read_last: If True, read only the last timestep (overrides it0) :type read_last: bool :returns: **fs** -- Container with fields t, ipar, and one field per stalk quantity. :rtype: Struct