1 Introduction

Celestial observations have been recorded throughout history (Evans, 1998; Vaquero and Vázquez, 2009). The only way to monitor and study celestial objects in ancient times was with the naked eye, until the beginning of the 17th century, when the telescope started to be used as an astronomical instrument. In 1609, Galileo Galilei stated a new era of discoveries in the history of astronomy when he applied the first refractive telescope to observe the stars. This marked the beginning of a new research focused on the Sun (Galilei and Scheiner, 2010).

The first systematic records of features of the solar photosphere with the telescope were made by Harriot, Galileo, Scheiner, and other astronomers of that time, who provided information on sunspots and faculae in their drawings (Arlt et al., 2016; Arlt and Vaquero, 2020; Carrasco, Gallego, and Vaquero, 2020; Vokhmyanin, Arlt, and Zolotova, 2020). Other outstanding methods to record solar phenomena throughout history were, for example, the solar photography introduced in the 19th century (De Vaucouleurs, 1961), the butterfly diagram by Maunder (1904), and solar images taken in multiple wavelengths by telescopes on board of modern spacecraft, such as the Solar and Heliospheric Observatory (SOHO) and Solar Dynamics Observatory (SDO) (Domingo, Fleck, and Poland, 1995; Pesnell, Thompson, and Chamberlin, 2012).

Solar synoptic maps can be generated using these modern images. These representations allow us to study the temporal evolution of solar phenomena and compare them in different periods of time. Several authors have used the synoptic maps in order to study the Sun; for example, Hamada, Asikainen, and Mursula (2019) published a homogeneous dataset of solar synoptic maps from images taken by SOHO and SDO. Other surveys also used solar synoptic maps to investigate the solar wind, coronal holes, and photospheric magnetic fields (Balachandran, 2000; Karna et al., 2015; Virtanen and Mursula, 2016; Hamada et al., 2018).

In order to address this issue, we have created a software (SunMap) to obtain synoptic maps automatically from optical images of celestial bodies, in this particular case, from the Sun. The outline of the article is as follows: Section 2 describes how a synoptic map is generated. The Section 3 is devoted to the presentation of the main features of the program, including a short guide to using it. Section 4 presents a case study of a synoptic map obtained by SunMap and a comparison with that made in other works using the same observation set. Finally, Section 5 shows the main conclusions of this paper with some remarks and hints at possible directions of future research.

2 Composition of Synoptic Maps

Solar synoptic maps known as Thilo diagrams can be considered the first ones in solar physics history. Thilo (1828) published these diagrams representing the sunspots recorded by Soemmering in Frankfurt from 1 July 1826 to 21 June 1827 according to their heliographic coordinates on vertical and horizontal lines. The main purpose of these solar synoptic maps is to carry out a global representation of the Sun. Moreover, these maps can be also applied to other representations of astronomical objects, such as images of the Earth and Mars.

The first step in creating a solar synoptic map is to obtain the files that include the observations of interest. In this work, we have used as an example the modern solar images provided by SDOFootnote 1 (Pesnell, Thompson, and Chamberlin, 2012). Then, our software allows for initial image preprocessing. For example, the image contrast can be modified by linear brightness by percentile, gamma and logarithmic adjustments, and filtering regional maxima (van der Walt et al., 2014). Moreover, image equalization by contrast stretching and global, adaptive, and rank equalization (Soille, 2002; Reza, 2004; González and Woods, 2018) can be applied to the images, as well as smoothing algorithms, such as convolutional median and Gaussian filters (Chandel and Gupta, 2013), using kernels with default size of \(5\times5\) pixels.

Once that step is completed, the image is oriented using a coordinate system and projected onto a two-dimensional system. For this projection, we use the Fernández-Guasti Squircle (FGS) representation (Fernández-Guasti, 1992). We thus obtain an intermediate figure between a circle and square in a uniform way reducing the projection error as much as possible. The polar equation for a squircle form is given by Fernández-Guasti et al. (2005):

$$ \frac{s^{2}}{4} \sin ^{2}(2\theta ) r^{4} - k^{2}r^{2} + k^{4} = 0, $$
(1)

