Skip to main content

Codes for the paper: Unexpected clustering pattern in dwarf galaxies challenges formation models

Project description

Dwarf Galaxies Adorning the Ink Wash Painting of Cosmic Web

Last commit Workflow Status MIT License PyPI

The package holds the codes for the paper Unexpected clustering pattern in dwarf galaxies challenges formation models (Ziwen Zhang et al. Nature 2025, 642, 47-52, arXiv:2504.03305).

What did we discover in this work?

A surprising pattern of spatial distribution was discovered in dwarf galaxies that diffuse ones cluster more strongly than compact ones - reversing the trends seen in massive galaxies. This challenges the structure formation models within the standard cold-dark-matter cosmology, calling for revisions for the understanding of the assembly of visible- and dark-matter structures.

Installation

To install the package, run:

pip install dwarf-assembly-bias

Alternatively, you can clone the repository and install the package locally via pip install -e /path/to/the/repo.

Resources for the paper

Code samples

Code samples are organized as individual programs, scripts or jupyter-notebooks, each for a specific procedure in producing the results in the paper. All code samples are put under docs/code_samples/:

  • dwarf_sample.ipynb: loading and filtering the observed dwarf galaxy sample.
  • cal_2pccf/: program for two-point cross-correlation function (2PCCF) in observation.
  • cov_fit.py, fit_bias.py: measuring the covariance matrix and fitting the relative bias.
  • Mhalo.py: HI-based halo mass estimation by assuming Burkert profile.
  • galaxy_web_cross.py: program for galaxy-cosmic web (knots, filaments, sheets and voids) 2PCCFs, for a sample of galaxies with given real-space locations. galaxy_web_cross_from_obs_sample.py: is similar but takes input galaxies in redshift-space and make a correction for the redshift-space distortion before calculating the 2PCCFs.
  • theory.ipynb: theoretical interpretations (galaxy-galaxy 2PCCF in theory, abundance matching, model of self-interaction dark matter).

Data for running the codes: In order to run the code samples, please download the data at Quark cloud, and put them under docs/code_samples/data/.

Data for the figures

Here we provide all the data sheets, and scripts to load the data sheets and generate the figures exactly as those presented in the paper. All of these are held under docs/figures/. Specifically,

  • data/: Excel data sheets, one for each Figure or Extended Data Figure.
  • plots_observation.py: scripts to generate observational figures (Fig. 1 and Extended Data Figs. 1-7).
  • plots_theory.ipynb: scripts to generate theoretical figures (Figs. 2, 3, 4 and Extended Data Fig. 8).

For developers

Contribute to the project

Pull requests are welcome. For any changes, start a pull request to the dev branch and we will review it.

For users

Citation

We ask the users to cite the paper when using the package (code or data) in their research.

Users using specific module/code sample should also follow the copyright header in the source files.

Issues

Any issue is welcomed. If you have any question or suggestion, please open an issue on Github and we will provide a reply as soon as we can. You are also welcomed to contact any of the authors of the paper directly through email (see below for the contact information).

Details of this work

Sample construction

The samples and subsamples of observed dwarf galaxies are briefly described in the paper (Methods: "The sample of dwarf galaxies"). In more detail, the parent sample of galaxies and catalog of galaxy groups can be obtained at this site. Note that we used the model magnitudes and colors, and the corresponding version of group catalog modelC and galaxy catalog imodelC_1 (with a selection r <= 17.72 already applied). From the galaxy catalog, the most massive galaxy in each group is taken as the central galaxy. R_50 and Sersic index are supplied in an additional galaxy magnitudes table at the same site. Note that R_50 is in the unit of pixel, and should be converted into arcsec by 1 pixel = 0.396 arcsec. MPA-JHU stellar mass is obtained from their site (file totlgm_dr7_v5_2b.fit; the MEDIAN field).

Here we also provide the sample of dwarf galaxies used in this paper (see the above code samples dwarf_sample.ipynb for the usage).

To measure the 2PCCF from observation, two additional sets of samples are constructed:

  • The reference sample, used as field tracers, is a magnitude-limited sample constructed from the NYU-VAGC sample following the following selection criteria described in Sec. 2.1 of Lixin Wang et al. 2019: the $r$-band Petrosian apparent magnitude $r<17.6$; the $r$-band Petrosian absolute magnitude in $[-24, -16]$; the redshift $0.01 < z < 0.2$.
  • The random samples, used to account for the observational selection effects, is obtained according to the method described in Sec. 3.1 of Cheng Li et al. 2006 as follows. We generated ten duplicates for each galaxy in the reference sample and randomly place them in the SDSS survey area. All other properties, including stellar mass and redshift of the duplicates, are the same as those of the parent galaxy. The random sample thus has the same survey geometry, the same distributions of galaxy properties and redshift, as the reference sample.

Acknowledgements

We thank Fangzhou Jiang for his open source project of self-interaction dark matter (Fangzhou Jiang et al. 2023; ads; github). A copy the source code can be found under src/dwarf_assembly_bias/sidm/.

We thank Hui-Jie Hu for his subroutines of HI-based halo mass estimator. A copy of the source code can be found at docs/code_samples/Mhalo.py.

Contacts

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwarf_assembly_bias-0.0.3.tar.gz (77.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwarf_assembly_bias-0.0.3-py3-none-any.whl (87.7 kB view details)

Uploaded Python 3

File details

Details for the file dwarf_assembly_bias-0.0.3.tar.gz.

File metadata

  • Download URL: dwarf_assembly_bias-0.0.3.tar.gz
  • Upload date:
  • Size: 77.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for dwarf_assembly_bias-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1f09f3193d05b3e3ea3466320e05911791ff4b96b1e32f2fd82c4602b7d7e0ea
MD5 4b437e0f8dee4b2bd8070d604fdeba20
BLAKE2b-256 c7e6be0baa41269e779551c5057137a3346ffe35444fccec8721129d980590d0

See more details on using hashes here.

File details

Details for the file dwarf_assembly_bias-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for dwarf_assembly_bias-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bb92350d9791852bce4ecb76282b9050fcd3c51e902b8ee197a2e1232e6dfb0c
MD5 56439ac1d4eea631a17acb6e21b4d3f6
BLAKE2b-256 1d1caab6fa7d8172c71c70257463303162fd47fa16d714388816a74679c76d35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page