Getting Started

Overview of Requirements

Installation

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 should work with python >=2.7 or >=3.5, but has not been heavily used under >=3.5. Please file an issue if you encounter one.

As you will see, powderday currently requires a particular branch of yt. As a result, one path that we have seen work well for users is to set up a different python environment for the powderday installation. This could look something like (assuming a conda installation of python):

>conda create --name pd_environment
>source activate pd_environment

(And then when you want to exit the environment, you can type):

>source deactivate pd_environment

Then, whenever you’re in the pd_environment, everything you install will remain contained to that particular installation of python, and not conflict with any of your other installed packages.

powderday

Simply clone the latest and greatest from the repo:

>git clone https://github.com/dnarayanan/powderday.git

To install, cd into the cloned repository and run the usual python setup.py install.

yt

yt 3.x comes bundled with Hyperion, so it is not necessary to install it on its own. However, as of Summer 2019, development has begun on making powderday use yt 4.x, the ‘demeshed’ version of yt. The powderday - yt 4.x update is in its early stages and is not expected to function properly just yet. That being said, development is taking place on the pd-4.x branch of powderday, and instructions for setting it up to run with yt 4.x are at the bottom of this section.

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

if your gcc version is lower than 4.3.0, or:

>F90FLAGS = -O3 -mtune=native -cpp -fPIC

if gcc is version 4.3.0 or higher. This can be checked with gcc --version. 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

To explicitly compile:

make clean
make

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

python-fsps will be installed automatically by the powderday setup.py script.

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 Installation page for Hyperion. Here, we summarize the installation which should get most users through without any real difficulty.

There are two ways to install Hyperion. The first is via conda:

>conda install -c conda-forge hyperion

Note, this will eventually become deprecated for powderday (or at least modified as the Hyperion conda install ships with yt 3.x, and eventual upgrade to yt 4.x is coming in Summer 2019.

The second and manual way to install Hyperion follows: 1. First clone the main repository.:

>git clone https://github.com/astrofrog/hyperion.git
  1. Install the python module:

    >cd hyperion
    >pip install .
    
  2. Ensure that if you type::

    >hyperion

it returns a sensible output. It should return something along the lines of:

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

If it can’t find Hyperion, 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.

  1. Install the Fortran binaries:

    > ./configure
    

or:

>./configure --prefix=$HOME/local

or some such path if you aren’t administrator on your computer. Note for this step you’ll need your compilers, MPI and HDF5 installations active (so, on a supercomputer you might need to load these modules such as [for example, on the University of Florida HiPerGator supercomputer]):

>module load git/2.14.1  intel/2018.1.163  openmpi/3.1.0  libz/1.2.8 hdf5/1.10.1

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.

yt-4.x configuration [WIP]

In the future, yt will eventually transition from 3.x to 4.x. The latter offers a number of advantages including a demeshed handling of particle datasets, as well as an arepo front end. We are happy to announce that as of December 31st, 2019 via hash 59315f311535b5f2309c705f5a71519148aa4f29, powderday is now yt 4.x compliant.

The following offer documentation for installing yt 4.x, as well as a slightly different order of operations for powderday code dependency installation. Please note, yt 4.x is still in development mode, and should be treated as such. The following documentation utilizes not-yet-merged in branches of yt for example, and all 4.x features should be considered experimental currently.

First, it is recommended to make a new python environment in which to run the 4.x development branch:

> conda create -n pd4env
> conda activate pd4env

Our entire goal here is to install powderday that is dependent on yt 4.x. Since Hyperion comes with yt 3.x, we a few options, neither of which are particularly elegant.

The easiest way to handle this is to install Hyperion as normal, via:

>conda install -c conda-forge hyperion

And then install yt 4.x. The latter is installed via first ensuring that you have all of the dependencies installed:

>pip install numpy jupyter sphinx gitpython h5py matplotlib cython nose scipy astropy sympy mpi4py

followed by actually installing yt:

>git clone https://github.com/AshKelly/yt.git
>cd yt
>git checkout yt-4.0-new-octree
>git pull
>pip install -e .

If we do this, this will overwrite the yt 3.x installation that ships with Hyperion, and you should be good to go. To check that everything worked, make sure the output of the following commands look something like this:

> ipython
In [1]: import yt
In [2]: yt.__version__
Out[2]: '4.0.dev0'

Note, in the above we are actually not yet installing the master branch of yt 4.x, but rather Ashley Kelly’s branch which is still experimental. As Ash’s branch gets merged into the master yt 4.x branch, we will update these docs.

The second way of handling this, which is no longer recommended as it can be a bit painful and with varying success rates, is to install Hyperion with the --no-deps flag, since you will install the dependencies manually in the next step:

> conda install --no-deps -c conda-forge hyperion

Now, install all of the dependencies Hyperion needs, except yt:

> conda install -c conda-forge astropy atomicwrites attrs backports backports.functools_lru_cache backports.shutil_get_terminal_size backports_abc configparser contextlib2 cycler cython dbus decorator enum34 expat fastcache fontconfig freetype funcsigs functools32 futures gettext glib gmp gmpy2 gst-plugins-base gstreamer h5py hdf5 hyperion-fortran icu importlib_metadata ipython ipython_genutils jpeg kiwisolver libblas libcblas libgfortran-ng libiconv liblapack libpng libuuid libxcb libxml2 linecache2 matplotlib more-itertools mpc mpfr mpi mpich mpmath numpy openblas packaging pathlib2 pcre pexpect pickleshare pluggy prompt_toolkit pthread-stubs ptyprocess py pygments pyparsing pyqt pytest python-dateutil pytz qt scandir simplegeneric singledispatch sip six subprocess32 sympy tornado traceback2 traitlets unittest2 wcwidth xorg-libxau xorg-libxdmcp xz zipp

At this point, test your Hyperion installation by trying_:

import hyperion

If this doesn’t work, repeat:_:

> conda install --no-deps -c conda-forge hyperion

Now, install clone the 4.x development branch from the yt 4.x as above.

As long as the rest of powderday ‘s dependencies have been installed, at this point you should be good to go.

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.

  1. Hyperion does not run with MPI support. Some users have found that when manually installing Hyperion (as opposed to using the conda installation) that MPI will then work.
  2. On the HiPerGator supercomputing cluster, Hyperion will not install manually, complaining about mismatches with gcc and HDF5. The solution to this is to use the intel compilers. The following is a known pacakge combination that works:
>module load git/2.14.1 intel/2018.1.163 openmpi/3.1.0 libz/1.2.8 hdf5/1.10.1

Hyperion Installation Issues

  1. Manual installations seem to not be fully updated from the Hyperion website. The following issues are known (uncovered by Katarina Kraljic)

    1. Hyperion-0.9.10 does not contain the /deps/fortran directory. It will be necesary to take this from version 0.9.9

    2. /deps/fortran/install.py hardcodes some links that do not exist anymore. The URLs should be updated as:

      ZLIB_URL = “http://zlib.net/zlib-1.2.11.tar.gz” HDF5_URL = ‘http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.gz

    3. Hyperions configure file doesn’t have an option for an MPI

    compiler that is mpif90.openmpi. One option is to add this to the configure file around line 1940:

    if test "$mpi_compiler" == mpif90.openmpi
       then
          mpi_compiler=`basename $(mpif90 -show | awk {'print $1'})`
    fi