Skip to main content

Neutron guide optimization package

Project description

Early version of guide_bot in python

This project is a rewrite of the guide_bot software that was originally coded in MATLAB, https://github.com/mads-bertelsen/guide_bot.

The purpose of guide_bot is to automate optimization of neutron guide systems given a simple job description and a description of the desired guide geometry. The guide geometry can be provided with as much or as little detail as desired, and everything not specified will be optimized. This has been used for many ESS instruments in early phases, as this allows investigating a broad range of different guide systems without much effort. guide_bot was also used at PSI for their guide upgrades for existing instruments. The guide simulations are performed by McStas and optimization was performed with iFit, usually on a cluster running SLURM.

The rewrite in python is underway and is thus far from fully functional. The rewrite will provide several important benefits:

  • Open source software, no MATLAB license required
  • Can depend on McStasScript which will handle McStas jobs, simplifying the guide_bot code
  • The original guide_bot could only scan two dimensions, and only certain were allowed, this limitation was removed
  • Much easier for the user to add a new figure of merit or source
  • Avoided complex parameter space transformations by using constraints during optimization instead
  • Can have python code executed before each optimization step, moves complexity away from instrument file
  • User defined parameters are possible, which can depend on one another using arbitrary functions
  • User defiend constraints can be added to the user defined parameters
  • Computing tasks written as pickled python code, easy to perform the task on other hardware
  • Now have unit tests (in progress)

This is the earliest public version of the software, and is not yet ready for production. There are many systems which are yet to be added, such as allowing guides that break line of sight, specification of the guide coating, only the bare minimum of plots are shown.

Currently these guide elements are implemented:

  • Straight guide (or tapered, start and end dimensions can differ, but the mirrors are straight)
  • Elliptic guide
  • Gap

Currently it is recommended to install the software in a virtual python environment, follow the steps below.

  1. clone the repository
  2. navigate to the folder in a terminal
  3. create the virtual environement with: python -m venv venv
  4. activate the virtual environemnt: source ./venv/bin/activate
  5. install required packages with pip: pip install -r requirements.txt
  6. install guide_bot with: pip install -e .

Before using guide_bot, that virtual environment need to be activated by repeating step 4.

For any suggestions on development or questions, please write Mads.Bertelsen@ess.eu The project is funded by the EU project HighNESS and is done under work package 7.

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

guide_bot-0.0.1.tar.gz (49.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: guide_bot-0.0.1.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for guide_bot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3b63ecf0d2fa75ff875d4a5fc537645f01316dff46f7efdeec1683309e9083ae
MD5 044996a98af3fad3798b4058ac0f72f7
BLAKE2b-256 5db0d96b7fedd65c59f67e061727700c4c85019224606e4829a2527ed5b05d3d

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