Getting Started

Overview of Requirements

Installation

All in One Installer

The first stop is to try the all-in-one installer for powderday. This is available at the main download page <https://bitbucket.org/desika/powderday/downloads> from the Bitbucket repository. This is a bash script that will append relevant path names to your .bashrc, as well as attempt to go package-by-package and install everything. The plus side is that if it works, it’s super easy. The downside is that if a package installation fails, you might not catch it because the bash script will go on to the next package. This installer assume gnu C and Fortran compilers.

Something that has worked for a number of users is to download the all-in-one installer, and then copy and paste the instructions for each package one at a time. This can alert the user to package failures.

Manual Installation

What follows is a self-contained installation manual, though for problematic installs of any of the sub packages, it’s definitely best to visit the main docs on the main software site (which are always linked below in each subsection).

python

powderday currently only works with python 2.x. The code was developed on, and principally tested with python 2.7.

mercurial

You’ll need this to clone powderday using mercurial (hg). If you don’t want to install mercurial, then first install yt (before powderday ) - yt ships with its own hg which you can optionally use.

powderday

Simply clone the latest and greatest from the repo:

>hg clone https://desika@bitbucket.org/desika/powderday

And that’s it! Once it’s cloned, there’s no subsidiary installation commands.

yt

powderday has yt threaded throughout, and thus needs the software to be installed to function. If you already have yt installed, be sure that it’s yt 3.x (i.e at least the ‘stable’ branch).

If you don’t have yt already installed, it’s super easy! There are many ways to do this (as directed on the yt project website. We require the standalone installer script for the Development version. This will ensure that bugs caught in or bleeding-edge features of yt are included.

fsps

fsps can be checked out with:

> git clone https://github.com/cconroy20/fsps

and directions to the installation are in the Manual

It’s likely going to be necessary downstream when installing python-fsps to have the -fPIC flags set in fsps when making. So, in the Makefile of fsps , set:

>F90FLAGS = -O -cpp -fPIC

Additionally, at this time powderday doesn’t work with the default MIST Isochrones. To fix this, you’ll need to edit sps_vars.f90 in fsps to look like:

!------set the isochrone library------!
#define MIST 0
!Padova models circa 2008
#define PADOVA 1
#define PARSEC 0
#define BASTI 0
#define GENEVA 0

Finally, the SPS_HOME variable must be set in your environment to point to the FSPS/src directory. For example, if your environment is bash, in your .bashrc set something along the lines of:

>export SPS_HOME=/Users/desika/fsps/

python-fsps

powderday depends on python hooks for fsps written by Daniel Foreman-Mackey and others called python-fsps. There are a few ways to install it. Perhaps the easiest is via a pip installer:

>pip install fsps

Though you could also install the development version:

>git clone https://github.com/dfm/python-fsps.git
>cd python-fsps
>python setup.py install

You can test the installation by opening python and typing:

>import fsps

Hyperion

Hyperion is the main work horse of powderday. The full directions for installation are well-described on the main Hyperion website. Here, we summarize the installation which should get most users through without any real difficulty.

  1. First download the tarball and unpack it.:

    >tar -xzvf hyperion.xxx
    >cd hyperion.xxx
    
  2. Install the fortran dependencies:

    >cd deps/fortran
    >python install.py <prefix>
    

where <prefix> is where you want the libraries to be installed. To avoid conflicts with other packages, I usually install somewhere like:

>python install.py /usr/local/hyperion

as suggested by the Hyperion docs. Ensure that the following commands return something sensible:

>which mpif90
>which h5fc

if not, your path probably needs to include wherever the <prefix> directory pointed to.

  1. Install any remaining python dependencies. These are listed here

  2. Install Hyperion itself. To do this:

    >cd hyperion.xxx
    >python setup.py install
    

or:

>python setup.py install --user

if you don’t have root access. At this point:

>import hyperion

from within python should work, and typing:

>hyperion

at the command line should return something along the lines of:

>usage: hyperion [-h] [-f] [-m n_cores] input output
>hyperion: error: too few arguments

if not, check the the path that is near one of the last lines of the setup.py installation (that is something associated with the number 755) and make sure it’s in your path. Ir’s most likely to be a python binaries directory.

You then have to install the Fortran Binaries:

>./configure  --prefix=prefix
>make
>make install

where the prefix is wherever you installed the Fortran libraries before. Make sure this works by typing at the command line:

>hyperion_sph

which should return something like:

>Usage: hyperion_sph [-f] input_file output_file


.. _Hyperion_dust:

Hyperion Dust Files

Unless you’ve written your own dust files, you will likely want to use the pre-compiled dust files developed by Tom Robitaille (though don’t ship with Hyperion due to their size). To install these download them here: http://docs.hyperion-rt.org/en/stable/dust/dust.html. Then to install:

>tar xvzf hyperion-dust-xxx.tar.gz
>cd hyperion-dust-0.1.0
>python setup.py build_dust

If you want to use the PAH model in powderday, you’ll additionally need these files in the same dust directory. To download, click on the link, then click ‘raw’ on the right side of each page.

  1. https://github.com/hyperion-rt/paper-galaxy-rt-model/blob/master/dust/big.hdf5
  2. https://github.com/hyperion-rt/paper-galaxy-rt-model/blob/master/dust/vsg.hdf5
  3. https://github.com/hyperion-rt/paper-galaxy-rt-model/blob/master/dust/usg.hdf5

Please note the caveat that the PAH files are generated using some approxmations described in Robitaille et al., and we encourage the user of these PAH files to read this paper, especially section 3.4.2.

Troubleshooting your Installation

python-fsps installation issues

1. python-fsps can’t find f2py

f2py is a numpy package that is sometimes named f2py2.7 by numpy. At the same time, python-fsps expects it to be called f2py (as it sometimes is; for example in Anaconda). So, you might need to locate f2py (it ships with yt, so if you for example use the yt python) you need to link the following files:

>cd /Users/desika/yt-x86_64/bin
>ln -s f2py2.7 f2py

and:

>cd /Users/desika/yt-x86_64/lib/python2.7/site-packages
>ln -s numpy/f2py/ f2py

This should hopefully fix it.

  1. Issues with ‘f2py’ in the python-fsps installation:

    Numpy has made some changes to f2py in the 1.10.x version of numpy. The easiest fix is to use a non 1.10.* version of numpy (thanks to Ben Johnson for finding this).

3. python-fsps has mysterious installation failures. Often this has to do with a bad FSPS compilation. Even if it seems like FSPS has compiled, it may not actually execute properly if the correct compilers aren’t set in the MakeFile. Thanks to Ena Choi for pointing this one out.