Skip to content

Quick Start 2016 7 4

Kiyoshi Masui edited this page Jul 4, 2016 · 3 revisions

This is a guide for setting up and running ch_L1mock on the CHIME server "moose" as of July 4, 2016. As the software, relationship between software packages (and versions thereof), and computing setup on-site evolve, these instructions may become out of date.

Github setup.

Here I will assume that you have an ssh key set up for your github account and working on moose (ssh [email protected] should indicate that you have successfully authenticated). If you really enjoy entering your password a lot, you can access github via https by changing all repository URLs. For example [email protected]:CHIMEFRB/ch_L1mock.git becomes https://github.com/CHIMEFRB/ch_L1mock.git.

Setting up an isolated python environment

The default python on moose is the out of date python 2.6 which is installed to /usr/bin. Python 2.7, is installed as /usr/local/bin/python2.7. We will use virtualenv (also installed to /usr/local/bin) to create a local, isolated python environment based on the installed python 2.7. In this guide a virtual python environment will be set up in ~/python_envs/2.7_L1mock, but you can use any location you like.

# Get an up-to-date compiler. You will want to add this to your .bashrc
source /opt/rh/devtoolset-3/enable
# Ensure /usr/local/bin is in your path, you may want to add this line to your .bashrc
export PATH=/usr/local/bin:$PATH
# Initialize a new virtual python environment.
mkdir ~/python_envs
virtualenv ~/python_envs/2.7_L1mock
# Activate this environment, you may want to add this line to your .bashrc
source ~/python_envs/2.7_L1mock/bin/activate
which python    # Should print "~/python_envs/2.7_L1mock/bin/python"

A couple of packages are best installed right away:

pip install cython numpy scipy matplotlib h5py Pillow

Installing the vdif assembler

The L1 mockup currently depends on Kiyo's fork of Kendrick's ch_vdif_assembler package.

mkdir ~/python_envs/2.7_L1mock/src
cd ~/python_envs/2.7_L1mock/src
git clone [email protected]:kiyo-masui/ch_vdif_assembler.git
cd ch_vdif_assembler
cp Makefile.local.example Makefile.local

As per the README, edit Makefile.local such that "BINDIR=$(HOME)/python_envs/2.7_L1mock/bin", "LIBDIR=$(HOME)/python_envs/2.7_L1mock/lib", "INCDIR=$(HOME)/python_envs/2.7_L1mock/include", "PYDIR=$(HOME)/python_envs/2.7_L1mock/lib/python2.7/site-packages," and "PYTHON_INCDIR=$(HOME)/python_envs/2.7_L1mock/include/python2.7". Then:

make
make install

Installing Bonsai.

The L1 mock currently depends on the V3 Development version of Bonsai.

cd ~/python_envs/2.7_L1mock/src
git clone [email protected]:CHIMEFRB/bonsai.git
cd bonsai
git checkout -b origin/devel_v3    # Change branches to development v3 version.
cp examples/Makefile.local.moose Makefile.local

Edit the Makefile.local as above for ch_vdif_assembler. Then:

make
make install

Installing ch_L1mock and dependancies.

We will use pip to install any remaining requirements, and then install ch_L1mock in develop mode.

cd ~/python_envs/2.7_L1mock/src
git clone [email protected]:CHIMEFRB/ch_L1mock.git
cd ch_L1mock
pip install -r requirements.txt
export C_INCLUDE_PATH=~/python_envs/2.7_L1mock/include/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/python_envs/2.7_L1mock/lib/
export CPLUS_INCLUDE_PATH=~/python_envs/2.7_L1mock/include/
python setup.py develop

That's it, you are ready to go!

Running the code.

The above process will have installed several programs to your path so long as the virtualenv is activated (using source ~/python_envs/2.7_L1mock/bin/activate).

The first is Kendrick's show-moose-acquisitions.py what can be used to see what base-band data is available on disk:

# To see a summary of data available.
show-moose-acquisitions.py
# To get a list of files for acquisition "20151026T084446Z_chime_beamformed"
show-moose-acquisitions.py 20151026T084446Z_chime_beamformed

Next up is Kendrick's "run-vdif-assembler". It is self documented so just try running it.

Finally there are the ch-L1mock driver programs: "corr-vdif" and "run-L1-mock". See this repository's README for usage instructions.

Issues, questions, omissions

Don't hesitate to ask Kiyo if there are any issues or questions or edit this wiki page if you notice anything missing.