Skip to main content

Parser for the GLADE+ catalog.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gladeparser-0.2.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

gladeparser-0.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file gladeparser-0.2.0.tar.gz.

File metadata

  • Download URL: gladeparser-0.2.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for gladeparser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b11941962130621080056ab857b4397d45363bf3e22c6b7384ae4115588ff7e
MD5 aa4018520b84be0dcd44e793a03df45f
BLAKE2b-256 63627ac0fc3f1727f275f754849750acdae8270d7a637d586a342a79a9b124b7

See more details on using hashes here.

File details

Details for the file gladeparser-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gladeparser-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for gladeparser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe099b1128c45bbcdd0fc7ae7bf6b646c7fdec443e9cd09ce24799bfc8a549b3
MD5 a6030a9828e0c86d7f56584fc1bc4a4e
BLAKE2b-256 b44d5da68a13b66dc10e3084737b84069723215cf19b7a3b783d8116afbefefa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page