pencil.math.integration ======================= .. py:module:: pencil.math.integration .. autoapi-nested-parse:: Contains methods for integrating quantities in different coordinate systems. Functions --------- .. autoapisummary:: pencil.math.integration.integrate Module Contents --------------- .. py:function:: integrate(quantity, dx=1.0, dy=1.0, dz=1.0, x=None, y=None, z=None, coordinate_system='cartesian', axis=(0, 1, 2)) integrate(quantity, dx=1.0, dy=1.0, dz=1.0, x=None, y=None, z=None, coordinate_system='cartesian', axis=[0, 1, 2]) Integrate a field along axis 'axis' using the trapezoidal rule. Works for Cartesian, cylindrical and spherical coordinates. Works with non-uniform grids. :param quantity: Quantity to be integrated over of shape [nz, ny, nx]. :type quantity: ndarray :param dx: Grid spacing in the three dimensions. Not needed when x, y, z are specified. :type dx: floats :param dy: Grid spacing in the three dimensions. Not needed when x, y, z are specified. :type dy: floats :param dz: Grid spacing in the three dimensions. Not needed when x, y, z are specified. :type dz: floats :param x: Radial (x), polar (y) and vertical (z) coordinates, 1d arrays. These override dx, dy and dz. Can be non-uniform grids. :type x: ndarrays :param y: Radial (x), polar (y) and vertical (z) coordinates, 1d arrays. These override dx, dy and dz. Can be non-uniform grids. :type y: ndarrays :param z: Radial (x), polar (y) and vertical (z) coordinates, 1d arrays. These override dx, dy and dz. Can be non-uniform grids. :type z: ndarrays :param coordinate_system: Coordinate system under which to take the divergence. Takes 'cartesian', 'cylindrical' and 'spherical'. :type coordinate_system: string :param axis: Axis along which to integrate. :type axis: list of int