pencil.read.averages ==================== .. py:module:: pencil.read.averages .. autoapi-nested-parse:: Contains the classes and methods to read average files. Classes ------- .. autoapisummary:: pencil.read.averages.Averages Functions --------- .. autoapisummary:: pencil.read.averages.aver Module Contents --------------- .. py:class:: Averages Bases: :py:obj:`object` Averages -- holds Pencil Code averages data and methods. Fill members with default values. .. py:property:: t .. py:property:: keys .. py:method:: read(datadir='data', simdir='.', plane_list=None, avfile_list=None, infile_list=None, var_index=-1, var_names=None, iter_list=None, niter=9999, iter_step=1, time_range=None, param=None, proc=-1, precision='f', comp_time=False, quiet=True, sim=None) read(plane_list=None, datadir='data', proc=-1, var_index=-1, proc=-1): Read Pencil Code average data. :param datadir: Directory where the data is stored. By default, "data" :type datadir: string :param simdir: Simulation directory containing the .in files. By default, current directory. :type simdir: string :param plane_list: A list of the 2d/1d planes over which the averages were taken. Takes 'xy', 'xz', 'yz', 'y', 'z'. By default, it is [p for p in ["xy", "xz", "yz"] if corresponding_dot_in_file_exists_in_simdir]. :type plane_list: list of string :param avfile_list: File names if alternative to standard files used. :type avfile_list: list of string :param infile_list: File names if alternative to standard files used. :type infile_list: list of string :param var_names: Variable names from among h5 averages. :type var_names: string or list of strings matching format in *aver.in for given plane :param var_index: Index of variable from among within the 'y' or 'z' averages. Takes an integer value < len(yaver.in or zaver.in). :type var_index: int :param time_range: Single float indicates end time of sample taking 0 to be the start time. Two floats indicates start and end time to sample. :type time_range: float or list of two floats. :param iter_list: Iteration indices for which to sample the slices. Single value only that index is sampled. Two indices indicate first and last index (last value excluded). More than two indicies specifies the precise list of indices to be sampled. Note that the indices specified here start from 0. :type iter_list: list of int, or index range :param niter: if iter_list is not used for fortran format a default index list will be used of size niter. :type niter: int :param iter_step: :type iter_step: when sampling iterations number of steps, when iter_list length is two. :param param: Param object belonging to the simulation. :type param: Param object :param proc: Processor to be read. If -1 read all and assemble to one array. Only affects the reading of 'yaverages.dat' and 'zaverages.dat'. :type proc: int :param precision: Float (f), double (d) or half (half). :type precision: string :param quiet: Whether to suppress diagnostic output. Default: True :type quiet: bool :param sim: If specified, get simdir and datadir from this. :type sim: Simulation obejct. :rtype: Class containing the averages. .. rubric:: Examples >>> aver = pc.read.aver() >>> aver.lnrho.shape (134, 134, 134) .. rubric:: Notes The axis ordering of the 2D averages (yaver and zaver) is [t,x,z] or [t,x,y] .. py:function:: aver(*args, **kwargs) Wrapper for :py:meth:`Averages.read`