Git Product home page Git Product logo

lafabrique's Introduction

LaFabrique Build Status

ScreenShot

The package

This package contains scripts for generating simulated CMB datasets (current and future)

  • Noise
    • Generate (inhomogeneous) noise maps
  • Covariances
    • Generate covariance matrices (in the sense inverse noise weights)
  • Foregrounds
    • Generate foregrounds maps (dust, synchrotron, freefree, spinningdust, ...) based on the PySM
  • Frequency coverage
    • Multi-frequency
  • Sky coverage
    • Scanning strategy simulator included

Before starting

This code has the following dependencies (see the travis install section):

  • numpy, pylab, scipy, etc (required)
  • healpy >= 1.9.1 (required)
  • h5py (required) + libhdf5 if using linux
  • weave (optional if scipy <= v0.18 - required otherwise because no longer part of scipy v0.19)
  • ephem (required - for scanning strategy)
  • mpi4py (optional - for parallel computing)
  • InsideMe (optional - for profiling of the code, see https://github.com/JulienPeloton/InsideMe)
  • PySM (optional - foreground generation, see https://github.com/bthorne93/PySM_public)

Installation

You can easily install the package using pip

pip install LaFabrique

Otherwise, you can clone the repo from the github repository and use the setup.py for the installation. Just run:

python setup.py install

Make sure you have correct permissions (otherwise just add --user). You can also directly use the code by updating manually your PYTHONPATH. Just add in your bashrc:

LaFabriquePATH=/path/to/the/package
export PYTHONPATH=$PYTHONPATH:$LaFabriquePATH

Usage

You can find ini files to have a quick usage:

python generate_dataset.py -h
python generate_dataset.py -setup_env setup_env.ini <other options>

The code has a parallel architecture, which can be useful for large noise simulations at high resolution (simulation of scan strategy and foregrounds are done serially for the moment). For example, just use (replace mpirun by your favourite one):

mpirun -n <nproc> python generate_dataset.py
    -setup_env setup_env.ini
    -setup_scanning setup_scanning.ini
    -setup_instrument setup_instrument.ini

Note that at NERSC, you have to replace the python binary by python-mpi which is optimized for parallel computing.

Here is the breakdown of the code for 100 noise simulations for 8 frequency channels on 48 processors at a resolution of nside = 2048, and a few percent of the sky. Notice that the Cholesky factorisation is done only once per processor for each frequency band and for all MC simulations (corresponds to 48[proc] * 8[freq] = 384 calls below).

ScreenShot

License

GNU License (see the LICENSE file for details) covers all files in the LaFabrique repository unless stated otherwise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.