Gnuastro: Generating polar plots in Astronomical images

When a structure displays dependence on distance and azimuthal angle from a center (for example the spiral arms of galaxies or the diffraction spikes of stars), projecting the pixels to polar coordinates greatly simplifies their study. This projection from one pixel grid to another is known as a"polar plot". For this purpose, a new option has been added to the GNU Astronomy Utilities (Gnuastro) in version 0.23 to"astscript-radial-profile"script, which we describe in this research note. The figures of this research note are reproducible with Maneage, on the Git commit 5d34243.


INTRODUCTION
Studying or identifying structures that exhibit polar symmetries can be significantly enhanced when projecting their pixels into polar coordinates (polar angle vs. radius).For instance, to study the nature and mechanism of the age distribution across M101 and its spiral arm structure, Garner et al. (2024) used a polar plot.Moreover, truncation in face-on galaxies is challenging to detect because these galaxies lose their circular symmetry and become asymmetrical towards their faint outer regions.Peters et al. (2017) used the polar plot to study the disc truncation and extended halos in face-on spiral galaxies.Furthermore, the Point Spread Function (PSF) of most telescopes exhibits spikes, and most surveys mask all the star spikes entirely (for example, see Figures 7 and 11 of Coupon et al. 2018).Polar plots offer a Corresponding author: Sepideh Eskandarlou sepideh.eskandarlou@gmail.comconvenient way to identify their azimuthal angle (they rotate against the background sky).Additionally, Fang et al. (2023) used polar plots (or "polarcoordinate transformation") to preprocess galaxy images in their neural network for rotationallyinvariant galaxy morphology classification.
The new --polar option has been added recently to the astscript-radial-profile script (Infante-Sainz et al. 2024), allowing straightforward generation of a polar plot on a given region of an image as described in the following section.
This feature has been included in GNU Astronomy Utilities, or Gnuastro1 (Akhlaghi & Ichikawa 2015a), since version 0.232 .

GENERATING THE POLAR PLOT
The astscript-radial-profile is an installed script that utilizes several lower-level Gnuastro programs to obtain the radial profile.To create a polar plot, it performs the following steps: • Gnuastro's MakeProfiles is used to create a radial map (where each pixel's value is its radius from the given center, top-left panel of Figure 1).This step is performed within the script, even if a polar plot is not requested.• MakeProfiles is called a second time, but with the goal of generating the azimuthal map (where each pixel shows its azimuthal angle around the center on any elliptical shape, topright panel of Figure 1 shows it for a circle).• To combine the two labeled images (representing the radius and azimuth of each pixel) with the pixel values of the target image, we use MakeCatalog.The feature that MakeCatalog in Gnuastro offers, which other catalogbased tools do not, is the ability to specify two labeled images as input when generating the catalog, see Akhlaghi (2019).Finally, Make-Profiles is called one last time to create the polar plot based on the outputs of MakeCatalog.The resulting output is displayed in the bottom row of Figure 1.
A visual representation of all the steps of how polar plot construction are illustrated in Figure 1.The top-middle panel of Figure 1 shows M101 as imaged in J-PLUS DR3 in the rSDSS filter (Cenarro et al. 2019); down-sampled to 23.9 ′′ /pix.In the radial profile image, with dark blue colors indicate smaller radii.As the profile extends outward and the color transitions to yellow, the radii increase.This color progression effectively illustrates the change in radius from the center to the outer edges of each pixel of the input image in the vertical axis of polar plot.The green circle/line in the input/polar images represent a radius of 112, while the yellow circle/line represents a radius of 150.These radii are extracted from the radial pro-file, providing clear markers for the specified radii of input image.
Similarly, in the azimuth panel, the dark blue color represents a smaller angle (zero degrees).The angle then increases by one degree in a counterclockwise direction, culminating in yellow, which indicates a 360-degree rotation.This color gradient depicts the full range of azimuthal angles within the panel for each pixel of input image in x-axis of polar plot.In the input image and polar plot, the purple line indicates an angle of 45 degree, while the blue line represents an angle of 135 degree.The angles are extracted from the azimuth angle image, providing a clear visual reference for their respective angle in input image and polar plot.The final output, which is the polar plot resulting from combining the three panels in the top row, is displayed in the bottom row of Figure 1.

ACKNOWLEDGEMENT
The workflow of this research note uses Maneage (Managing data lineage, Akhlaghi et al. 2021, commit 8161194).This research note is created from the Git commit 5d34243, hosted on Codeberg 3 which is archived on Software Heritage 4 for longevity.Supplements are also available on Zenodo 5 .The analysis uses GNU Astronomy Utilities (Gnuastro, Akhlaghi & Ichikawa 2015a; Akhlaghi 2019) v0.22.69-ac1c.Gnuastro has been funded by the Japanese MEXT scholarship and its Grant-in-Aid for Scientific Research (21244012, 24253003), ERC 339659-MUSICOS, Spanish MINECO AYA2016-76219-P, and NextGenerationEU ICTS-MRR-2021-03-CEFCA.We acknowledge the funding by Governments of Spain and Aragón through FITE and Science Ministry (PGC2018-097585-B-C21 and PID2021-124918NA-C43).and azimuthal map (from left to right).In radial and azimuthal maps, the color changes from dark blue to yellow as the angle and radius become larger.The combination of the azimuthal angle, input image, and radial profile generates the polar plot displayed in the bottom row.The horizontal represents the angles derived from the azimuthal data.As a demonstration, the dark purple and blue lines in the top-middle panel show the pixels at a constant azimuthal angle of 45 and 135 degrees respectively.The vertical axis represents the radii derived from the radial profile, and the value of each pixel corresponds to the value of the input image's pixels.As a demonstration, the green and yellow circles in the top-middle panel show the pixels at a constant radius of 112 and 135 respectively.

3Figure 1 .
Figure1.Construction of polar plots.The top row, shows the radial map, input image (M101 as imaged in J-PLUS) and azimuthal map (from left to right).In radial and azimuthal maps, the color changes from dark blue to yellow as the angle and radius become larger.The combination of the azimuthal angle, input image, and radial profile generates the polar plot displayed in the bottom row.The horizontal represents the angles derived from the azimuthal data.As a demonstration, the dark purple and blue lines in the top-middle panel show the pixels at a constant azimuthal angle of 45 and 135 degrees respectively.The vertical axis represents the radii derived from the radial profile, and the value of each pixel corresponds to the value of the input image's pixels.As a demonstration, the green and yellow circles in the top-middle panel show the pixels at a constant radius of 112 and 135 respectively.