In [1]:
%%file custom.css
body {
    font-size: 160%;
    font-family: Lato, Ariel, sans-serif !important;
}

div.slides {
    margin-top: -7%;
}

.left {
    width: 49%;
    float: left;
}

.right {
    width: 49%;
    float: right;
}

.centre {
    text-align: center;
}

h2 {
    text-align: center;
}

div.prompt {
    display: none;
}

div.highlight {
    font-size: 85%; /* This Seems to give an approximate 80char line at 1024 */
}

div.output_html {
    font-size: 85%;
}

div.output_subarea {
    max-width: 100%; !important
}

div.output_png {
    text-align: center;
}

li {
    padding-top: 1em !important;
}

ul.logos {
    margin: 0px;
    padding: 0px;
    width: 100%;
}

ul.logos li {
    list-style: none;
    height:150px;
}
Overwriting custom.css

Plan:

  • What is SunPy?
    • Project
    • Community
    • versioned releases (reproducable)
  • Why Python?

    • Free
    • Powerful
    • Useful
    • ALL THE LIBRARIES
      • numpy, scipy, mpl, pandas, scikit-image, astropy, astropy-affilitated
  • What Can it DO?!

    • Maps
    • Download
    • list other things
    • astropy??
    • future features?!
  • Contribution

    • GitHub
    • affiliated packages

SunPy - Python for Solar Physics

Stuart Mumford

The University of Sheffield, UK

Conclusions

  1. You can use SunPy for your research. (probably)
  2. You should join the SunPy community.

What is SunPy?

"A Project to facilitate and promote the use and development of a community-led, free and open-source solar data-analysis software based on the scientific Python environment."

A library designed to provide core functionality to enable people to do solar physics with Python.

A community of solar physicists doing science using Python.

Why Python?

  1. Python is being widely adopted as a scientific programming language.
  2. Easy to learn.
  3. Python is widely used outside of acedemia.
  4. A very transferable skill.
  5. Very flexible, can wrap C or FORTRAN code when you have a need for speed.
  6. A lot of domain experts write packages in Python, that you can use!
  7. A lot of new astronomical code is being written in Python, i.e. JWST & DKIST pipelines.
  8. many many more...

SunPy is a Gateway

Major Features of SunPy

  • Data Structures for Images, Spectra, and Time Series Data.
  • Data Retrival code, from VSO, JSOC, HEK, Helio, and other places.
  • Versioned Library Releases, with clear upgrade paths.

A Plot!

In [7]:
%matplotlib inline
import matplotlib.pyplot as plt
import sunpy.data
import sunpy.map
from sunpy.data.sample import AIA_171_ROLL_IMAGE

import astropy.units as u
In [9]:
# Create a AIA 171 Map from some sample data
mymap = sunpy.map.Map(AIA_171_ROLL_IMAGE)

# Create a larger than normal figure
fig = plt.figure(figsize=(8,6))

# Plot the AIA Map object
im = mymap.plot()

# Overlay the Heliographic Coordinate Grid
l = mymap.draw_grid()

Searching the VSO

In [1]:
from sunpy.net import vso

vc = vso.VSOClient()
results = vc.query(vso.attrs.Time('2015/3/1T00:00:25', '2015/3/1T00:00:30'),
                   vso.attrs.Instrument('AIA') | vso.attrs.Instrument('HMI'))
results
Out[1]:
<Table masked=False length=7>
Start Time [1]End Time [1]SourceInstrumentType
string152string152string24string24string64
2015-03-01 00:00:252015-03-01 00:00:26SDOAIAFULLDISK
2015-03-01 00:00:262015-03-01 00:00:27SDOAIAFULLDISK
2015-03-01 00:00:302015-03-01 00:00:31SDOAIAFULLDISK
2015-03-01 00:00:302015-03-01 00:00:31SDOAIAFULLDISK
2015-03-01 00:00:272015-03-01 00:00:28SDOHMIFULLDISK
2015-03-01 00:00:272015-03-01 00:00:28SDOHMIFULLDISK
2015-03-01 00:00:272015-03-01 00:00:28SDOHMIFULLDISK

Contributing

SunPy Needs You!

https://github.com/sunpy/sunpy

Workshops