PyAstronomy 0.26.0b1

repository·master·Indexed 41 days ago

https://github.com/sczesla/pyastronomy

A comprehensive collection of astronomy-related tools for Python designed for astronomical research. It includes subpackages for model fitting and MCMC sampling (funcFit), astrophysical modeling (modelSuite), utility routines (AstroLib), astronomical constants (Constants), timing analysis via Lomb-Scargle periodograms (Timing), and interactive GUI tools (pyaGUI).

Tokens
99.4K
Snippets
310
Records
392
Agent score
52%

What's inside PyAstronomy

  1. Overview of PyAstronomy sub-packages

    master

    PyAstronomy (PyA) is a collection of astronomy-related packages. Depending on your task, you can use specific sub-packages:

    • Astrolib: Routines for low-level data analysis and small-scale applications.
    • PyaGUI: GUI-based tools for working with data.
    • Constants: Provides numerical values for physical constants.
    • Timing: Tools for timing analysis, such as Lomb-Scargle periodograms.
    • funcFit: A convenient interface for model fitting.
    • Model suite: A collection of ready-to-use models designed for use with funcFit.
    • funcFit2 (beta): A newer version of the fitting interface.
  2. Overview of PyAstronomy.pyasl functionality

    master

    PyAstronomy.pyasl is a collection of astronomical routines ported from the well-known IDL Astronomy User's Library. The goal is to provide a Python-based version of these widely-used, field-tested routines while maintaining high fidelity to the original IDL implementations. The library is organized into several functional categories:

    • General algorithms: Includes Kepler orbits, magnitudes, atomic numbers, and stellar properties.
    • General data analysis: Tools for folding, binning, smoothing, SNR estimation, outlier detection, interpolation, and SVD.
    • Spectral routines: Functions for wavelength conversion, barycentric velocity, Planck functions, cross-correlation, Doppler shifts, and flux conversion.
    • Coordinates, time, and observation tools: Utilities for coordinate transformations (e.g., equatorial to horizontal), time/date handling, solar/lunar positions, nutation, aberration, airmass, and observatory-specific calculations.
    • Transit and planet routines: Tools for transit duration, visibility, planet phase, and scale height.
    • Statistics: Statistical testing and error correlation routines.
    • Resource-based helpers: Access to astronomical data resources like Baraffe tracks, NASA Exoplanet Archive, Kurucz models, and others.
  3. Overview of PyAstronomy subpackages

    master

    PyAstronomy is a collection of astronomy-related Python packages. Its core functionality is organized into several subpackages:

    • funcFit: Provides tools for minimization and MCMC (Markov Chain Monte Carlo) sampling.
    • modelSuite: A collection of astrophysical models (such as transit light-curve modeling) that can be used independently or integrated with funcFit.
    • AstroLib: A set of utility routines, including ports from IDL's astrolib.
    • Constants: Provides frequently used astronomical constants.
    • Timing: Contains algorithms for timing analysis, specifically the Lomb-Scargle and Generalized Lomb-Scargle periodograms.
    • pyaGUI: A collection of GUI tools designed for interactive astronomical work.
  4. Overview of the funcFit package

    master

    The funcFit package provides a high-level, convenient interface for performing data fitting using algorithms from SciPy and pymc. It is designed to simplify parameter handling, making the fitting process more flexible and user-friendly in Python.

    Key Features:

    • Interface for SciPy and pymc fitting algorithms.
    • Flexible parameter handling mechanism.
    • Includes basic fitting models (e.g., Gaussian).
    • For more complex models, use PyAstronomy's modelSuite in conjunction with funcFit.
  5. Perform harmonic timing analysis using periodograms

    master

    PyAstronomy provides several periodogram implementations for searching for harmonic signals in noisy data. The primary tools available are:

    • Generalized Lomb-Scargle (GLS) periodogram: The cornerstone implementation for harmonic timing analysis.
    • Classical Lomb-Scargle periodogram: A specialized version of the GLS.
    • Fast Fourier Transform (FFT): A class for calculating Fourier transforms.

    You can use the GLS class to obtain the classical Lomb-Scargle periodogram, as the latter is a special case of the former.

  6. Calculate periodograms using Fourier Transform and Lomb-Scargle

    master

    PyAstronomy provides classes for calculating different types of periodograms to identify periodic signals in time-series data. All periodogram classes inherit from PeriodBase.

    Available methods include:

    • Fourier: For standard Fourier Transform calculations.
    • LombScargle: For the Lomb-Scargle periodogram, which is optimized for unevenly sampled data.
  7. Use the pyTiming module for timing analysis

    master

    The pyTiming module provides a collection of submodules designed for timing analysis in astronomy. It implements various algorithms to detect periodicities and analyze time-series data.

    Key capabilities include:

    • Lomb-Scargle periodograms: For finding periodic signals in unevenly sampled data.
    • Phase Dispersion Minimization (PDM): For detecting non-sinusoidal periodicities.
    • String Length methods: For period searching via string length minimization.
  8. Use analytical transit light-curve models with palTrans

    master

    The palTrans module in PyAstronomy implements the analytical transit light-curve model described by Pal (2008). It is used to model the light curves of transiting planets or other celestial bodies.

    Key capabilities include:

    • Using model classes to define transit profiles.
    • Accounting for finite integration times (rebinning).
    • Utilizing Boost support for enhanced performance (if available).
  9. Available fitting models in PyAstronomy.funcFit

    master

    The PyAstronomy.funcFit module provides several pre-built mathematical models for curve fitting. These models typically include a profile (like a Gaussian or Voigt) combined with a linear continuum or other baseline components.

    Available model classes include:

    • Gaussian profiles: GaussFit1d (single), MultiGauss1d (multicomponent), GaussFit2d (2D), and MultiGauss2d (multicomponent 2D).
    • Lorentzian/Voigt profiles: CauchyLorentz1d, Voigt1d, and MultiVoigt1d (multicomponent).
    • Periodic and Decay models: SinusFit1d (sine wave) and ExpDecayFit1d (exponential decay).
    • Polynomials and Baselines: PolyFit1d (polynomial of degree n), Sech1d (hyperbolic secant), and ConstantFit1d (constant value).

    For demonstration purposes, the module also includes Circle2d for simple circular orbits.