Introduction

Since the mid-1990’s, there have been spacecraft regularly monitoring the Sun using imagery. Because visible light imagery is typically less scientifically useful, many of the images are obtained in other wavelengths, especially in the ultraviolet end of the electromagnetic spectrum. The Solar & Heliospheric Observatory (SOHO) and the Solar Dynamics Observatory (SDO) are prime examples of spacecraft, among a number of others, providing nearly constant observations of the Sun. The Helioviewer Project, a joint program of NASA and ESA, provides an API that gives access to most of this imagery. Many of the images obtained from the API are 4096x4096 pixels in dimensions so are quite large and are scaled down by default. Using the Wolfram Function Repository item, “SolarImage” these images can be retrieved, viewed and processed using the Wolfram Language.
By default, the most recent image from the SDO Helioseismic and Magnetic Imager is returned and provides a visible light image (6173 Angstroms) of the Sun that highlights sunspots and sunspot groups.
In[]:=
ResourceFunction["SolarImage"][]
Out[]=

Various Instruments

SolarImage provides access to images from a large number of instruments, each referenced by an integer. The default image above is obtained by referencing instrument 18.
In[]:=
ResourceFunction["SolarImage"]["InstrumentAssociation"]
Out[]=
0EIT 171,1EIT 195,2EIT 284,3EIT 304,4LASCO C2,5LASCO C3,6MDI Mag,7MDI Int,8AIA 94,9AIA 131,10AIA 171,11AIA 193,12AIA 211,13AIA 304,14AIA 335,15AIA 1600,16AIA 1700,17AIA 4500,18HMI Int,19HMI Mag,20EUVI-A 171,21EUVI-A 195,22EUVI-A 284,23EUVI-A 304,24EUVI-B 171,25EUVI-B 195,26EUVI-B 284,27EUVI-B 304,28COR1-A,29COR2-A,30COR1-B,31COR2-B,32SWAP 174,33SXT AlMgMn,34SXT thin-Al,35SXT white-light,39XRT Al_med/Al_thick,40XRT Al_med/Be_thick,42XRT Al_med/Open,43XRT Al_med/Ti_poly,44XRT Al_poly/Al_mesh,45XRT Al_poly/Al_thick,46XRT Al_poly/Be_thick,48XRT Al_poly/Open,49XRT Al_poly/Ti_poly,54XRT Be_med/Open,62XRT C_poly/Al_mesh,63XRT C_poly/Al_thick,66XRT C_poly/Open,67XRT C_poly/Ti_poly,69XRT Open/Al_mesh,70XRT Open/Al_thick,71XRT Open/Be_thick,74XRT Open/Ti_poly,75TRACE 171,76TRACE 195,77TRACE 284,78TRACE 1216,79TRACE 1550,80TRACE 1600,81TRACE 1700,82TRACE white-light,83COSMO KCor,2000SUVI 94,2001SUVI 131,2002SUVI 171,2003SUVI 195,2004SUVI 284,2005SUVI 304,10001XRT Any/Any,10002XRT Any/Al_mesh,10003XRT Any/Al_thick,10004XRT Any/Be_thick,10006XRT Any/Open,10007XRT Any/Ti_poly,10008XRT Al_med/Any,10009XRT Al_poly/Any,10010XRT Be_med/Any,10011XRT Be_thin/Any XRT Be_thin/Open,10013XRT Open/Any
The appearance of the Sun varies from one instrument to the next, but the images are always black and white. This is true for most astronomical imagery. Since most of the observations are in wavelengths outside the visible spectrum, any colors applied are somewhat arbitrary.
In[]:=
imagesbw=ResourceFunction["SolarImage"][#]&/@{8,9,10,11,12,13,14,15,16};
In[]:=
GraphicsGrid[Partition[imagesbw,3],Spacings->{0,0},ImageSize->400]
Out[]=

Colorizing Images

When applying color to these images, its useful to have a reference image for comparison. Here we go back to the HMI image in black and white.
In[]:=
GraphicsRow[ResourceFunction["SolarImage"][18,"Colorize"->#]&/@{False,True}]
Out[]=
Adding the option “Colorize”  True applies a simple blend of colors to provide an artificially colored image.
Other instruments have a different default colorization scheme by default.
In[]:=
GraphicsRow[ResourceFunction["SolarImage"][9,"Colorize"->#]&/@{False,True}]
Out[]=
Each color scheme is unique, but arbitrary.
In[]:=
imagescolor=ResourceFunction["SolarImage"][#,"Colorize"->True]&/@{8,9,10,11,12,13,14,15,16};
In[]:=
GraphicsGrid[Partition[imagescolor,3],Spacings->{0,0},ImageSize->600]
Out[]=

Customizing Colors

Since the default colorization schemes are arbitrary, it is useful to allow for customization. Using the “BlendColors” option you can assign any of the “Gradients” from ColorData.
In[]:=
starrynight=ResourceFunction["SolarImage"][9,"Colorize"->True,"BlendColors"->"StarryNightColors"]
Out[]=
Sometimes it is useful to adjust the contrast of the image for optimal effect.
In addition to the named “Gradients” from ColorData, you can supply an explicit list of colors to blend into an effective color function.

Combining Colors

Since each instrument corresponds to a different wavelength, it’s possible to substitute images from different instruments as the RGB components and create additional false color images that highlight features in multiple wavelengths.

Historical Events

SolarImage doesn’t just provide access to current imagery, but also historical imagery. Given a date as the first argument, the underlying API returns the image nearest to the requested date (it may not match exactly). The Bastille Day Event on July 14, 2000 provides a nice historical example. Visible light imagery showed a large sunspot group on the Earth-facing side of the Sun.
Looking at magnetic imagery, opposite polarity can be expressed as red and green. Having large areas of opposing polarity in close proximity can lead to unstable magnetic zones prone to magnetic recombination events and solar flares.
At approximately 10:30 UTC, a powerful X-class solar flare was released as the magnetic field in the sunspot group re-oriented and released a massive amount of energy. The resulting pulse of energy triggered a coronal mass ejection that created a very strong geomagnetic storm that caused minor damage to power transformers and satellites on and around Earth.
For additional exploration of other historical space weather vents, see my previous Wolfram Community post.

Making Movies

Creating movies of solar events is made convenient by the direct support for lists of dates. Images can be requested for a range of dates and SolarImage will find the nearest image to each date, remove any duplicates that may arise, and then constructs an EventSeries.
The images in the event series can be cropped and a new event series constructed.
Finally, a video file can be created and previewed.

CITE THIS NOTEBOOK

Exploring Solar Imagery​
by Jeff Bryant​
Wolfram Community, STAFF PICKS, January 19, 2024
​https://community.wolfram.com/groups/-/m/t/3106012