LatticeJSON
LatticeJSON is a JSON based lattice file format. JSON is able to describe complex data structures, has a human readable syntax and is available in all common programming language. It is therefore an appropriate choice to characterize the magnetic lattice of a particle accelerator.
Specification
This repository contains the Specification of LatticeJSON in form of a JSON Schema.
Example
A LatticeJSON file for a FODO lattice:
{
"version": "2.2",
"title": "FODO Lattice",
"info": "This is the simplest possible strong focusing lattice.",
"root": "ring",
"elements": {
"d1": ["Drift", {"length": 0.55}],
"q1": ["Quadrupole", {"length": 0.2, "k1": 1.2}],
"q2": ["Quadrupole", {"length": 0.4, "k1": -1.2}],
"b1": ["Dipole", {"length": 1.5, "angle": 0.392701, "e1": 0.1963505, "e2": 0.1963505}]
},
"lattices": {
"cell": ["q1", "d1", "b1", "d1", "q2", "d1", "b1", "d1", "q1"],
"ring": ["cell", "cell", "cell", "cell", "cell", "cell", "cell", "cell"]
}
}
LatticeJSON CLI
This repository also contains a Python based command-line tool which is able validate and convert LatticeJSON files into other common lattice file formats and vice versa.
You can install and update it using pip or pipenv:
pip install -U latticejson
Validate a LatticeJSON file:
latticejson validate /path/to/lattice.json
Convert an elegant lattice file to the LatticeJSON format:
latticejson convert --to json /path/to/lattice.lte
Autoformat one or more LatticeJSON files:
latticejson autoformat /path/to/lattice.json ...
To activate Bash completion add
eval "$(_LATTICEJSON_COMPLETE=source latticejson)"
to your .bashrc. Or, create an activation script with:
_LATTICEJSON_COMPLETE=source latticejson > latticejson-complete.sh
License
Metadata
Release files for LatticeJSON 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| LatticeJSON-0.1.6.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| LatticeJSON-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.2 kB
Release files / LatticeJSON-0.1.6.tar.gz
| Download URL | LatticeJSON-0.1.6.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e77a174c4b60307d69d5352311bcb9dee06da9ed5ef33c4359fbf7b55e785ce9
|
|
BLAKE2b-256 checksum How to use checksums |
055e705e40f8c312d306c3e27cc3d85ff9ab35a9eaeb6285ef63f381f5fe409d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10
|
Release files / LatticeJSON-0.1.6-py3-none-any.whl
| Download URL | LatticeJSON-0.1.6-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ba495aee6d33332c36f8a6aeae3ec2cb7367b5c73dcae6aaeb1d8607d330f8ee
|
|
BLAKE2b-256 checksum How to use checksums |
eb0b0b7f13034021e2a81d5ecb12f0e4522659093ceb62288816f4d7f4456fed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.10
|