Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# plotter-python
Python plot tools for nse projects.
## Installation
Clone current repository and go the downloaded directory
```shell
git clone http://tesla.parallel.ru/Lizzzka007/plotter-nse
cd plotter-nse
```
Install it with *pip*
```shell
pip install .
```
Sometimes `pip` refers to *Python 2* package manaager, not *Python 3*.
In this case install the package with
```shell
python3 -m pip install .
```
Install it with *conda*
```shell
conda develop .
```
## Usage
After installation you can use *plotter-python* tools in your python scripts.
Import *plotter* module somewhere at the beginning of your script
```python
import plotter
```
### get variable names from file
Use `plotter.dump(filename)` to get variable names in file `filename`.
Data must be stored either in *Tecplot* ASCII file with *.plt* or *.nsx* extensions.
Positional arguments for functions `plotter.plot, plotter.ani_plot, plotter.plot_contour, plotter.avg_plot`:
<ol>
<li>filename</li>
</ol>
Optional arguments for functions `plotter.plot, plotter.ani_plot, plotter.plot_contour, plotter.avg_plot`:
<ol>
<li>out</li>
<li>oname</li>
<li>var</li>
<li>mval</li>
</ol>
The argument `filename` is the name of a file to read for functions `plotter.plot, plotter.plot_contour, plotter.avg_plot` and the template of filenames for the function `plotter.ani_plot`. `out` is the output directory to save a function result. `oname` is the output name of a function result. `var` is a list or a single variable denoting names(name) to process (may be got from `plotter.dump` function). `mval` is a list or a single variable denoting maximum valid absolute values(value) of `var` variables: values which satisfy the condition `var` > `mval` are set as NaN.
### plotting a 1D data
Calling
```python
plotter.plot(filename)
```
saves XY plots of 1D data contained in file `filename` into *out/oname* file.
### plotting animation of a 1D data
Calling
```python
plotter.ani_plot(filename)
```
saves animation of XY plots of 1D data contained in file `filename` into *out/oname* file.
### plotting a 2D data
Calling
```python
plotter.plot_contour(filename)
```
saves XY contour plots of 2D data contained in file `filename` into *out/oname* file.