Skip to main content

Template PyPI Read the Docs Tests Status Coverage Status

A package to count galaxy pairs at light speed and estimate 2-point correlation functions of large galaxy samples or mock catalogs, that works with angular, projected and redshift-space coordinates. Its main features are:

  • Speed
    By calling Fortran routines that implement efficient skip-list/linked-list algorithms, it can be extremely fast
  • Parallel
    Employs the OpenMP framework to make use of multi-core CPUs
  • User-defined Weights and Error Estimates
    Accepts weighted pair counts defined by the user and can also estimate statistical boostrap errors with minimal overhead
  • User-friendly and Flexible
    By carefully wrapping Fortran code in a suitable Python framework, it is very easy to use and extend its functionality by both novice and seasoned users
  • Bonus Track
    Lots of auxiliary and plotting functions to produce nice, paper-ready plots for 1D/2D correlations, complete with ratios, labels and even power-law fits

Getting Started

Input data consists of astropy tables (see Astropy Tables), which provides an excellent I/O framework for a variety of formats (ASCII, VOTable, FITS tables, etc.)

Gundam also employs special dictionaries (see Munch) to pack multiple parameters or output fields at once. Such dictionaries have attribute-like access with dot notation. If you are used to ipython's dot+tab completion you will love this.

A typical usage workflow consists of:

  1. Read data into astropy tables, usually one table for the "data" sample and another one for the "random" sample.
  2. Create and customize a dictionary for input parameters (e.g. to set binning, cosmology, estimator, etc.)
  3. Calculate the statistic (correlation function or simply the pair counts for a given geometry)
import gundam as gun
from astropy.table import Table

gals = Table.read('red_gals.fits')   # Read data
rans = Table.read('red_rans.fits')   # Read randoms
gals['wei'] = 1.                     # If there are no weights, just fill with 1's
rans['wei'] = 1.                     # If there are no weights, just fill with 1's

par = gun.packpars(kind='pcf')       # Get defaults for a proj. corr. function (pcf)
par.h0      = 69.5                   # Change H0
par.nsepp   = 24                     # Set 24 bins in projected separation
par.dsepp   = 0.1                    # Each of size 0.1 dex
par.estimator = 'LS'                 # Pick Landy-Szalay estimator 

c = gun.pcf(gals, rans, par, nthreads=4)   # Estimate pcf using 4 threads

c.qprint()                           # Quickly check the output fields (dd, rr, etc.)
gun.cnttable(c)                      # Or show counts in your browser
gun.cntplot(c)                       # Or plot the pcf

For further information please read-the-docs here. There is a very decent introduction so you can start using Gundam within 5 minutes, and of course the full API.

Example Runs

Data and code for 3 examples demonstrating typical use cases are provided in the repo (example_lrg.py, example_pcf.py and example_redblue.py). For the moment these are couple plots to illustrate what can be done with Gundam in just a few lines of code

   

Prerequisites

You will need to have these:

Installing

To install Gundam, you have two choices: (1) use pip, or (2) build from scratch. Method (1) is useful if you simply want to use gundam. Method (2) on the other hand allows easy access to modify or extend the Fortran counting routines.

To install via pip execute:

pip install gundam

If you want to contribute to the package, you need to clone the Gundam repository and install with the "dev" optional dependencies.

git clone https://github.com/lincc-frameworks-mask-incubator/gundam.git
cd gundam
pip install -e .'[dev]'
pre-commit install

By default, this will compile and build the library in-place. Feel free to modify the CMakeLists file to suit your needs.

Contributing

Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests to us.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Metadata

Release files for gundam 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gundam 0.0.2
File Size Uploaded Provenance Actions
gundam-0.0.2.tar.gz 25.5 MB Without provenance Details for gundam-0.0.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for gundam 0.0.2
File Actions
gundam-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for gundam-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
gundam-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details for gundam-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
gundam-0.0.2-cp39-cp39-macosx_14_0_arm64.whl CPython 3.9 CPython 3.9 macOS 14.0+ ARM64 Details for gundam-0.0.2-cp39-cp39-macosx_14_0_arm64.whl
gundam-0.0.2-cp39-cp39-macosx_12_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 12.0+ x86-64 Details for gundam-0.0.2-cp39-cp39-macosx_12_0_x86_64.whl

Total release size: 30.0 MB

Release files / gundam-0.0.2.tar.gz

Download URL gundam-0.0.2.tar.gz
Size 25.5 MB
Tags Source
SHA-256 checksum
How to use checksums
ce11bf9c7ad329c8e35c2739d175f4cff8c956d440ab5de46ea8721ac5fa5c77
BLAKE2b-256 checksum
How to use checksums
730a924b617b2acc0d1c2d41f1ea3c5e2437069376b4eda71552f1c3798bc84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / gundam-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL gundam-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e0da1695686a6fb09ef2435138304452277abaaa2c8859c990db8c28fb444d7c
BLAKE2b-256 checksum
How to use checksums
575b5e0914fa9e475d098d92da66e24680f4bce9bcdbb46b1e9737062b7633ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / gundam-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL gundam-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 700.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
d7a2361cf30113d40010012145886ad871e67350e7bb86ada380f0d7987a63ea
BLAKE2b-256 checksum
How to use checksums
733fa5c34c121f5db85dabb519ff06592b9432ab33c25ca4fe788032dd65b492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / gundam-0.0.2-cp39-cp39-macosx_14_0_arm64.whl

Download URL gundam-0.0.2-cp39-cp39-macosx_14_0_arm64.whl
Size 1.0 MB
Tags CPython 3.9 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
730a8e532698d6631129650ec461b4c850ef1f97f31139b92390954464f16418
BLAKE2b-256 checksum
How to use checksums
1400385b9cfa9b773402f4cf5ea89b9fb2f1328acd67c910e813e51d14038700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / gundam-0.0.2-cp39-cp39-macosx_12_0_x86_64.whl

Download URL gundam-0.0.2-cp39-cp39-macosx_12_0_x86_64.whl
Size 1.6 MB
Tags CPython 3.9 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
657ef4b88733e65d3a61c3b3bbf7eec2143f33ed7f11064a3bf3400c92e91586
BLAKE2b-256 checksum
How to use checksums
517c61f5078416186275f8f4b6fb1f1abb687ac401eaf73954949f1d80c6c7c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.4

Security for gundam 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

5 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page