You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
##nt2.py
1
+
# nt2.py
2
2
3
3
Python package for visualization and post-processing of the [`Entity`](https://github.com/entity-toolkit/entity) simulation data. For usage, please refer to the [documentation](https://entity-toolkit.github.io/wiki/content/2-howto/2-vis/#nt2py). The package is distributed via [`PyPI`](https://pypi.org/project/nt2py/):
4
4
5
5
```sh
6
6
pip install nt2py
7
7
```
8
8
9
-
###Usage
9
+
## Usage
10
10
11
11
Simply pass the location to the data when initializing the main `Data` object:
12
12
@@ -28,7 +28,7 @@ data.spectra # < xr.Dataset
28
28
29
29
> Note, that by default, the `hdf5` support is disabled in `nt2py` (i.e., only `ADIOS2` format is supported). To enable it, install the package as `pip install "nt2py[hdf5]"` instead of simply `pip install nt2py`.
30
30
31
-
####Accessing the data
31
+
### Accessing the data
32
32
33
33
Fields and spectra are stored as lazily loaded `xarray` datasets (a collection of equal-sized arrays with shared axis coordinates). You may access the coordinates in each dimension using `.coords`:
selects all the particles of species 1, 2, and 4 on the last timestep. The loading of the data itself is done by calling: `.load()` method, which returns a simple `pandas` dataframe.
63
63
64
-
####Plotting
64
+
### Plotting
65
65
66
66
Plot a field (in Cartesian coordinates) at a specific time (or output step):
67
67
@@ -164,7 +164,7 @@ nt2e.makeFramesAndMovie(
164
164
)
165
165
```
166
166
167
-
####Raw readers
167
+
### Raw readers
168
168
169
169
In case you want to access the raw data without using `nt2py`'s `xarray`/`dask` lazy-loading, you may do so by using the readers. For example, for `ADIOS2` output data format:
170
170
@@ -194,7 +194,7 @@ reader.ReadArrayAtTimestep(
194
194
There are many more functions available within the reader. For `hdf5`, you can simply change the import to `nt2.readers.hdf5`, and the rest should remain the same.
195
195
196
196
197
-
###CLI
197
+
## CLI
198
198
199
199
Since version 1.0.0, `nt2py` also offers a command-line interface, accessed via `nt2` command. To view all the options, simply run:
> If you want to only install the CLI, without the library itself, you may do that via `pipx`: `pipx install nt2py`.
224
224
225
-
###Features
225
+
## Features
226
226
227
227
1. Lazy loading and parallel processing of the simulation data with [`dask`](https://dask.org/).
228
228
2. Context-aware data manipulation with [`xarray`](http://xarray.pydata.org/en/stable/).
229
229
3. Parallel plotting and movie generation with [`loky`](https://pypi.org/project/loky/) and [`ffmpeg`](https://ffmpeg.org/).
230
230
4. Command-line interface, the `nt2` command, for quick plotting (both movies and snapshots).
231
231
232
-
###Testing
232
+
## Testing
233
233
234
234
There are unit tests included with the code which also require downloading test data with [`git lfs`](https://git-lfs.com/) (installed separately from `git`). You may download the data simply by running `git lfs pull`.
0 commit comments