Load.find_contour#

pyPLUTO.Load.find_contour(self, var: str | ndarray, check: bool = True, **kwargs: Any) list[source]#

Generate contour lines for a given variable.

Parameters:
- cmap: str, default ‘k’

The colormap to use to associate each level with a color. The colormap can also be a color, which is used for all the levels. If not provided, all the lines are associated with the color black.

- levels: int | np.ndarray, default 10

The levels of number of levels or the list of levels for the contours. If an integer is provided, the levels are generated using a linear or logarithmic scale. If an array is provided, the levels are taken from the array.

- levelscale: str, default ‘linear’

The scale of the levels. Available options are ‘linear’ and ‘logarithmic’.

- transpose: bool, default False

If True, the variable is transposed.

- var (not optional): str | np.ndarray

The variable to plot. If a string is provided, the variable is taken from the dataset.

- vmax: float, default np.max(var)

The maximum value of the variable.

- vmin: float, default np.min(var)

The minimum value of the variable.

- x1: np.ndarray, default self.x1

The x1 coordinates. If the geometry is non-Cartesian, the x1 cartesian coordinates are taken from the dataset.

- x2: np.ndarray, default self.x2

The x2 coordinates. If the geometry is non-Cartesian, the x2 cartesian coordinates are taken from the dataset.

—-
Returns:
  • lines_list: list

    List of contour lines. The strcuture of the list is [[x1, y1], [x2, y2], …] where x1, y1, x2, y2 are numpy arrays representing the coordinates of the field lines.

Examples

  • Example #1: Generate contour lines for a given variable.

    >>> lines_list = find_contour(var)
    
  • Example #2: Generate contour lines for a given variable and coordinates.

    >>> lines_list = find_contour(var, x1=x1, x2=x2)
    
  • Example #3: Generate contour lines for a given variable and coordinates

    with a logarithmic scale.

    >>> lines_list = find_contour(var, x1=x1, x2=x2,
    >>> ... levelscale='logarithmic')
    
  • Example #4: Generate contour lines for a given variable and coordinates

    with a logarithmic scale and a colormap.

    >>> lines_list = find_contour(var, x1=x1, x2=x2,
    >>> ... levelscale='logarithmic', cmap='jet')