High-performance astrophysics library for void finding, neutrino physics, and N-body simulations
Project description
AstroLib - Advanced Astrophysics Library
Overview
AstroLib is a high-performance Python library for astrophysical computations, focusing on void finding, neutrino physics, and N-body simulations. It's designed to work efficiently even on low-performance hardware through innovative algorithms and resource management.
Features
Core Components
- Void Finding: Advanced algorithms for void detection and analysis
- Neutrino Physics: Tools for neutrino mass estimation using void expansion
- N-Body Simulations: Optimized particle simulations
- Machine Learning Integration: ML-based analysis tools
Performance Optimizations
- Adaptive resource management
- Smart caching system
- Memory-efficient data structures
- Parallel processing capabilities
Installation
# Clone the repository
git clone https://github.com/yourusername/astrolib.git
cd astrolib
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Requirements
- Python >= 3.8
- NumPy >= 1.20.0
- SciPy >= 1.7.0
- Astropy >= 4.0
- Numba >= 0.55.0
- h5py >= 3.0.0
- matplotlib >= 3.4.0
- pandas >= 1.3.0
- scikit-learn >= 1.0.0
- psutil >= 5.8.0
Quick Start
from astrolib.optimized_voids import StreamingVoidFinder
from astrolib.optimized_nbody import OptimizedNBody, SimulationConfig
from astrolib.neutrino_ml import NeutrinoMassEstimator
# Initialize void finder with resource-aware settings
finder = StreamingVoidFinder(chunk_size=100000, n_workers=2)
# Find voids in streaming mode
for void in finder.find_voids_streaming(data_iterator, box_size=500.0):
print(f"Found void: radius = {void['radius']:.2f}")
# Set up N-body simulation
config = SimulationConfig(
dt=0.01,
softening=1e-4,
theta=0.5,
use_cache=True,
n_workers=2
)
simulator = OptimizedNBody(config)
# Run simulation
positions, velocities = simulator.simulate_chunk(
positions,
velocities,
masses,
steps=100
)
# Estimate neutrino mass
estimator = NeutrinoMassEstimator()
mass, uncertainty = estimator.predict(voids)
print(f"Estimated neutrino mass: {mass:.3f} ± {uncertainty:.3f} eV")
Documentation
Void Finding
The library implements multiple void finding algorithms:
- Watershed Void Finder
- ZOBOV (Zones Bordering On Voidness)
- ML-enhanced void detection
from astrolib.optimized_voids import StreamingVoidFinder
# Initialize finder
finder = StreamingVoidFinder()
# Find voids
voids = finder.find_voids_streaming(
data_iterator,
box_size=500.0
)
N-Body Simulations
Efficient N-body simulations with adaptive time stepping:
from astrolib.optimized_nbody import OptimizedNBody
# Configure simulation
simulator = OptimizedNBody()
# Run simulation
positions, velocities = simulator.simulate_chunk(
initial_positions,
initial_velocities,
masses
)
Neutrino Physics
Tools for neutrino mass estimation:
from astrolib.neutrino_ml import NeutrinoMassEstimator
# Initialize estimator
estimator = NeutrinoMassEstimator()
# Estimate mass
mass, uncertainty = estimator.predict(void_catalog)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use this library in your research, please cite:
@software{astrolib2025,
author = {Your Name},
title = {AstroLib: Advanced Astrophysics Library},
year = {2025},
url = {https://github.com/yourusername/astrolib}
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astro_void_finder-0.1.0.tar.gz.
File metadata
- Download URL: astro_void_finder-0.1.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2917a6796b6712bc3c6bdf1b0bfaff6dfbefcfdcff6575a13a8e100c2046b2b9
|
|
| MD5 |
121982b1d886de6c8cf0e678bcea95f6
|
|
| BLAKE2b-256 |
27eb76ccdb1a18dff6e68b29ccdcec90734ae362918137df8835be139c00bfe9
|
File details
Details for the file astro_void_finder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: astro_void_finder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f15d0ceb3dd13c604ec38f665a2aad29fa4aefc472afc2795c788369c3b0f87f
|
|
| MD5 |
afee5c6a45988f5790c84b283fbacdff
|
|
| BLAKE2b-256 |
b16c44592d41f8d27fceec397f37294a015b87dd88f91ec6a702895d927bff00
|