Skip to main content

Coverage Status

extcats

Organize and query astronomical catalogs

This modules provides classes to import astronomical catalogs into a mongodb database, and to efficiently query this database for positional matches.

Description:

The two main classes of this module are:

  • CatalogPusher: will process the raw files with the catalog sources and creates a database. See insert_example notebook for more details and usage instruction.

  • CatalogQuery: will perform queries on the catalogs. See query_example for examples and benchmarking.

Supported queries includes:

  • all the sources with a certain distance.
  • closest source at a given position.
  • binary search: return yes/no if anything is around the positon.
  • user defined queries.

The first item on the above list (cone search around target) provides the basic block for the other two types of positional-based queries. The code supports tree types of basic cone-search queries, depending on the indexing strategy of the database.

  • using HEALPix: if the catalog sources have been assigned an HEALPix index (using healpy <https://healpy.readthedocs.io/en/latest/#>_).
  • using GeoJSON (or 'legacy coordinates'): if the catalog documents have the position arranged in one of these two formats (example <https://docs.mongodb.com/manual/geospatial-queries/>_), the query is based on the $geoWithin and $centerSphere mongo operators.
  • raw: this method uses the $where keyword to evaluate on each document a javascript function computing the angular distance between each source and the target. This method does not require any additional field to be added to the catalog but has, in general, poorer performances with respect to the methods above.

All the core functions are defined in the catquery_utils module. In all cases the results of the queries will be return an astropy.table.Table objects.

Notes on indexing and query performances:

The recommended method to index and query catalogs is based on the GeoJSON coorinate type. See the example_insert notebook for how this can be implemented.

Performant queries requires the database indexes to reside in the RAM. The indexes are efficiently compressed by mongodb default engine (WiredTiger), however there is little redundant (and hence compressible) information in accurately measured coordinate pairs. As a consequence, GeoJSON type indexes tends to require fair amount of free memory (of the order 40 MB for 2M entries). For large catalogs (and / or small RAM) indexing on coordinates might not be feasible. In this case, the HEALPix based indexing should be used. As (possibly) many sources shares the same HEALPix index, compression is more efficient into moderating RAM usage.

Installation:

The easiest way to install the Python library is with pip:

pip install extcats

If you want do modify extcats itself, you'll need an editable installation. After cloning this Git repository:

poetry install

Useful links:

mongodb installation

healpy

astropy

Release files for extcats 2.5.0

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

Source distribution (sdist)

Source distribution for extcats 2.5.0
File Size Uploaded
extcats-2.5.0.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for extcats 2.5.0
File Interpreter ABI Platform
extcats-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.5 kB

Release files / extcats-2.5.0.tar.gz

Download URL extcats-2.5.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
401fa40a54221a914338d58decc1a6517c40c43d5cbf026536f79189692264fb
BLAKE2b-256 checksum
How to use checksums
4abe19018178ef49c6b9487d964a33536df61d903d666c52ede14c5e15fc23f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.1 CPython/3.12.2 Linux/6.5.0-1015-azure

Release files / extcats-2.5.0-py3-none-any.whl

Download URL extcats-2.5.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0df31a91c4a236a1bdce2647bb78dd4882c3a52f4bce969099cd71ed43b17170
BLAKE2b-256 checksum
How to use checksums
4f39ebd45f5362a834ea0bca337eb34853faf0358d16def128f999a34322dfc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.1 CPython/3.12.2 Linux/6.5.0-1015-azure

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3

1 release file

2.2

1 release file

2.1

1 release file

2.0

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

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