Skip to content

Setting up Huntsman Control Computer

Lee Spitler edited this page Feb 18, 2020 · 12 revisions

This page describes how to do a clean install of everything that is required to run Huntsman POCS.

Note: This setup assumes a Max OSX High Sierra installation

Setup environment

Environment Variables
A few environment variables should be added to your $HOME/.bash_profile. These settings might require opening a new terminal before they take effect.

Edit the file and add these at the end:

export PANUSER=huntsman
export PANDIR=/var/huntsman
export POCS=${PANDIR}/POCS
export PAWS=${PANDIR}/PAWS
export HUNTSMAN_POCS=${PANDIR}/huntsman-pocs

Install folders

sudo mkdir $PANDIR && sudo chown $PANUSER $PANDIR
mkdir -p $PANDIR/logs
mkdir -p $PANDIR/images
mkdir -p $PANDIR/mongo_data

Anaconda Python

Anaconda is used to install python and all related modules.

Setup anaconda .

curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o anaconda.sh
# The -b option assumes you agree to license
bash anaconda.sh -b -p $HOME/anaconda3
rm anaconda.sh
echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> $HOME/.bash_profile

Setup Huntsman environment . Open a new terminal and verify that you are running the anaconda version of Python. Type python -V and you should see something similar to Python 3.6.3 :: Anaconda, Inc..

To create a new environment with some default modules:

conda create -n huntsman-pocs-env python=3 numpy scipy jupyter

You will be prompted to confirm packages and will probably see a large number or them. This is okay and you should agree to them. This may take a while to run.

After install we want to ensure that the terminal is always loading this environment:

echo 'source activate huntsman-pocs-env' >> $HOME/.bash_profile

System packages

Homebrew
A few items are installed via Homebrew:

brew install pkg-config
brew install md5sha1sum
brew install cairo
brew install netpbm
brew install libpng
brew install libjpeg
~~brew install libz~~ #Not found
brew install bzip2
brew install swig
brew install cfitsio
brew install gcc
brew install gphoto2

Note: when installing cairo using homebrew, you may have to set the PKG_CONFIG_PATH environment variable manually. To do this, copy and paste:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig

Note 2: gphoto2 is not used by Huntsman, but it is needed in order for the POCS test suite to run successfully.

astrometry.net
Install astrometry.net as per the instructions.

curl http://astrometry.net/downloads/astrometry.net-latest.tar.gz -o astrometry.tgz
tar zxvf astrometry.tgz
cd astrometry.net*
make
make py
make extra
make install INSTALL_DIR=$PANDIR/astrometry
cd ../ && rm -rf astrometry.*

Clone required repositories

cd $PANDIR
git clone https://github.com/panoptes/POCS.git
git clone https://github.com/panoptes/PAWS.git
git clone https://github.com/AstroHuntsman/huntsman-pocs.git

Install module

First we need to install the requirements:

Note: You may need to install pip setuptools if you have trouble with installing gunagala. To do this, run:

pip install --upgrade setuptools
# Go to directory and install requirements
cd $POCS && pip install -r requirements.txt
# Install the POCS module
python setup.py install

# Install requirements for PAWS website
cd $PAWS && pip install -r requirements.txt

# Install requirements for HUNTSMAN
cd $HUNTSMAN_POCS && pip install -r requirements.txt
python setup.py develop

Note: You might get a failure with the install of pygraphviz while installing POCS. This can be ignored.

Misc

Data download
We need to download the astrometry.net index files as well as a coordinate database.

cd $POCS && python pocs/utils/data.py

crontab
The coordinate database downloaded above needs to be downloaded regularly to ensure accurate coordinates. In order to do this we add an entry to the crontab:

Note: The default editor for crontab is vim. If you don't know how to use vim ask a friend for help here.

Type crontab -e to edit the crontab and then enter the following line:

* 12 * * 0 /Users/huntsman/anaconda3/envs/huntsman-pocs-env/bin/python $POCS/pocs/utils/data.py

This will cause the files to be downloaded every Sunday (0) at noon (12).

Clone this wiki locally