This is a package to measure number counts from confused images using the P(D) formalism and an affine-invariant MCMC. Both one band (i.e., number counts) and 2D (number counts with color information) models are supported. It was developed with sub-mm/mm astronomy in mind, but is in principle useful for other problems. However, it does assume sub-mm/mm conventions, such as per-beam normalization of the input data.
Installation is via the standard UNIX configure
and
make
. pofd_affine depends on the following packages:
- FFTW. Generating a FFTW wisdom file will speed up the code signficantly.
- cfitsio
- hdf5
- The GNU scientific library
- MPI. There are many versions of MPI, but OpenMPI is what I used.
- If you want to use the built in tests, you'll need
googletest
It may be necessary to tell configure where to look for these
libraries -- see
configure --help
.
Note that this package requires C++11 support from your compiler; it may be necessary to add compiler flags to turn this on.
In addition, pofd_affine comes with an optional Python script
to print summaries and make plots of the results. This
can be installed by going into the affine_plots subdirectory
and executing python setup.py install
.
This requires the Python libraries:
- h5py
- matplotlib
- numpy
- scipy
Although probably the best way to install them is to use
pip
, if for some reason they aren't already present.
There isn't much. Doxygen style documentation can be generated using
make docs
but that isn't really all that helpful. All of the command
line routines have some built in documentation using --help
:
pofd_affine_getPD --help
Note that some routines -- including pofd_affine_mcmc
-- have to
be run using MPI.
There are some built in tests (unit and otherwise) that can be built if you have used --enable-test when configuring, and then do
make check
There are also some examples, which can be built if --enable-examples is set while configuring.
The basic idea is to create a specfile that tells the code about the data, an initfile that specifies the model and initial position, and then run something like
mpiexec pofd_affine_mcmc -H initfile specfile outfile.h5
Note that this can take a while to run. Summary statistics are then created using
pofd_affine_getStats outfile.h5 stats.h5
and can be plotted if the optional python package is installed using
make_affine_plots stats.h5
All of these routines have numerous additional options.
The master branch contains the P(D) code. The base branch has only code related to the affine-invariant MCMC.
- The original P(D) paper is Scheuer (1957),
- A more recent and easier to read discussion is Patanchon et al. (2009), which gives results from BLAST.
- The most recent P(D) results from SPIRE can be found at Glenn et al. (2010).
- The affine invariant MCMC method used in this code is detailed in Goodman and Weare (2010), and the method of parallelizing it in Foreman-Macket et al. (2012); the MCMC routines here are to first order a re-implementation of the emcee package in c++ with lots of P(D) routines added.