gaiamock
This is a package for simulating Gaia astrometry at the epoch level. Install it from PyPI with:
pip install gaiamock
Binary wheels include GSL and are available for Linux (Intel/AMD and ARM64) and macOS 15 or later (Intel and Apple Silicon). After installation, download the scanning-law data as described in step (3) below. If pip needs to build from source, or you want to install the development version, follow steps (1) and (2).
(1) If you don't already have it installed, install GSL, which is needed to compile gaiamock's C code. For example:
| macOS (Homebrew) | brew install gsl |
| Debian/Ubuntu | sudo apt install libgsl-dev |
| conda | conda install -c conda-forge gsl |
| HPC clusters | module load gsl (before running pip below) |
(2) Install gaiamock with pip:
pip install git+https://github.com/kareemelbadry/gaiamock.git
or, if you want to edit the code, clone this repository and install it in editable mode:
git clone https://github.com/kareemelbadry/gaiamock.git
cd gaiamock
pip install -e .
This installs the required packages (numpy, matplotlib, astropy, healpy, and joblib) and compiles kepler_solve_astrometry.c. GSL is found automatically if gsl-config is on your PATH or GSL is in a standard location (Homebrew, conda, /usr/local, /usr). If yours is somewhere else, point pip at it with GSL_DIR=/path/to/gsl pip install ..., where /path/to/gsl is the directory containing include/gsl/.
Some optional features need extra packages, which pip can install for you with e.g. pip install -e ".[all]":
[mcmc] (emcee and scipy) for the MCMC fitting functions, and [dust] (mwdust) to simulate sources distributed throughout the Galaxy with dust.
(3) Download the precomputed Gaia scanning law (healpix_scans.zip: 49152 fits files, 984 MB after unzipping) by running
gaiamock-download
in a terminal. By default this puts the data in ~/.gaiamock. To keep it somewhere else, set the environment variable GAIAMOCK_DATA_DIR to that directory, both when downloading and when using gaiamock. gaiamock-download --where prints where gaiamock looks for the data.
If the download doesn't work, download healpix_scans.zip in a browser from this link and then run gaiamock-download path/to/healpix_scans.zip to unpack it into the right place.
If you already downloaded the data for an older version of gaiamock, you don't need to download it again:
- if you installed from your existing clone with
pip install -e ., the healpix_scans/ directory (and healpix_16_med_ruwe.npz) at the top of the clone, where older versions of these instructions put them, is still found automatically. - otherwise, set
GAIAMOCK_DATA_DIR=/path/to/old/gaiamock(the directory containing healpix_scans/), or move healpix_scans/ into ~/.gaiamock.
(4) You are ready to go! Some basic functionality is demonstrated in the docs/demo.ipynb notebook. You can check that everything works with pip install -e ".[test]" and then pytest.
A simple bash submission script to run on a cluster is provided in docs/example_bash_submission.py. That reproduces Fig 13 of the paper.
This code is regularly updated and includes functionality beyond what is shown in the demo. If you have questions, or if you spot a bug, please contact me at kelbadry@caltech.edu.
The release distribution is licensed under GPL-3.0-or-later because it links to GNU GSL. The original MIT notice for gaiamock-authored source is retained. Each official wheel includes the complete corresponding source for gaiamock and its bundled GSL in gaiamock/_sources/. See THIRD_PARTY_NOTICES for license details and rebuild instructions.
A modified version to predict RUWE more reliably for small orbits and single stars
The default version of gaiamock does a pretty good job of predicting RUWE for binaries with "large" photocenter orbits -- see e.g. Figure 1 of this paper. However, it doesn't accurately predict the RUWE distribution of single stars or binaries with barely-detectable orbital motion: it predicts a RUWE distribution that is narrower than observed. There are at least two reason for this:
(a) The default gaiamock bins (i.e. averages) the 8-9 measurements from individual CCDs during a single FOV transit for computational speed. This reduces the variance in the predicted RUWE due to shot noise.
(b) The observed Gaia data (at least in DR3) displays systematic trends in the median RUWE with sky position, likely in part due to crowding (e.g. the median RUWE for bright stars is lowest near the Galactic center). The origin of these trends is not well understood.
An unbinned mode of gaiamock is available to improve the reliability of RUWE predictions. It does away with binning (and therefore is slower by a factor of a few, but still fast enough for most applications), and implements an empirical position-dependent rescaling of the epoch-level astrometric uncertainties. This is probably not the optimal way to model RUWE, but it is significantly more reliable than the default version of the code.
To use it, do the following:
(1) From this link, download the individual_ccds.zip and healpix_16_med_ruwe.npz files, and install them with
gaiamock-download individual_ccds.zip healpix_16_med_ruwe.npz
This unzips individual_ccds.zip into the same healpix_scans/ directory as the default scans (you can leave the other files that are already there).
(2) Pass binned=False to the functions that predict epoch astrometry (predict_astrometry_luminous_binary, predict_astrometry_binary_in_terms_of_a0, predict_astrometry_single_source) and to the functions you fit it with (e.g. fit_full_astrometric_cascade, check_ruwe). The functions that do both (run_full_astrometric_cascade, run_only_5par_solution, and simulate_many_realizations_of_a_single_binary) take binned=False too, e.g.
res = gaiamock.run_full_astrometric_cascade(..., binned=False)
This replaces the separate gaiamock_mod.py file used by older versions of gaiamock.
Metadata
Release files for gaiamock 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gaiamock-1.0.0.tar.gz | 18.0 MB | With provenance | Details for gaiamock-1.0.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| gaiamock-1.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details for gaiamock-1.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
| gaiamock-1.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 | Details for gaiamock-1.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
| gaiamock-1.0.0-py3-none-macosx_15_0_x86_64.whl | Python 3 | none | macOS 15.0+ x86-64 | Details for gaiamock-1.0.0-py3-none-macosx_15_0_x86_64.whl |
| gaiamock-1.0.0-py3-none-macosx_15_0_arm64.whl | Python 3 | none | macOS 15.0+ ARM64 | Details for gaiamock-1.0.0-py3-none-macosx_15_0_arm64.whl |
Total release size: 66.8 MB
Release files / gaiamock-1.0.0.tar.gz
| Download URL | gaiamock-1.0.0.tar.gz |
|---|---|
| Size | 18.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40429ae2834422a4754ea567936283cf51a14dcd7d49c196929ec9d6704436b9
|
|
BLAKE2b-256 checksum How to use checksums |
dc440c054abfab9d29e50fc3ac49b817e79eb219078e07aa1daef7c2f845a5a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / gaiamock-1.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | gaiamock-1.0.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 14.1 MB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
5e22ac68848c9463e71478ef25160410a9c9c5723830453f2e14ff1dde9c8279
|
|
BLAKE2b-256 checksum How to use checksums |
dd4b1e929192cfebdbd4954c6e7f94ea0a43efbf18931592f57f3d20dd16d31c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / gaiamock-1.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | gaiamock-1.0.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 13.8 MB |
| Tags | Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
c48a8373b6b692b80c8cf006956349d0f5b269d1658ef2c3b05abcf14bca7b4f
|
|
BLAKE2b-256 checksum How to use checksums |
ac62ac7702b4ebe062837d4b12451d104ddff2c0bd708cc8258bf4a029014701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / gaiamock-1.0.0-py3-none-macosx_15_0_x86_64.whl
| Download URL | gaiamock-1.0.0-py3-none-macosx_15_0_x86_64.whl |
|---|---|
| Size | 10.6 MB |
| Tags | Python 3 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
19947388f1974523f12bd274eeac86e23dd5adc4f7ba809cd110ad7ea18bff2e
|
|
BLAKE2b-256 checksum How to use checksums |
34b1c45c747467f7ee2b41850916febe938dbb2a651bebf73eab69e82e39581c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logRelease files / gaiamock-1.0.0-py3-none-macosx_15_0_arm64.whl
| Download URL | gaiamock-1.0.0-py3-none-macosx_15_0_arm64.whl |
|---|---|
| Size | 10.3 MB |
| Tags | Python 3 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7cfdc26d1c0831b0fa69a10f58b9b417eecb24abd9d96be3b5024d312f58f977
|
|
BLAKE2b-256 checksum How to use checksums |
7ca2569bd4f081b1d2f68367ef0477fc8b6ff48eaef6cfd5ffc333afda4d7bdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logSecurity for gaiamock 1.0.0
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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for gaiamock-1.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.
Transparency logA 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.