|
| 1 | +Command line tool |
| 2 | +***************** |
| 3 | + |
| 4 | +**apace** also has a simple command line tool which gets automatically installed when installing with pip. This tool is currently work in progress, but the calculation of the Twiss parameter should already be functioning. |
| 5 | + |
| 6 | +Installing the CLI |
| 7 | +================== |
| 8 | + |
| 9 | +The **apace-cli** should be already available if apace was installed using pip. It can be invoked from the command line via:: |
| 10 | + |
| 11 | + apace |
| 12 | + |
| 13 | +Getting Help |
| 14 | +============ |
| 15 | + |
| 16 | +To get help use the :code:`--help` flag, |
| 17 | + |
| 18 | +.. code:: |
| 19 | +
|
| 20 | + apace --help |
| 21 | +
|
| 22 | +which should output something like this: |
| 23 | + |
| 24 | +.. code:: text |
| 25 | +
|
| 26 | + usage: apace [-h] [--version] {help,twiss,convert} ... |
| 27 | +
|
| 28 | + This is the apace CLI. |
| 29 | +
|
| 30 | + positional arguments: |
| 31 | + {help,twiss,convert} |
| 32 | + help Get help |
| 33 | + twiss plot or save twiss functions to file |
| 34 | + convert convert lattice files. |
| 35 | +
|
| 36 | + optional arguments: |
| 37 | + -h, --help show this help message and exit |
| 38 | + --version show program's version number and exit |
| 39 | +
|
| 40 | +
|
| 41 | +
|
| 42 | +
|
| 43 | +The twiss subcommand |
| 44 | +==================== |
| 45 | + |
| 46 | +Plot Twiss parameter for a given lattice: |
| 47 | + |
| 48 | +.. code:: sh |
| 49 | +
|
| 50 | + apace twiss path/to/lattice.json |
| 51 | +
|
| 52 | +Other options: |
| 53 | + |
| 54 | +.. code:: |
| 55 | +
|
| 56 | + usage: apace twiss [-h] [-o OUTPUT_PATH] [-v] [-q] [-show] |
| 57 | + [-ref REF_LATTICE_PATH] [-y_min Y_MIN] [-y_max Y_MAX] |
| 58 | + [-s SECTIONS] [-pos POSITIONS] [-m MULTI_KNOB] |
| 59 | + path [path ...] |
| 60 | +
|
| 61 | + positional arguments: |
| 62 | + path Path to lattice file or directory with lattice files. |
| 63 | +
|
| 64 | + optional arguments: |
| 65 | + -h, --help show this help message and exit |
| 66 | + -o OUTPUT_PATH, --output_path OUTPUT_PATH |
| 67 | + Output path for plot |
| 68 | + -v, --verbose Verbose |
| 69 | + -q, --quiet Quiet |
| 70 | + -show, --show_plot show interactive plot |
| 71 | + -ref REF_LATTICE_PATH, --ref_lattice_path REF_LATTICE_PATH |
| 72 | + Path to reference lattice |
| 73 | + -y_min Y_MIN Min Y-value |
| 74 | + -y_max Y_MAX Max Y-value |
| 75 | + -s SECTIONS, --sections SECTIONS |
| 76 | + Plot Twiss parameter at given sections. Can be a |
| 77 | + 2-tuple (START, END), the name of the section or |
| 78 | + sequence those '[(START, END), SECTION_NAME, ...]'. |
| 79 | + -pos POSITIONS, --positions POSITIONS |
| 80 | + Print Twiss parameter at given positions. Can be a |
| 81 | + number, a 2-tuple (START, END), a section name or |
| 82 | + sequence of those. |
| 83 | + -m MULTI_KNOB, --multi_knob MULTI_KNOB |
| 84 | + Multi-knob (Assumes plot) |
| 85 | +
|
| 86 | +
|
| 87 | +
|
| 88 | +
|
0 commit comments