PyAstroPol: A Python package for the instrumental polarization analysis of the astronomical optics

The instrumental polarization analysis is one of the key aspects of the optical system analysis of the astronomical telescopes and instruments. The majority of the optical surfaces in the astronomical instruments induce a change in the state of polarization of the incoming light, which could lead to inaccurate measurements of the state of polarization or polarimetry. Hence, polarimetric instruments inevitably require the information about the polarization properties of the optical system or the instrumental polarization. This can be determined through experiments, analysis or a combination of both. As the telescopes become larger and instruments become more complex, the instrumental polarization analysis has become all the more crucial (e.g., Anche et al., 2015; Harrington & Sueoka, 2016).


Statement of Need
The instrumental polarization analysis is one of the key aspects of the optical system analysis of the astronomical telescopes and instruments. The majority of the optical surfaces in the astronomical instruments induce a change in the state of polarization of the incoming light, which could lead to inaccurate measurements of the state of polarization or polarimetry. Hence, polarimetric instruments inevitably require the information about the polarization properties of the optical system or the instrumental polarization. This can be determined through experiments, analysis or a combination of both. As the telescopes become larger and instruments become more complex, the instrumental polarization analysis has become all the more crucial (e.g., Anche et al., 2015;Harrington & Sueoka, 2016).

Summary
The Python package PyAstroPol provides a means to analyze the polarization properties of a given optical system with relative ease and minimal dependencies. The simple end goal is to calculate the Mueller matrix (e.g., Gil & Ossikovski, 2016) of the optical system. Data pipelines of the astronomical instruments can easily distribute this package alongside their polarimetric calibration routines.
In the polarization analysis of the astronomical telescopes, various approaches have been adopted depending on the complexity of the system. A significant part of the complexity is because the instrumental polarization is often time-dependent. For the solar telescopes with Coelostats, Mueller matrices were analytically derived as a function of time (e.g., Balasubramaniam et al., 1985;Beck et al., 2005). For Thirty Meter Telescope (TMT), a combination of analytical and numerical methods is used (Anche et al., 2015). However, for Daniel K. Inouye Solar Telescope (DKIST), Zemax -a commercial software -is used, along with the team's in-house tools (Harrington & Sueoka, 2016).
PyAstroPol aims to combine the better parts of the aforementioned programs: it is an opensource tool written in the Python programming language and offers a range of functions to model the astronomical optics. There is no open-source software which has polarization ray propagation features as per my knowledge. Hence, Zemax OpticStudio® modelling is used for comparison. The salient features and important limitations are listed below.

Salient features :
• PyAstroPol calculates the Mueller matrix of a given imaging-type optical system, by coherently adding the electric field vectors after propagation. • Astronomical sources can be directly placed in the model using relevant coordinates, namely, declination, hour angle and latitude of the telescope site.
• Off-axis components are included, as they have a significant effect on polarization.
• Effect of multi-layered coatings, such as oxide layers and protective coatings, on the state of polarization is included. These are also significant in the polarization analysis of the astronomical optics (e.g., Harten et al., 2009). • All the data, such as points of incidence, polarization directions, complex electric field values and more, are readily available to the user for any further analysis. • Material refractive index information can be downloaded from the popular online source https://refractiveindex.info/ as .csv. It can be formatted and used with this software. • Spot diagram is possible at any instance of the beam path, as a by-product of ray tracing.
Important Limitations: • All the analysis uses strictly the ray treatment. Hence, all the limitations of the rays optics shall be applicable. • Only circular optics (apertures) can be modelled at the moment. • Birefringent components are not included yet. The justification for this choice is that the behaviour of the birefringent components is fairly straightforward as they strongly polarize the light. • The visualization features are limited.
• PyAstroPol is neither a design software nor interactive. That is, the user must know the optical system that is to be analyzed, and the system must be updated every time a component is changed.
Results of the code have been verified against previous works (Pruthvi et al., 2018), and Zemax OpticStudio®. A variety of examples have been provided, and they should facilitate the quickstart. One of the examples also provides the aforementioned comparison with commercial software.