Metadata-Version: 2.1
Name: lick
Version: 0.3.0
Summary: Package that uses a Line Integral Convolution library to clothe a 2D field (ex: density field) with a LIC texture, given two vector fields (ex: velocity (vx, vy))
Author: G. Wafflard-Fernandez, C.M.T. Robert
License: GPL-3.0
Project-URL: Homepage, https://github.com/volodia99/lick
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# lick
[![PyPI](https://img.shields.io/pypi/v/lick.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/lick/)
[![PyPI](https://img.shields.io/badge/requires-Python%20≥%203.8-blue?logo=python&logoColor=white)](https://pypi.org/project/lick/)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/volodia99/lick/main.svg)](https://results.pre-commit.ci/latest/github/volodia99/lick/main)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)


Line Integral Convolution Knit : Package that uses a Line Integral Convolution library to clothe a 2D field (ex: density field) with a LIC texture, given two vector fields (ex: velocity (vx, vy)).

Author: Gaylor Wafflard-Fernandez

Author-email: gaylor.wafflard@univ-grenoble-alpes.fr

<p align="center">
    <img src="https://raw.githubusercontent.com/volodia99/lick/main/imgs/lick.png" width="800"></a>
</p>

## Installation

Install with `pip`

```
pip install lick
```

To import lick:

```python
import lick as lk
```

The important functions are ```lick_box``` and ```lick_box_plot```. While ```lick_box``` interpolates the data and perform a line integral convolution, ```lick_box_plot``` directly plots the final image. Use ```lick_box``` if you want to have more control of the plots you want to do with the lic. Use ```lick_box_plot``` if you want to take advantage of the fine-tuning of the pcolormesh parameters.

## Example

```python
import numpy as np
import matplotlib.pyplot as plt
from lick import lick_box_plot

fig, ax = plt.subplots()
x = np.geomspace(0.1, 10, 128)
y = np.geomspace(0.1, 5, 128)
a, b = np.meshgrid(x, y)
v1 = np.cos(a)
v2 = np.sin(b)
field = v1 ** 2 + v2 ** 2
lick_box_plot(
    fig,
    ax,
    x,
    y,
    v1,
    v2,
    field,
    size_interpolated=256,
    xmin=1,
    xmax=9,
    ymin=1,
    ymax=4,
    niter_lic=5,
    kernel_length=64,
    cmap="inferno",
    stream_density=0.5
)
plt.show()
```


### vectorplot

The core LIC implementation was authored by Anne Archibald, and is forked from
https://github.com/aarchiba/scikits-vectorplot
