Skip to main content

Physics online simulator with FRIB built upon PHANTASY framework

Project description

Online Model App

This is a high-level physics application (HLA) built upon phantasy framework. The EPICS controls environment is provided by ARIS virtual accelerator (VA) (pre-separator), the UI skeleton is provided by phantasy-ui, and the device controls is provided by phantasy.

This repository keeps the generated project files as the start point of the development of a HLA to visualize the beam ellipse drawing with the simulation results from FLAME model. This HLA also works with the real machine.

Initialize App Skeleton

Be sure to update the required packages, do sudo apt update && sudo apt upgrade in the Terminal.

# the working directory is /tmp
$ makeBasePyQtApp --app aris-va-ellipse --template AppWindow
What's the name of this package? (default: mypkg) aris_apps
What's the name of the app, also the command to run it? (default: myApp) online_model
Generating aris-va-ellipse with template AppWindow...
Successfully made an base app at '/tmp/aris-va-ellipse'.
What to do next:
> Install package: cd /tmp/aris-va-ellipse; make deploy
> Run app by executing online_model
> Edit .ui file with 'frib_designer', and the .py files.
> Update the package: cd /tmp/aris-va-ellipse; make redeploy
> Happy Coding!

Start ARIS VA

Set environmental variable PHANTASY_CONFIG_DIR in your ~/.bashrc file persistently to point to the location where keeps the VA configuration files, e.g.:

export PHANTASY_CONFIG_DIR=$HOME/phantasy-machines

Start VA from Terminal:

phytool flame-vastart --mach ARIS_VA --subm F1

Communicate with ARIS VA

Use phantasy to control the VA in an interactively way in Python terminal.

from phantasy import MachinePortal

# Instantiate the portal of the machine
mp = MachinePortal("ARIS_VA", "F1")

# Find the device by type, see the doc of mp.get_elements()
# first quad could be found by:
quad0 = mp.get_elements(type='QUAD')[0]

# Explore the attributes of quad0 through dot syntax
# e.g. the current gradient value could be got by .B2
quad0.B2

# Set the B2 field by assigning with a new value, e.g.
quad0.B2 = 10

Development Workflow

  1. Edit .ui file in frib_designer, which is a command tool from package phantasy_ui;
  2. Convert .ui files to .py files by executing make in the ui folder;
  3. In the project root folder, type make redeploy to update the package and execute the command (i.e. online_model) to run the app, or just type make run;
  4. Uninstall the package by: pip uninstall <pkg_name> (for this case, pkg_name is aris_apps), or type make uninstall.

Note

If the command online_model cannot be found, you'll have to update PATH env, i.e.

echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aris_apps-2.0.0-py3-none-any.whl (510.7 kB view details)

Uploaded Python 3

File details

Details for the file aris_apps-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: aris_apps-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 510.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.12

File hashes

Hashes for aris_apps-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fd86b73c1a0d8506ad34397d8b7b0426189d9ea31e71382f7f36c7a88cd47a
MD5 a05d6d186eba3779c6146e8b51b48544
BLAKE2b-256 161967eb77420c1f5345f55d304e7f21d8052ec35e64e5d1054cb71776ab45fb

See more details on using hashes here.

Supported by

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