Python and the Sun
Transforming Space Science through Open-Source

whoami
- Final-Year Undergrad, JIIT Noida
- GSoC '23 Student @ OpenAstronomy
- Helping maintain SunPy
- Volunteer @ OSDC, FOSS United, and here!
- Interested in Python, Scientific Software, Data and the Cloud
an outline
- Python in Science, Astronomy
- Python and Solar Physics, SunPy
- Open-Science
Scientific Python
Python 🤝 Scientific Communities!
- Accessible
- Flexible
- Open-Source
- Actively Developed
- Strong Community Support
Many Reasons Why





Python in Astronomy
- Rapid adoption in the astronomy community
- Advantages: ease of use, extensive libraries, strong community support
- Shift from proprietary software to open-source solutions
The Astro-Python Ecosystem
- AstroPy: Core package for astronomy
- Astroquery: Accessing astronomical data from online sources
- Stingray: Time series analysis and spectral-timing software
- SunPy: Heliophysics / Solar Data Analysis
- ...many more!
Open Science
- the movement to make scientific research and its results accessible to all levels of society.
- transparency, reproducibility, collaboration.

The Sun
best star ever 🌟
Why study the Sun?
The Sun powers life on Earth!
But the Sun is also a stormy place...

SDO/AIA
In a sky full of stars...


SDO/AIA

SDO/AIA
Coronal Mass Ejections

SolarSoft
- Lots of pain-points: proprietary and closed development environment, difficult to get involved, lack of versioning, etc.
The SunPy Project
A community of scientists and software developers creating an ecosystem of Python packages for solar physics.

The SunPy core Package
Solar data analysis. This involves:
- access data from different providers
- read image and time series data
- visualise, plot solar data
- transform between commonly used coordinate systems
- ...
Objective
To develop and facilitate a high-quality, easy-to-use, community-led, FOSS solar data analysis ecosystem based on the scientific Python environment.
SunPy Affiliate Projects
- Sunkit-image: Advanced image processing for solar data
- NDCube: Multi-dimensional data structures for scientific data
- drms: Access to Stanford's Joint Science Operations Center data
- ... many more
SunPy's Impact
- Used in numerous scientific publications
- Supports various solar missions and ground-based observatories
- Enables efficient data analysis and visualization for researchers worldwide
A quick tour!
- Units
- Times
- Coordinates
- Maps
- Timeseries
Units...
- sunpy is always explicit about the units associated with a value
- utilise
astropy.units.Quantityobjects

working with units
Times and TimeRanges

Acquiring Solar Data
- Support for available data sources: VSO, HEK, JSOC...
- Fido, SunPy's unified search interface
Acquiring Solar Data



very extensible!
Adding Sources
- Just need to subclass existing BaseClients, map API's

Plotting a Solar Map

Working with Maps
Finding bright regions via ndimage

https://docs.sunpy.org/en/stable/generated/gallery/map
Getting Involved
- Use it!
- File bug reports
- Contribute documentation
- Contribute code
- The Matrix chat: #sunpy:openastronomy.org
- Weekly community calls
The FAIR Principles
- Findable
- Accessible
- Interoperable
- Reproducible
Open Science Practices
- Open access
- Open data
- Open source
OSS in Open Science
- Enabling reproducible research
- Accelerating scientific progress through shared tools
- Democratized access to advanced analytical capabilities








Many Initiatives that help further this goal

Challenges in Open Science
- Balancing openness with data protection and proprietary periods
- Ensuring long-term sustainability of open-source projects
- Promoting open science practices in education and professional development
Relevant Links
- https://github.com/sunpy/
- https://docs.sunpy.org/
- https://nasa.github.io/Transform-to-Open-Science/
- https://openastronomy.org/
- https://pyopensci.org/
Thanks!
in/akshit-tyagi42

exitflynn


these slides ^

flynnzler

@exitflynn@fosstodon.org
Python and the Sun
By Akshit Tyagi
Python and the Sun
- 107