xpdsim installation guideΒΆ

Before starting, make sure anaconda is installed, it is required for this installation. Note the syntax of this installation guide, as it was written, is based on Uinux system. For Windows users, please change the syntax accordingly if needed.

  1. Activate/create a python3 conda environment

  2. Install XPD stack from your terminal

    conda install -c conda-forge ipython xpdsim xpdacq xpdan
    
  3. Setting up ipython profile

    1. Create collection profile from your terminal

      ipython profile create collection
      
    2. Download the configuration file 999-load.py from xpdAcq repo.

    3. Copy and paste the configuration file into the startup directory of ipython collection profile: ~/.ipython/profile_collection/startup/.

      Note ~/ means the home directory of your machine, which depends on your OS and machine status. You can find out the exact filepath of ~ by doing the following in a Python session

      import os
      os.path.expanduser('~')
      

      More information about the ipython configuration directory can be found in their official documentaion.

  4. Create directories to simulate the machine status at the beamline

    1. At your terminal, create simulation directories

      mkdir -v ~/acqsim
      mkdir -v ~/acqsim/xpdUser
      mkdir -v ~/acqsim/xpdConfig
      
    2. Create an empty long-term beamline config file

      echo '{}' >~/acqsim/xpdConfig/XPD_beamline_config.yml
      
  5. Enter ipython with collection profile specified from your terminal. This is command is essentially the same as bsui you will be typing at beamline!

    ipython --profile=collection
    
  6. You should be prompted into an ipython session, simulating your upcoming beamline experience. Please refer to the quikstart guide in xpdAcq documentation to run your simulated beamline and enjoy playing!

    • You may find yourself need a syntax to create your simulated beamtime object and get everything running. This quick code snippet may be helpful for you.

      bt = _start_beamtime('simulation', saf_num=300000, experimenters=['Jane', 'Doe'], wavelength=0.184649)