Skip to end of metadata
Go to start of metadata


PhoSim is the LSST Project's simulator package, which will be used for one or more DM tutorials. The following instructions are for a no-fuss installation on your desktop compute platform, with minimal attention to the full capabilities of the PhoSim software. PhoSim and the LSST Stack share some third-party library dependencies. 

Load the LSST Environment

You must have the LSST Stack installed on your system (see LSST Stack Installation) to proceed. The commands listed in the code blocks below primarily assume you are using the bash shell; analogous commands for (t)csh should work as well. If you have not already done so, load the LSST environment:

source $INSTALL_DIR/loadLSST.bash          # bash users

where $INSTALL_DIR is the directory where the LSST Stack was installed. 


See the PhoSim reference page for details. Use git to access the LSST code repository (install git on your system if you want to use a different version than the one the LSST environment provides). Then download the most recent version of phoSim (for the time being you will need to specify the tag "v3.4.1") in an appropriate directory: 

cd /path/to/phosim/install/phosim/directory
git clone -b v3.4.1
cd phosim

Two packages upon which PhoSim depends, cfitsioand fftw3, are already installed in the LSST Stack. Setup these packages and retrieve their paths from environment variables:

setup cfitsio
setup fftw
printenv CFITSIO_DIR
/path/to/lsstStack/arch/cfitsio/3310+2   # use the path for your system
printenv FFTW_DIR
/path/to/lsstStack/arch/fftw/3.3.2+2     # use the path for your system

Now install PhoSim. Provide their paths to the configuration script (and no, it is not possible to use shell variables for the path names): 

cd /path/to/phosim/install/phosim/directory
# [Omitting welcome message...]
#The photon simulator requires the installation of cfitsio and fftw3.
#Would you like to have this script: 
#  (a) install these from source, 
#  (b) look for existing installations, or 
#  (c) specify the paths by hand? 
Please enter the path to libcfitsio.a: /path/to/lsstStack/arch/cfitsio/3310+2/lib/
Please enter the path to fitsio.h: /path/to/lsstStack/arch/cfitsio/3310+2/include/
Please enter the path to libfftw3.a: /path/to/lsstStack/arch/fftw/3.3.2+2/lib/
Please enter the path to fftw3.h: /path/to/lsstStack/arch/fftw/3.3.2+2/include/

Now build the package and setup: 

make           # make the phoSim package
mkdir ups      # prepare package for EUPS
echo 'envPrepend (PATH, ${PRODUCT_DIR})' >> ups/phosim.table
echo 'envPrepend (PATH, ${PRODUCT_DIR}/bin)' >> ups/phosim.table
setup -k -r .

An optional test run for a single star, which will validate that the install went as intended, will produce individual raw amp images and an Eimage in the /work subdirectory: 

./phosim examples/star -c examples/nobackground    # writes output to ./work

PhoSim SED Library

Now install the library of source SEDs

cd data/SEDs
curl -O
tar xzvf SEDs.tar.gz

The SED library includes galaxies (and AGNs), stars, and a "flat" SED that contains equal flux per unit energy. 

Using PhoSim

See the tutorial on Process PhoSim Images, or the PhoSim Cookbook for instructions on simulating images.

  • No labels