Parser for the GLADE+ catalog.
Project description
gladeparser
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
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
gladeparser-0.0.0.tar.gz
(19.4 kB
view details)
Built Distribution
File details
Details for the file gladeparser-0.0.0.tar.gz
.
File metadata
- Download URL: gladeparser-0.0.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01751294d09d8a0928ec08d5077c7e07c7b96b5e5fdb85246086c8b32cbda97a |
|
MD5 | f55ad239a530711ea29344d88233d1b5 |
|
BLAKE2b-256 | 50601b6a55f90af231098d998563fdbc8e6e35a7565c5ee0fbc8a22bb082f38b |
File details
Details for the file gladeparser-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: gladeparser-0.0.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a87a8fc6c33d68d7f0fd7906ed15b42398cfe882baf83219bbb2d1f7c59b811f |
|
MD5 | 3be28c36316b9281c1da4995ec998540 |
|
BLAKE2b-256 | 02bd7f43762a46231d38d6d3987705d2e9db0722b15e8b458960efc7f728f8de |