A python library for mapping between Fusion data formats
Project description
pytokamap
Quickstart
The example below maps signals from a UDA shot to a Zarr or NetCDF file.
import pytokamap
mapper = pytokamap.load_mapping("uda.jinja", "globals.json")
mapper.to_zarr(30420, "30420.zarr")
mapper.to_netcdf(30420, "30420.nc")
With the following example template mapping file called uda.jinja
:
{
{% macro comma(loop) %}
{% if not loop.last %},{% endif %}
{% endmacro %}
"amc/plasma_current": {
"MAP_TYPE": "PLUGIN",
"PLUGIN": "UDA",
"ARGS": {"signal": "ip", "format": "IDA"},
"SCALE": 1000
},
{% for index in range(1, TCAM.N+1) %}
"_xsx/tcam_{{index}}": {
"MAP_TYPE": "PLUGIN",
"PLUGIN": "UDA",
"ARGS": {"signal": "XSX/TCAM/{{ index }}", "format": "IDA"}
},
{% endfor %}
"xsx/tcam": {
"MAP_TYPE": "CUSTOM",
"CUSTOM_TYPE": "COMBINE",
"ARGS": [
{% for index in range(1, TCAM.N+1) %}
"_xsx/tcam_{{index}}"{{ comma(loop) }}
{% endfor %}
]
}
}
And the following globals.json
file:
{
"TCAM": {
"N": 3
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytokamap-2024.0.0.tar.gz
(13.0 kB
view details)
Built Distribution
File details
Details for the file pytokamap-2024.0.0.tar.gz
.
File metadata
- Download URL: pytokamap-2024.0.0.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c2757accdd5017ccecea7ae97ad2fd20d95186f8f8513905798bf00211d67de |
|
MD5 | c3f7af998828f1e45a196f7e38b3f662 |
|
BLAKE2b-256 | a0f6c7bce9df7c57d787487ed459a1470fdbe750a2b901b63573c33507624ed7 |
File details
Details for the file pytokamap-2024.0.0-py3-none-any.whl
.
File metadata
- Download URL: pytokamap-2024.0.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1123735cc0259c77dfc34d1fa266142b718eed356e4ff9fc9077bfb55e379b18 |
|
MD5 | c5560e3d80c1d51c751093ce30732341 |
|
BLAKE2b-256 | 72b1ee5376079b54ed3100692714d1daff5a2e11eb66bb9684fa106180e07016 |