Connor Stone - AstroPhot: Fitting Everything Everywhere all at Once in Astronomical Images

Learn about AstroPhot & Caustics Python packages for analyzing astronomical images, featuring GPU acceleration, automated testing, and scalable tools for processing 100k+ lens images.

Key takeaways
  • AstroPhot and Caustics are two Python packages developed for analyzing astronomical images, particularly focusing on gravitational lensing and galaxy fitting

  • While GPU acceleration provided 10x speedup, it wasn’t always cost-effective compared to using multiple CPU cores - GPUs need to be 50x faster to justify their higher cost ($14,000 vs $5,000 for CPUs)

  • The development workflow includes:

    • Automated testing across Windows, Linux, Mac
    • Unit tests and notebooks for documentation
    • Automatic website updates
    • Deployment to pip and Conda
    • Release notes generated from branch discussions
  • Small operations and branching statements/conditionals significantly reduce GPU performance benefits - optimal GPU usage requires bundling many operations together

  • The codebase is built on PyTorch, providing:

    • GPU acceleration capabilities
    • Automatic derivative tracking
    • Backend numerical library support
  • The packages offer three interface levels:

    • Low-level functional programming layer
    • Object-oriented middle layer
    • High-level simulator interface
  • Future telescopes will provide over 100,000 new gravitational lensing images, requiring scalable analysis tools

  • Code documentation includes direct links to equation numbers in referenced papers

  • The project demonstrates successful academic software development:

    • User-friendly design
    • Comprehensive documentation
    • Professional software engineering practices
    • Active community engagement
  • The tools support Bayesian inference and Markov chain analysis for astronomical image processing using score-based models