Installing obstac dependencies
Installing obstac's dependencies
Table of Contents
1 Installing software on the precam observing computers
Perform all of this in the precam account, which has permissions to install software.
Installation of these dependencies is fairly straightforward, following standard Linux and eUPS installation idioms. Transcripts of the shell commands used to install them on one of the precam machines follows.
2 Installing pyslalib
Obstac uses pyslalib, a python wrapping of slalib, to calculate the positions of the sun and moon.
Get pyslalib and compile it
setup obstac
cd ~/install
wget --no-check-certificate http://github.com/scottransom/pyslalib/tarball/master
tar -xzf $(ls -t *pyslalib*.tar.gz | head -1)
mkdir /software/products/pyslalib-1.0.1
setup numpy
cd ~/install/scottransom-pyslalib-91244d1
python setup.py install --prefix=/software/products/pyslalib-1.0.1
Then, to test:
$ export PYTHONPATH=$PYTHONPATH:/software/products/pyslalib-1.0.1/lib/python2.6/site-packages
$ python
Python 2.6.5 (r265:79063, Nov 2 2010, 01:47:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import slalib
>>> slalib.sla_caldj(1999, 12, 31)
(51543.0, 0)
cd /software/products/pyslalib-1.0.1
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > pyslalib.table
eups declare pyslalib 1.0.1 -f Linux -r /software/products/pyslalib-1.0.1
3 Installing R
Obstac uses R for plotting (by way of the rpy2 python wrapper; see see below)
As user precam:
mkdir /tmp/install-R
mkdir /software/products/R-2.11.1
cd /tmp/install-R
wget ftp://ftp.stat.math.ethz.ch/pub/Software/R/R-patched_2010-11-08.tar.gz
tar -xzf R-patched_2010-11-08.tar.gz
cd R-patched
./configure --prefix=/software/products/R-2.11.1 --enable-R-shlib
make
make install
cd /software/products/R-2.11.1
mkdir ups
cd ups
echo 'pathPrepend(PATH, ${PRODUCT_DIR}/lib/R/bin)' > R.table
echo 'envSet(R_HOME, ${PRODUCT_DIR}/lib/R)' >> R.table
echo 'envPrepend(LD_LIBRARY_PATH, ${PRODUCT_DIR}/lib/R/lib)' >> R.table
rm -r /tmp/install-R
As self:
eups declare R 2.11.1 -f Linux -r /software/products/R-2.11.1
Obstac uses one R package: mapproj. A second R package is likely to be needed in future versions: ggplot2. These packages are best installed by way of CRAN.
First, setup R and start it:
$ setup R
$ R
Once you get an prompt from R, issue these commands to install the packages:
install.packages('mapproj')
install.packages('ggplot2')
4 Installing rpy2
rpy2 is a python wrapper around R. Obstac uses it to make the plots on the web pages.
setup numpy
setup R
mkdir /tmp/install-rpy2
mkdir /software/products/rpy2-2.1.8
cd /tmp/install-rpy2
wget http://sourceforge.net/projects/rpy/files/rpy2/2.1.x/rpy2-2.1.8.tar.gz/download
tar -xzf rpy2-2.1.8.tar.gz
cd rpy2-2.1.8
python setup.py install --prefix=/software/products/rpy2-2.1.8
cd /software/products/rpy2-2.1.8
mkdir ups
cd ups
echo 'setupRequired(R)' > rpy2.table
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' >> rpy2.table
rm -r /tmp/install-rpy2
eups declare rpy2 2.1.8 -f Linux -r /software/products/rpy2-2.1.8
5 Installing CherryPy
Obstac's interface is served by CherryPy, a very lightweight web framework for python.
mkdir /tmp/install-CherryPy
mkdir /software/products/CherryPy-3.1.2
cd /tmp/install-CherryPy
wget http://download.cherrypy.org/cherrypy/3.1.2/CherryPy-3.1.2.tar.gz
tar xzf CherryPy-3.1.2.tar.gz
cd CherryPy-3.1.2
python setup.py install --prefix=/software/products/CherryPy-3.1.2
cd /software/products/CherryPy-3.1.2
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > CherryPy.table
rm -r /tmp/install-CherryPy
eups declare CherryPy 3.1.2 -f Linux -r /software/products/CherryPy-3.1.2
You can test the installation of CherryPy by running the example script, which is a "hello world" web service. Note that the sample script runs on port 8080, so this port must be open for the test to work.
First, obtain the sample script and start serving it. In one xterm:
decam02$ setup CherryPy
decam02$ mkdir ~/test
decam02$ cd ~/test
decam02$ wget http://download.cherrypy.org/cherrypy/3.1.2/CherryPy-3.1.2.tar.gz
--2010-10-07 09:48:18-- http://download.cherrypy.org/cherrypy/3.1.2/CherryPy-3.1.2.tar.gz
Resolving download.cherrypy.org... 67.15.104.78
Connecting to download.cherrypy.org|67.15.104.78|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 319196 (312K) [application/x-gzip]
Saving to: `CherryPy-3.1.2.tar.gz'
100%[========================================================================================================================================================================================>] 319,196 791K/s in 0.4s
2010-10-07 09:48:19 (791 KB/s) - `CherryPy-3.1.2.tar.gz' saved [319196/319196]
decam02$ tar xzf CherryPy-3.1.2.tar.gz
decam02$ python ~/test/CherryPy-3.1.2/cherrypy/tutorial/tut01_helloworld.py
[07/Oct/2010:09:48:20] ENGINE Listening for SIGHUP.
[07/Oct/2010:09:48:20] ENGINE Listening for SIGTERM.
[07/Oct/2010:09:48:20] ENGINE Listening for SIGUSR1.
[07/Oct/2010:09:48:20] ENGINE Bus STARTING
[07/Oct/2010:09:48:20] ENGINE Started monitor thread '_TimeoutMonitor'.
[07/Oct/2010:09:48:20] ENGINE Started monitor thread 'Autoreloader'.
[07/Oct/2010:09:48:21] ENGINE Serving on 127.0.0.1:8080
[07/Oct/2010:09:48:21] ENGINE Bus STARTED
Now, use wget to use the web service. In another xterm:
decam02$ wget -O foo.out http://127.0.0.1:8080
--2010-10-07 09:47:42-- http://127.0.0.1:8080/
Connecting to 127.0.0.1:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12 [text/html]
Saving to: `foo.out'
100%[========================================================================================================================================================================================>] 12 --.-K/s in 0s
2010-10-07 09:47:42 (2.73 MB/s) - `foo.out' saved [12/12]
decam02$ cat foo.out
Hello world!decam02$
6 Installing pyparsing
Jim Annis provides some of the input files, such as those defining the survey footprint, in FTCL parameter file (aka "Yanny .par file) format. Obstac's Yanny .par file reader uses the pyparsing parser library.
Note that this library is only needed as part of installation of a new database, and thus may not be needed for production observing.
mkdir /tmp/install-pyparsing
mkdir /software/products/pyparsing-1.5.5
cd /tmp/install-pyparsing
wget http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.5/pyparsing-1.5.5.tar.gz/download
tar -xzf pyparsing-1.5.5.tar.gz
cd pyparsing-1.5.5/
python setup.py install --prefix=/software/products/pyparsing-1.5.5
cd /software/products/pyparsing-1.5.5
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > pyparsing.table
rm -r /tmp/install-pyparsing
eups declare pyparsing 1.5.5 -f Linux -r /software/products/pyparsing-1.5.5
7 Installing pyephem
Obstac uses pyephem to calculate the moon's phase, functionality mysteriosly missing from pyslalib.
As precam:
mkdir /tmp/install-pyemphem
mkdir /software/products/pyephem-3.7.3.4
cd /tmp/install-pyemphem
wget http://pypi.python.org/packages/source/p/pyephem/pyephem-3.7.3.4.tar.gz
tar -xzf pyephem-3.7.3.4.tar.gz
cd pyephem-3.7.3.4
python setup.py install --prefix=/software/products/pyephem-3.7.3.4
cd /software/products/pyephem-3.7.3.4
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > pyephem.table
rm -r /tmp/install-pyemphem
eups declare pyephem 3.7.3.4 -f Linux -r /software/products/pyephem-3.7.3.4
8 Installing epydoc
Web pages documenting the obstac code can be generated automatically using epydoc. Installation of this dependency is only needed if you want to serve the obstac code documentation as part of the user interface.
mkdir /tmp/install-epydoc
mkdir /software/products/epydoc-3.0.1
cd /tmp/install-epydoc
wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0.1.tar.gz
tar -xzf epydoc-3.0.1.tar.gz
cd epydoc-3.0.1/
python setup.py install --prefix=/software/products/epydoc-3.0.1
cd /software/products/epydoc-3.0.1
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > epydoc.table
echo 'pathPrepend(PATH, ${PRODUCT_DIR}/bin)' >> epydoc.table
rm -r /tmp/install-epydoc
eups declare epydoc 3.0.1 -f Linux -r /software/products/epydoc-3.0.1
9 Installing pyyaml
Some of the data loaded into the database and used in simulations are read from files in yaml format, and obstac uses pyyaml to read them.
Note that this library is only needed as part of survey simulation and installation of a new database, and thus may not be needed for production observing.
mkdir /tmp/install-pyyaml
mkdir /software/products/PyYAML-3.09
cd /tmp/install-pyyaml
wget -q http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz
tar -xzf PyYAML-3.09.tar.gz
cd PyYAML-3.09
python setup.py install --prefix=/software/products/PyYAML-3.09
cd /software/products/PyYAML-3.09
mkdir ups
cd ups
echo 'envPrepend(PYTHONPATH, ${PRODUCT_DIR}/lib/python2.6/site-packages)' > PyYAML.table
rm -r /tmp/install-pyyaml
eups declare PyYAML 3.09 -f Linux -r /software/products/PyYAML-3.09
Author: Eric H. Neilsen, Jr.
Date: November 21, 2010
HTML generated by org-mode 7.01 in emacs 23