pencil.calc.streamlines ======================= .. py:module:: pencil.calc.streamlines .. autoapi-nested-parse:: Traces streamlines of a vector field from z0 to z1, similar to 'streamlines.f90'. Classes ------- .. autoapisummary:: pencil.calc.streamlines.Stream Module Contents --------------- .. py:class:: Stream(field, params, xx=(0, 0, 0), time=(0, 1), metric=None, splines=None) Bases: :py:obj:`object` Contains the methods and results for the streamline tracing for a field on a grid. Trace a field starting from xx in any rectilinear coordinate system with constant dx, dy and dz and with a given metric. call signature: tracer(field, params, xx=[0, 0, 0], time=[0, 1], metric=None, splines=None): Keyword arguments: *field*: Vector field which is integrated over with shape [n_vars, nz, ny, nx]. Its elements are the components of the field using unnormed unit-coordinate vectors. *params*: Simulation and tracer parameters. *xx*: Starting point of the field line integration with starting time. *time*: Time array for which the tracer is computed. *metric*: Metric function that takes a point [x, y, z] and an array of shape [3, 3] that has the comkponents g_ij. Use 'None' for Cartesian metric. *splines*: Pre-computed spline coefficients for tricubic interpolation. This can speed up the calculations greatly for repeated streamline tracing on the same data. Should be computed using scipy.ndimage.spline_filter with order=3 for each vector component, i.e.: splines = np.array([spline_filter(field[0], order=3), spline_filter(field[1], order=3), spline_filter(field[2], order=3)]) .. py:attribute:: params .. py:attribute:: xx :value: (0, 0, 0) .. py:attribute:: time :value: (0, 1) .. py:attribute:: section_l .. py:attribute:: total_l .. py:attribute:: iterations .. py:attribute:: section_dh .. py:attribute:: total_h :value: 1