The code can be obtained through the PhoSim git repository using an appropriate tagged version. It is easiest to simply download a tarball of the latest version. First, unzip and untar the code in the desired installation directory.

Then to configure the code and installing the two dependencies (cfitsio and fftw) by:


Then, to build the code simply do:


Note PhoSim requires python >= 2.6 and a c++ compiler that supports the c++14 standards. To test with a simulation of a single star and no background:

./phosim examples/star -c examples/nobackground

To activate the graphical user interface (GUI) simply do:


Note: to run the GUI you may need to have tkinter installed.


The default usage is: 

phosim instanceCatalog

The instanceCatalog specifies the configuration of the observation and the astrophysical inputs.

For more complex usage:

phosim instanceCatalog -c physicsCommands -i instrumentSiteDirectory<generic>

The physicsCommands modify the default (realistic) physics.

The instrumentSiteDirectory points to the instrument and site characteristics files. A number of implemented observatories are currently included in PhoSim.

This library of SEDs can be used with the simulator that are curated at the Spanish Virtual Observatory and the Space Telescope Institute. Put the SEDs into the directory data/SEDs after untarring.

The output is a stream of FITS files.

For larger simulations, there are two options for parallelization. One that parallelizes at the chip level will run N copies of the raytrace portion of the calculation.

phosim instanceCatalog -p N

This is only useful when simulating a catalog covering more than one chip. Another multi-threads the calculation in the raytrace on a per astronomical source basis:

phosim instanceCatalog -t M

These options could even be used together in a complementary manner. To see a speed up, you should have N*M cores available.

To only simulate a specific chip or group of chips (e.g. "chipname1|chipname2|chipname3") use the -s option:

phosim instanceCatalog -s chipname

To have PhoSim instantly open the simulated file(s) when they are completed with ds9 use the --ds9 option:

phosim instanceCatalog --ds9

To print the phosim version, use:

phosim -v

For a series of tutorials to get started, please follow the PhoSim Tutorials.

If you don't want to run PhoSim, you can also download some sample images.

This code is also developed for use on large-scale grid computing using CONDOR with the -g condor option. Use phosim -h for a full listing of options. There is also the PhoSim visualizer for plotting the rays in 3-d, which is useful for implementing new telescopes.

Detailed Information

Current Release Notes and Limitations