where \(r\) and \(\theta \) are the polar coordinates, and \(s\) is the squareness parameter. Note that \(s = 1\) depicts a square with side equal to \(2k\), and \(s = 0\) represents a circle with radius equal to \(k\). Substituting \(4x^{2}y^{2} = r^{4} \sin ^{2}(2\theta ) \) gives the Cartesian equation (Fernández-Guasti et al., 2005):

$$ s^{2} \frac{x^{2}}{k^{2}} \frac{y^{2}}{k^{2}} - \biggl(\frac{x^{2}}{k^{2}} + \frac{y^{2}}{k^{2}}\biggr) + 1 = 0. $$
(2)

As an example, the resulting transformation using the FGS representation from the solar image taken by SDO on 2 January 2016 is shown in Figure 1.

Figure 1
figure 1

Application of the FGS method to a solar image at a wavelength of 171 Å taken by SDO on 2 January 2016 [Source: https://sdo.gsfc.nasa.gov/].

In cylindrical projections, such as the projection used in this work to create synoptic maps, the points are expanded depending on their locations. The differential rotation in the expanded image is mostly reduced to a constant rotation that does not depend on the latitude. This constant period is represented as the Carrington period in which a synoptic map will represent \(360^{\circ}\) in longitude when 27.2753 days are composed in images. Therefore, the Carrington rotation will be represented as an integer representing 27.2753 days.

When two images of the Sun are taken in a certain period of time, part of the image corresponding to the oldest observation can overlap with the most recent image due to the Sun’s rotation (Figure 2). Note that repeated pixels cannot appear in different areas in a synoptic map. Thus, it is necessary to calculate how many pixels are required between observations as a function of that period. For this calculation, we must consider, in addition to that period, the proportion of the image to be studied and the solar rotation and its dependence on the heliographic latitude. We assume that the speed of the differential rotation (\(\omega \)) is (Snodgrass and Ulrich, 1990):

$$ \omega = A + B \sin^{2}\phi + C \sin^{4}\phi ,$$
(3)
$$ A = 14.713 \pm 0.049^{\circ}/\text{day},$$
(4)
$$ B = -2.396 \pm 0.188^{\circ}/\text{day},$$
(5)
$$ C = -1.787 \pm 0.253^{\circ}/\text{day}, $$
(6)

where \(\phi \) is the solar latitude. Then, it is possible to know how many pixels are equivalent to the difference in angle as a function of the latitude (\(\lambda (\phi )\)) from the equation:

$$ \lambda (\phi ) = \frac{ \xi (\phi )}{\delta}, $$
(7)

where \(\xi \) is the number of degrees the solar image rotates in the studied period (it is function of the latitude \(\phi \)), and \(\delta \) is a scale factor in units of degrees/pixel. For more details on the previous explanations and mathematical developments involved in these calculations, see García (2020) and references therein. Note that when there is some observational gap, the software takes a large number of pixels of the most recent image to complete the synoptic map, although we acknowledge this fact can introduce larger errors. In case of overlapping of observations, the software overlaps the two most recent observations to create the map. Once the synoptic map is obtained, the user can apply a convolutional filter to smooth the changes in the brightness of the overlapping observations.

Figure 2
figure 2

Simulation of the solar rotation from one image at a wavelength of 171 Å taken by SDO on 6 August 2019 to another three days later [Source: https://sdo.gsfc.nasa.gov/].

The last step to obtain the synoptic map is to merge horizontally and chronologically all the vertical strips created from the observations, similar to the previously explained. One example of solar synoptic map, using data from SDO with a wavelength of 211 Å for the period spanning from 6 January to 2 February 2020, corresponding to the Carrington rotation 2226, can be seen in Figure 3.

Figure 3
figure 3

Composition of a synoptic map from a sequence of images taken by SDO between 6 January and 2 February 2020 (Carrington rotation 2226) at a wavelength of 211 Å [Source: https://sdo.gsfc.nasa.gov/].

3 Description of the Software

This software has been designed to ease the study and comparison of different solar characteristics that occur on different dates. We use Python as the main programming language because it is a multiparadigm, multiplatform, simple, and flexible language. Furthermore, Anaconda suite, PyCharmFootnote 2 (IDE for Python developers) and GitHub (public repositories platform to store our software under the name SunMapFootnote 3) have been used. In addition, several libraries such as Numpy (scientific calculation), Matplotlib (tool to generate graphs), Numba (compiler to optimize operations on types and structures of the NumPy library), SunPy (used to download, process, and store the files), and PyQt (library to develop the interface) have been integrated into our project under a Model-view-controller (MVC) pattern (as shown in Figure 4, top panel).

Figure 4
figure 4

(Top panel) Model-view-controller design pattern. (Bottom panel) Information exchange between the ParserEvents and the controller.

The information system is initiated with an order or command introduced by the user from the interface or terminal, named as “view” in Figure 4 (top panel). The information sequence, generated by the user-view interaction, will be made up of the event identifier and the necessary parameters to query the model. Once the controller issues the command, the content is formatted generating a list whose first element is the event identifier, and the following elements are the query parameters. Then, the controller uses the parser object to obtain the event linked to the identifier. The application uses two types of parsers (Figure 4, bottom panel): one parser for the events with a list of objects and events from the parser (see “FitsParseEvents” in blue in Figure 4, bottom panel) and other, more general parser, that is the node of the different parsers for events allowing greater modularization (see “ParseEvents” in green in Figure 4, bottom panel). Once the controller has the appropriate event object for the command, the parameters and the event object can be used in the model. The functionality of the events of the application will be divided into a series of modules in which each one will contain a series of events grouped by theme and a parser that allows access to them.

In order to provide a summary guide to creating a solar synoptic map, we first use the Fido object from the SunPy library, which allows us to consult the information on multiple servers where we can get files, including even series of data updated in a short period of time. In order to download data, the command to be used in the application from the batch mode would be such as:

$$\begin{aligned} \textbf{DOWN 2016/01/01 2016/02/01 aia 171 1440.} \end{aligned}$$

This command defines the query and, in this case, downloads all the files referring to the SDO/AIA instrument with a wavelength of 171 Å between 1 January 2016 and 1 February 2016, capturing each image in an interval time of 1440 minutes (24 hours). The result is shown in Table 1, where 31 files fulfilling the search criteria can be found. Once the query has been made, the corresponding files will be downloaded in FITS format. Thus, they can be used in the application.

Table 1 An example of query that includes files from the SDO/AIA instrument with a wavelength of 171 Å for January 2016.

After downloading the images and initializing the interface, an image can be loaded (or image sequence) by clicking “File – Load image”. Thus, the interface is seen such as in Figure 5. In case a sequence of several images is loaded, all the images will be chronologically shown in the interface. Then, after loading the images, the solar synoptic map is generated by clicking on “Transforms – Synoptic Map”. As an example, we have shown in Figure 3 the solar synoptic map from a sequence of images taken by the instrument AIA on board SDO between 6 January and 2 February 2020 (Carrington rotation 2226) at 211 Å.

Figure 5
figure 5

Interface of SunMap showing the image taken by SDO/AIA instrument on 17 August 2017 [Source: https://sdo.gsfc.nasa.gov/].

In addition to showing the creation of synoptic maps, several postprocessing options have been included in the interface to improve the usefulness of SunMap. For example, we can zoom in or out, edit the information of the axes, and modify the design and size of the final image. Some options allow overlapping different elements on the image. In this case, we can grid the image as support to know the coordinates of a region of interest. A black circle can be applied on the solar disc to visualize only the chromosphere and corona. The solar limb can be highlighted by a white circumference, and the outlines of the brightest regions, such as active regions, can be also outlined (these are determined by binarization and thresholds). We can obtain histograms from the images as a function of the pixel hue, as well as diagrams using Fourier transforms, which are useful, for example, to check if the image has noise. Moreover, the image sequence can be saved in GIF format, and a long list of pseudocolors (more than 100) can be applied to the image to see the certain regions of interest in various ways. More detailed explanations of the different capabilities of SunMap can be found in García (2020). All the programming codes related to this project, as well as the installation setup of SunMap and a user guide, can be downloaded from https://github.com/gabgarar/SunMap. Changes and future improvements implemented in the software will also be made available through this link.

4 A Preliminary Comparison of Synoptic Maps

As a case study, we have selected one daily image taken by the instrument AIA on board SDO with a wavelength channel of 193 Å from 26 August to 22 September 2011. The result is shown in Figure 6 (top panel). Thus, we have obtained the solar synoptic map from SunMap following the method outlined above.

Figure 6
figure 6

(Top panel) Synoptic map obtained in this work with SunMap from images taken by SDO at a wavelength of 193 Å between 26 August and 22 September 2011. (Bottom panel) The same but obtained by Hamada, Asikainen, and Mursula (2019).

We have made a preliminary comparison between our final synoptic map with that obtained by Hamada, Asikainen, and Mursula (2019) using the same dataset. These kind of maps can be made in many ways. Different types of projections and pseudocolors can be chosen, obtaining a variety of maps from one study to another. This fact can also be seen from the comparison between the synoptic map obtained in this work (Figure 6, top panel) and that of Hamada, Asikainen, and Mursula (2019) (Figure 6, bottom panel) using data corresponding to the Carrington rotation 2114 (from 26 August to 22 September 2011). Note that, in both cases, the y-axis of the maps is represented as a function of the sine of latitude.

One difference between both synoptic maps is that Hamada, Asikainen, and Mursula (2019) used a linearly varying weighting function to determine the value of each pixel from overlapping observations, whereas it is not used in our map. In this case, we decided not to apply the smoothing filter in order to detect more clearly the details (such as loops in the solar atmosphere of magnetic origin) that such a wavelength provides. Note also that the maps provided by Hamada, Asikainen, and Mursula (2019) from SOHO and SDO were constructed in a standardized intensity scale. Moreover, although the pseudocolor is slightly different between both synoptic maps, we have selected one as similar as possible to that of Hamada, Asikainen, and Mursula (2019). Another difference is that our software does not use Carrington longitudes (it will be available in future versions), contrary to Hamada, Asikainen, and Mursula (2019). SunMap takes as reference the center of the image supposing a georeferenced system.

A darker stripe in the image in Figure 6 (top panel) can be observed around \(10^{\circ}\) longitude. That part corresponds to the observation of 8 September 2011 when the image used from SDO was darker than usual. Moreover, the value of 0 in the x-axis can be represented both in the center and in the intersection with the y-axis. Although we acknowledge that a visual check is a simple method to compare both synoptic maps, it can be seen from this preliminary comparison shown in Figure 6 that both works have similar results.

5 Conclusions

We present a program (SunMap) for obtaining synoptic maps automatically from solar images. On the one hand, the proposed software have been implemented using Python over an intuitive interface, allowing to be used with different optical imaging instruments, where band-pass techniques can be exploited. In the interface of the software, a set of images can be selected to obtain the synoptic map in an easy way. Several pre- and post-processing techniques can be used to improve the final result. The advantage of our software is that users do not need programming skills to carry out this kind of solar studies. The data can be saved in a .jpg or .gif format. We plan to incorporate other formats to save data in the future versions of software. An user guide as well as the installation setup of SunMap can be downloaded at https://github.com/gabgarar/SunMap.

We have made a preliminary comparison of a solar synoptic map obtained from our software using one daily image taken by AIA on board SDO with a wavelength of 193 Å from 26 August to 22 September 2011 with that obtained by Hamada, Asikainen, and Mursula (2019) for the same dates and characteristics. Note that there are some differences in the construction of the maps in both studies since, for example, Hamada, Asikainen, and Mursula (2019) made a homogenized intensity scale using SOHO and SDO images. However, from a simple visual check, a good agreement can be seen between both maps.

This software is intended to help both astrophysicists and geophysicists to make comparisons of different solar rotations. SunMap can be used, for example, to study both long- and short-term behavior of active regions, solar magnetic fields, and coronal holes. Furthermore, the use of any optical imaging instrument and post-processing techniques make it an editing tool with great potential. In the future developments, in addition to incorporating more file formats to save data, we plan to optimize the application for the use of images of larger size and quality in systems with lower requirements because scaling and casting techniques are being used to reduce the workload on the application. Another interesting development would be the connection of the application to a goto system and an astronomical camera on a telescope, allowing live editing and observation. The future versions of SunMap will be available at https://github.com/gabgarar/SunMap.