Skip to main content

A JSON based lattice file format

Project description

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:

{
  "name": "FODO lattice",
  "description": "This is the simplest possible strong focusing lattice.",
  "elements": {
    "D1": {"type": "Drift", "length": 0.55},
    "Q1": {"type": "Quad", "length": 0.2, "k1": 1.2},
    "Q2": {"type": "Quad", "length": 0.4, "k1": -1.2},
    "B1": {"type": "Bend", "length": 1.5, "angle": 0.392701, "e1": 0.1963505, "e2": 0.1963505}
  },
  "cells": {
    "fodo": ["Q1", "D1", "B1", "D1", "Q2", "D1", "B1", "D1", "Q1"]
  },

  "main_cell": ["fodo", "fodo", "fodo", "fodo", "fodo", "fodo", "fodo", "fodo"]
}

LatticeJSON CLI

Python Version PyPI CI

This repository also contains a Python based commandline tool which is able validate and convert LatticeJSON files into other common lattice file formats.

You can install and update it using pip or pipenv:

pip install -U latticejson

Validate a LatticeJSON file:

latticejson validate /path/to/lattice

Convert a LatticeJSON file into the elegant lattice format:

latticejson convert json elegant /path/to/lattice

License

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

latticeJSON-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

latticeJSON-0.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file latticeJSON-0.0.1.tar.gz.

File metadata

  • Download URL: latticeJSON-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for latticeJSON-0.0.1.tar.gz
Algorithm Hash digest
SHA256 891395cca6d7d8b145d26357d5af14544e6a2f712d6671106424a5f05eb496be
MD5 3cfc01350e5870d5c24d392309b2de63
BLAKE2b-256 d841fa43dd91c8d52eb12df7759e9f2fe749d32521f9fd9c811c6eed5443e52a

See more details on using hashes here.

File details

Details for the file latticeJSON-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: latticeJSON-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for latticeJSON-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8877c0720fd90aa000875a831d4357950996bdc1e4282b61b37203d609789e4e
MD5 422c168d21e0d977eee74a7dfb74d328
BLAKE2b-256 2e5312733e59e07e11c034bf93c7bbc73cb52c375c393b0b41090b7a675a208d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page