Code Monkey home page Code Monkey logo

subgen's Introduction

SubGen: a fast subhalo sampler

SubGen generates Monte-Carlo samples of dark matter subhaloes, according to the unified subhalo distribution model in Han et. al. (2015; http://arxiv.org/abs/1509.02175).

Get Started

To get started, check example.py. You only need to specify the host halo mass, and the number of subhaloes to sample.

Prerequisites

You need a python installation with the core scientific packages: numpy, matplotlib and scipy. You also need the emcee package(http://dan.iel.fm/emcee) for MCMC sampling. Try

 easy_install numpy matplotlib scipy emcee

or

 pip install numpy matplotlib scipy emcee

to install these dependences if you miss them.

The basic sample contains:

  • R: radial coordinate of subhalo, in unit of host R200

  • m: subhalo mass, in unit of 10^10Msun/h. By default, disrupted subhaloes are also included in the sample (which may not be useful at all). You can suppress the creation of disrupted subhaloes, and only obtain survived population, by, e.g.,

      sample=SubhaloSample(M=1e4, include_disruption=False)
    
  • mAcc: subhalo infall mass, in unit of 10^10Msun/h

  • weight: the number of appearances of this subhalo. This exists because the number of sampled subhaloes may not be the same as the expected number of subhaloes. The subhalo abundance can be correctly recovered when counting with this weight. By default, the weights are not uniform but determined by mass function in order to avoid the sample being dominated by low mass objects. If you want uniform weights, you can do, e.g.,

      sample=SubhaloSample(M=1e4, weighted_sample=False).
    

optional properties:

  • mStar/[1e10Msun/h], the subhalo stellar mass
  • Luminosity/[(1e10Msun/h)^2/(kpc/h)^3], annihilation luminosity (adopting Ludlow14 mass-concentration by default)
  • Rp/R200, projected (along a line of sight) radial coordinate Rp.

For complete features, have a look at the docstrings and the source code (they are not long~).

Authors

Jiaxin Han (@Kambrian)[ICC, Durham] http://kambrian.github.io/SubGen

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.