Skip to content

philbull/SinglePixel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SinglePixel

SinglePixel is a code for modelling, simulating, and fitting the frequency spectra of complex dust foregrounds, as well as other components of the microwave sky. It operates on individual pixels (i.e. single lines of sight), hence the name.

Code

The code is written entirely in Python, and makes use of the numpy, scipy, matplotlib, mpi4py, and emcee packages. You can clone it from the philbull/SinglePixel repository on GitHub. It is available under an open source MIT license, and contributions (e.g. pull requests and bug reports) are welcome. Please cite the paper (arXiv:1709.07897) if you use or modify the code.

The following is a list of the scripts that make up SinglePixel:

  • models.py: Python classes that define the various dust models and other foregrounds.
  • model_list.py: Instantiations of the various dust/foreground model classes with representative parameter values.
  • fitting.py: Infrastructure for simulating and fitting multi-band frequency spectra.
  • run_joint_mcmc.py: Main script for running the simulation/fitting procedure over a grid of models, band specifications, and noise realisations. MPI-enabled.

If you wish to repeat the analysis in the paper, you will find everything you need in run_joint_mcmc.py. Please study the code carefully before running, as the script must be modified in order to set certain parameters. Importantly, if you do not want to generate large amounts of output by storing the raw MCMC samples to disk, make sure that you have set fname_samples = None in the model_test() function.

The run_joint_mcmc.py script accepts several command line arguments that specify the models to simulate, the models to fit, and the random seed to use. Example usage:

$ mpirun -n 2 python run_joint_mcmc.py 99 synch,2mbb_fe synch,genmbb

This fits a CMB + synchrotron + 2MBB model to a CMB + synchrotron + Fe input model, with a random seed value of 99. Note that there are no spaces between the commas.

Data

See http://philbull.com/singlepixel/ for downloadable datafiles that were generated using this code as part of our study.

About

CMBpol design work

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 69.0%
  • Jupyter Notebook 30.7%
  • Shell 0.3%