Download and cache a lightweight version of the Gaia catalog for offline work
Project description
gaiahealpixcache
Download and cache a lightweight version of the Gaia DR3 catalog for offline work.
This tool follows the official HEALPix level 8 partitioning of the Gaia archive, enabling on-demand partial download with a pure NumPy backend. Much faster than querying the online archive for large amounts of data.
Installation
uv pip install gaiahealpixcache
Or from source:
git clone https://github.com/betoule/gaiahealpixcache.git
uv venv
source .venv/bin/activate
uv pip install -e .
Usage
Query sources around sky coordinates
import gaiahealpixcache
sources = gaiahealpixcache.query(ra_deg=76.377, dec_deg=52.831, radius_arcmin=30)
print(len(sources))
print(sources["source_id"][:5])
print(sources["phot_g_mean_flux"][:5])
Convert to topocentric coordinates
import gaiahealpixcache
from astropy.time import Time
now = Time.now()
mjd = now.mjd
sources = gaiahealpixcache.query(ra_deg=76.377, dec_deg=52.831)
topo = gaiahealpixcache.gaia_to_topocentric(
sources,
mjd=mjd,
lon_deg=5.71,
lat_deg=43.93,
height_m=640.0,
)
print(topo["ra_apparent_deg"][:5])
print(topo["alt_deg"][:5])
Manage cache
cache_dir = gaiahealpixcache.get_cache_dir()
print(f"Cache location: {cache_dir}")
gaiahealpixcache.clear_cache()
API
| Function | Description |
|---|---|
query(ra_deg, dec_deg, radius_arcmin) |
Query Gaia sources within a circular region |
gaia_to_topocentric(catalog, mjd, ...) |
Convert ICRS catalog to topocentric coordinates |
center_at_date(ra, dec, mjd) |
Get apparent RA/Dec at a given date |
get_pixlist(ras, decs, level) |
Get HEALPix pixels for coordinates |
get_pix_range(ra, dec) |
Get Gaia file pixel ranges for coordinates |
retrieve_gaia_data(pixel_range) |
Download/cache a single Gaia tile |
haversine(ra1, dec1, ra2, dec2) |
Great-circle distance in degrees |
get_cache_dir() |
Get cache directory path |
clear_cache() |
Remove all cached data |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gaiahealpixcache-0.1.0.tar.gz.
File metadata
- Download URL: gaiahealpixcache-0.1.0.tar.gz
- Upload date:
- Size: 63.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dc590297504358c9dac7f78bd52a150fd213e5923cb3cfbd59186f8205d5936
|
|
| MD5 |
9a23bd14149750aa583d8ddddf276315
|
|
| BLAKE2b-256 |
8df6a8d6b1bf5761ab1ec641af5fae69c3387f924d50c64449f61e3d26482c6f
|
File details
Details for the file gaiahealpixcache-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gaiahealpixcache-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e710b364c7c174dc4231d5707ba3b4ffdf6e4015bea285e2ed11febc8cc9d6
|
|
| MD5 |
9d259befbfc6f3c092d4e27040458770
|
|
| BLAKE2b-256 |
6c00218e3ecd8a2676699d7a50597fc191e0e25466bc5b8acef4c550836a3444
|