PyMSES

Table Of Contents

Previous topic

Source documentation

Next topic

Dataset transformations

This Page

Data structures and containers

pymses.core.sources — PyMSES generic data source module

class Source

Bases: object

Base class for all data source objects

flatten()

Read each data file and concatenate resulting dsets. This method tries to use multiprocessing if possible. This method uses cache_dset if this class is an instance of pymses Filter with self.remember_data==True

Returns :fdset : flattened dataset
iter_dsets()

Datasets iterator method. Yield datasets from the datasource

set_read_lmax(max_read_level)

Sets the maximum AMR grid level to read in the datasource

Parameters :

max_read_level : int

max. AMR level to read

class Filter(source)

Bases: pymses.core.sources.Source

Data source filter generic class.

filtered_dset(dset)

Abstract filtered_dset() method

get_domain_dset(idomain, fields_to_read=None)

Get the filtered result of self.source.get_domain_dset(idomain)

Parameters :

idomain : int

number of the domain from which the data is required

Returns :

dset : Dataset

the filtered dataset corresponding to the given idomain

get_source_type()
Returns :

type : int

the result of the get_source_type() method of the source param.

set_read_lmax(max_read_level)

Source inherited behavior + apply the set_read_lmax() method to the source param.

Parameters :

max_read_level : int

max. AMR level to read

class SubsetFilter(data_sublist, source)

Bases: pymses.core.sources.Filter

SubsetFilter class. Selects a subset of datasets to read from the datasource

Parameters :

data_sublist : list of int

list of the selected dataset index to read from the datasource

pymses.core.datasets — PyMSES generic dataset module

class Dataset

Bases: pymses.core.sources.Source

Base class for all dataset objects

add_scalars(name, data)

Scalar field addition method

Parameters :

name : string

human-readable name of the scalar field to add

data : array

raw data array of the new scalar field

add_vectors(name, data)

Vector field addition method

Parameters :

name : string

human-readable name of the vector field to add

data : array

raw data array of the new vector field

fields

Dictionary of the fields in the dataset

classmethod from_hdf5(h5file, where='/', close_at_end=False)
iter_dsets()

Returns an iterator over itself

write_hdf5(h5file, where='/', close_at_end=False)
class PointDataset(points)

Bases: pymses.core.datasets.Dataset

Point-based dataset base class

add_random_shift()

Add a random shift to point positions in order to avoid grid alignment effect on processed images. The field “size” (from CellsToPoints Filter and IsotropicExtPointDataset) is needed to know the shift amplitude. This method is processed only once, and turn the random_shift attribute to True.

classmethod concatenate(dsets, reorder_indices=None)

Datasets concatenation class method. Return a new dataset

Parameters :

dsets : list of PointDataset

list of all datasets to concatenate

reorder_indices : array of int (default to None)

particles reordering indices

Returns :

dset : the new created concatenated PointDataset

filtered_by_mask(mask_array)

Datasets filter method. Return a new dataset

Parameters :

mask_array : numpy.array of numpy.bool

filter mask

Returns :

dset : the new created filtered PointDataset

classmethod from_hdf5(h5file, where='/')
reorder_points(reorder_indices)

Datasets reorder method. Return a new dataset

Parameters :

reorder_indices : array of int

points order indices

Returns :

dset : the new created reordered PointDataset

transform(xform)

Transform the dataset according to the given xform Transformation

Parameters :xform : Transformation
write_hdf5(h5file, where='/')
class IsotropicExtPointDataset(points, sizes=None)

Bases: pymses.core.datasets.PointDataset

Extended point dataset class

get_sizes()
Returns :

sizes : array

point sizes array