PyMSES

Table Of Contents

Previous topic

Filters module

Next topic

Visualization module

This Page

Analysis module

pymses.analysis — Analysis and post-processing package

sample_points(amr_source, points, add_cell_center=False, add_level=False, max_search_level=None, interpolation=False, use_C_code=True, use_openCL=False, verbose=False)

Create point-based data from AMR-based data by point sampling. Samples all available fields of the amr_source at the coordinates of the points.

Parameters :

amr_source : RamsesAmrSource

data description

points : (npoints, ndim) array

sampling points coordinates

add_level : boolean (default False)

whether we need to add a level field in the returned dataset containing the value of the AMR level the sampling points fall into

add_cell_center : boolean (default False)

whether we need to add a cell_center field in the returned dataset containing the coordinates of the AMR cell center the sampling points fall into

interpolation : boolean (default False)

Experimental : A proper bi/tri-linear interpolation could be great! THIS IS NOT IMPLEMENTED YET : in this attempt we supposed corner cell data while ramses use centered cell data, letting alone the problem of different AMR level...

use_C_code : boolean (default True)

The pure C code is slightly faster than the (not well optimized) Cython code, and should give the same result

use_openCL : boolean (default False)

Experimental : use “pyopencl” http://pypi.python.org/pypi/pyopencl

verbose : boolean (default False)

some console printout...

Returns :

dset : PointDataset

Contains all these sampled values.

bin_cylindrical(source, center, axis_vect, profile_func, bin_bounds, divide_by_counts=False)

Cylindrical binning function for profile computing

Parameters :

center : array

center point for the profile

axis_vect : array

the cylinder axis coordinates array.

profile_func : function

a function taking a PointDataset object as an input and producing a numpy array of weights.

bin_bounds : array

a numpy array delimiting the profile bins (see numpy.histogram documentation)

divide_by_counts : boolean (default False)

if True, the returned profile is the array containing the sum of weights in each bin. if False, the mean weight per bin array is returned.

Returns :

profile : array

computed cylindrical profile

bin_spherical(source, center, profile_func, bin_bounds, divide_by_counts=False)

Spherical binning function for profile computing

Parameters :

center : array

center point for the profile

profile_func : function

a function taking a PointDataset object as an input and producing a numpy array of weights.

bin_bounds : array

a numpy array delimiting the profile bins (see numpy.histogram documentation)

divide_by_counts : boolean (default False)

if True, the returned profile is the array containing the sum of weights in each bin. if False, the mean weight per bin array is returned.

Returns :

profile : array

computed spherical profile

average_point(source, weight_func=None, returned=False)

Return the average point coordinates of a PointDataSource assuming an optional weight function

Parameters :

source : PointDataSource

the PointDataSource from which the average point is computed

weight_func : function, optional

function used to give a weight for each point of the PointDataSource. Takes a Dataset for single argument and returns the weight value for each point

returned : boolean, optional (default False)

if True, the sum of the weights is also returned

Returns :

av_pos : array

coordinates of the barycenter

sow : float

returned only if returned was True. Sum of the weights

amr2cube(source, var, xmin, xmax, cubelevel, out=None)

amr2cube tool.