https://github.com/sub6resources/polars-astro
A collection of code to aid with processing data in astronomy using Polars
https://github.com/sub6resources/polars-astro
Last synced: 12 months ago
JSON representation
A collection of code to aid with processing data in astronomy using Polars
- Host: GitHub
- URL: https://github.com/sub6resources/polars-astro
- Owner: Sub6Resources
- License: mit
- Created: 2025-04-04T21:49:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-04T22:33:45.000Z (over 1 year ago)
- Last Synced: 2025-04-04T22:37:16.627Z (over 1 year ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# polars_astro
A package adding support for common astronomy data files in Polars.
[](https://doi.org/10.5281/zenodo.15151274)
## Installing
`pip install polars_astro`
# Usage
### FITS Files
`scan_fits_file` adds support for reading in FITS files as a `LazyFrame` including
predicate pushdown and column projection. The python package fitsio (built around CFITSIO)
is used internally for efficient row/column access.
```python
import polars as pl
from polars_astro import scan_fits_table
scan_fits_table("astro_catalog.fits").filter(
pl.col("parallax") > 0.1,
pl.col("parallax_err") < 0.01
).select(
pl.col("ID"),
pl.col("pm_ra"),
pl.col("pm_dec"),
pl.col("B_mag"),
pl.col("V_mag")
)
```