Skip to main content

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


Download files

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

Source Distribution

astro_void_finder-0.2.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astro_void_finder-0.2.0-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astro_void_finder-0.2.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for astro_void_finder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eac01001c42eac4de7ed1fbd28d26856db2d6db0be735c62b397dd15e7f5e4be
MD5 bc1e331ec64ae8aa3a4f94fc107a00b8
BLAKE2b-256 07990114c6c16c878b645c835ffd3ce222143a0d71153903beeb379aec54499e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for astro_void_finder-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1097ecafed1eb6c012a696a417fd1569b0748300fde73a481ce2ccd26c38550
MD5 4427f2087608b040efe396e376f3e4e6
BLAKE2b-256 cdc57948ac95231477c17a1de178afb4e94f25688f1ca95e000dca19a357618d

See more details on using hashes here.

Supported by

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