Skip to main content

gladeparser

tests

Parser for the GLADE+ galaxy catalog.

Usage

To read the catalog into a pandas.DataFrame:

from gladeparser import to_pandas_df

filename = "path/to/catalog"
df = to_pandas_df(filename)

The preferred way of reading the catalog is using a polars backend, especially if you want to filter out the data:

from gladeparser import to_polars_df
import polars as pl

# Grab objects from 2MASS catalog with redshifts corrected for peculiar velocity
filters = (
    pl.col("2MASS name").is_not_null(),
    pl.col("z_cmb").is_not_null(),
    pl.col("z_cmb") > 0,
    pl.col("z flag") == 1,
    pl.col("dist flag").is_in([1, 3])
)

# Selected columns
cols = ["ra", "dec", "z_cmb"]

filename = "path/to/catalog"
df = to_polars_df(filename, cols=cols, **filters)

Parsing a subset of columns

from gladeparser import to_pandas_df, get_columns

# Select the columns you want and return their names
# See more options in get_columns docstring
cols = get_columns('Localization', 'Distance', names=True)

filename = "path/to/catalog"
df = to_pandas_df(filename, cols=cols)

Installation

Clone the repo and run

pip install .

Testing

Make sure that you have pytest installed, or run

pip install .[dev]

Then run

pytest

References

See the GLADE+ paper on arXiv.

Release files for gladeparser 0.2.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 gladeparser 0.2.0
File Size Uploaded
gladeparser-0.2.0.tar.gz 19.8 kB Details

Built distribution (wheel)

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

Total release size: 30.6 kB

Release files / gladeparser-0.2.0.tar.gz

Download URL gladeparser-0.2.0.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8b11941962130621080056ab857b4397d45363bf3e22c6b7384ae4115588ff7e
BLAKE2b-256 checksum
How to use checksums
63627ac0fc3f1727f275f754849750acdae8270d7a637d586a342a79a9b124b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release files / gladeparser-0.2.0-py3-none-any.whl

Download URL gladeparser-0.2.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe099b1128c45bbcdd0fc7ae7bf6b646c7fdec443e9cd09ce24799bfc8a549b3
BLAKE2b-256 checksum
How to use checksums
b44d5da68a13b66dc10e3084737b84069723215cf19b7a3b783d8116afbefefa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.0.0

2 release files

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