abundancematching
A Python package for subhalo abundance matching (SHAM) with scatter.
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
Repository
A Python package for subhalo abundance matching (SHAM) with scatter.
Basic Info
Statistics
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
AbundanceMatching
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
- Website: https://yymao.github.io/
- Twitter: yaoyuanmao
- Repositories: 14
- Profile: https://github.com/yymao
茅耀元. 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 | 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.
- Homepage: https://github.com/yymao/abundancematching
- Documentation: https://abundancematching.readthedocs.io/
- License: MIT
-
Latest release: 0.3.0
published about 5 years ago
Rankings
Maintainers (1)
Dependencies
- numpy *
- scipy *
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite