abundancematching

A Python package for subhalo abundance matching (SHAM) with scatter.

https://github.com/yymao/abundancematching

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 4 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.9%) to scientific vocabulary

Keywords

abundance-matching astrophysics deconvolution python subhalo-abundance-matching
Last synced: 6 months ago · JSON representation ·

Repository

A Python package for subhalo abundance matching (SHAM) with scatter.

Basic Info
  • Host: GitHub
  • Owner: yymao
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 39.1 KB
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
abundance-matching astrophysics deconvolution python subhalo-abundance-matching
Created about 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

AbundanceMatching

PyPI:AbundanceMatching ascl:1604.006

A python module that implements subhalo abundance matching. This module can interpolate and extrapolate abundance functions (e.g., stellar mass function, halo mass function) and provides Peter Behroozi's fiducial deconvolution implementation (Behroozi et al. 2010).

Installation

bash pip install abundancematching

Example

Here's an example to do abundance matching with this code.

``python """ Assume you have a numpy structured arrayhalos, which contains a list of halos, with labels of the quantity names. Assume you also have a luminosity function tablelf`, whose first column is the quantity to match (e.g. magnitude), and the second column is the abundance (per Mpc^3 per Mag). """

import matplotlib.pyplot as plt from AbundanceMatching import AbundanceFunction, LFSCATTERMULT, calcnumberdensities, add_scatter, rematch

af = AbundanceFunction(lf[:,0], lf[:,1], (-27, -5))

check the abundance function

plt.semilogy(lf[:,0], lf[:,1]) x = np.linspace(-27, -5, 101) plt.semilogy(x, af(x))

deconvolution and check results (it's a good idea to always check this)

scatter = 0.2 remainder = af.deconvolute(scatter*LFSCATTERMULT, 20) x, nd = af.getnumberdensity_table() plt.plot(x, remainder/nd);

get number densities of the halo catalog

boxsize = 100 ndhalos = calcnumberdensities(halos['vpeak'], box_size)

do abundance matching with no scatter

catalog = af.match(nd_halos)

do abundance matching with some scatter

catalogsc = af.match(ndhalos, scatter*LFSCATTERMULT)

if you want to do multiple (100) realizations:

catalogdeconv = af.match(ndhalos, scatterLFSCATTERMULT, False) for __ in range(100): catalogthis = addscatter(catalog_deconv, scatterLFSCATTERMULT) catalogthis = rematch(catalogthis, catalog, af.xflipped) # do something with catalog_this ```

Owner

  • Name: Yao-Yuan Mao
  • Login: yymao
  • Kind: user
  • Location: Salt Lake City, UT, USA
  • Company: University of Utah

茅耀元. Astrophysicist at U of Utah studying dark matter & galaxies with astronomical surveys & simulations. Programmer. they/he

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: AbundanceMatching
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - family-names: Mao
    given-names: Yao-Yuan
    orcid: 'https://orcid.org/0000-0002-1200-0820'
  - family-names: Behroozi
    given-names: Peter
    orcid: 'https://orcid.org/0000-0002-2517-6446'
identifiers:
  - type: url
    value: 'https://ascl.net/2212.016'
repository-code: 'https://github.com/yymao/abundancematching'
abstract: >-
  The AbundanceMatching Python module creates
  (interpolates and extrapolates) abundance functions
  and also provides fiducial deconvolution and
  abundance matching.
license: MIT

GitHub Events

Total
  • Watch event: 1
  • Delete event: 1
  • Push event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Delete event: 1
  • Push event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 28
  • Total Committers: 4
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.536
Top Committers
Name Email Commits
Yao-Yuan Mao y****o@g****m 13
Yao-Yuan Mao y****o@s****u 12
Yao-Yuan Mao m****1@g****m 2
manodeep m****p@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 minutes
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • yymao (3)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 70 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 2
  • Total maintainers: 1
pypi.org: abundancematching

A Python package for subhalo abundance matching (SHAM) with scatter. It creates abundance functions and runs Peter Behroozi's fiducial deconvolution code.

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 70 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Average: 21.9%
Stargazers count: 23.1%
Downloads: 24.7%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy *
  • scipy *
.github/workflows/ci-test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/upload-to-pypi.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite