1 Introduction

Ultraviolet Imaging Telescope (UVIT; [3]) is one of the payloads on board the Indian Astronomy Satellite AstroSat [1, 12]. UVIT is primarily designed to make high spatial resolution (<1.8\(^{\prime \prime }\)) images over a field of ∼28\(^{\prime }\), simultaneously in three channels: FUV (130–180 nm), NUV (200–300 nm), and VIS (320–550 nm). Soft X-ray telescope (SXT; [2]) and Scanning Sky monitor (SSM; [10]) are the other two imaging payloads on-board AstroSat capable of imaging the sky in soft X-ray bands with arc-minute resolution.

Due to the inherent design of the intensified imagers, involving a fiber taper for reducing the plate-scale, the final image suffers from distortions which interfere with good astrometry. Therefore, a correction for the distortions is necessary for good astrometry. For example, by comparing the SDSS source catalogs with GALEX detections, an absolute astrometric precision of 0.49\(^{\prime \prime }\) rms and 0.59\(^{\prime \prime }\) rms for NUV and FUV respectively was achieved for GR2/GR3 data [9] which is further improved to 0.32\(^{\prime \prime }\) rms and 0.34\(^{\prime \prime }\) respectively in the latest GR6 data [5].

The distortions in UVIT are primarily in the CPU (Camera Proximity Unit containing the Detector Module, shown in Fig. 1 and some electronics mounted on the focal plane of the detector). The distortions in the CPU are mainly believed to be due to the imperfections in the Fiber- taper construction. In principle it is best to calibrate these distortions of the full optical chain in the orbit. However, it is difficult to find a dense astrometric field for ultraviolet, and only low frequency spatial distortions might be measured in the orbit. Therefore we plan to derive distortions in two steps:

  1. 1.

    Distortion in each CPU is measured by imaging a simple geometrical pattern, e.g. a set of parallel lines or a grid of pin holes etc.

  2. 2.

    An astrometric field in the orbit exposed during the AstroSat performance and verification (PV) phase to confirm the distortions estimated on ground.

Fig. 1
figure 1

Schematic of UVIT detector module is shown. The fibre taper is indicated, with the CMOS imager at the top

Here we discuss the experimental procedure and analysis of observations used for estimating distortions in the CPUs on ground using a grid of holes drilled in some geometrical pattern. The distortion values obtained at discrete positions are then extended to all the pixel positions by interpolating the values. The pixel positions which fall outside of the grid pattern (edges of the detector) are filled by extra-polating the values.

In the second part of the calibrations which will be published elsewhere, we will compare the ground calibration results with the on-board observations of selected open clusters to check the efficacy of applying distortion values to the observed fields and improvement in the astrometry.

2 Distortions in CPUs

For estimating the distortions in the CPUs, images of a grid are taken by the CPUs; the optical arrangement to obtain these images is shown in Fig. 2. These images are called as “IIA images” from now onwards. The grid is made by drilling pinholes, of size ∼0.04 mm, with laser beam on a substrate of Invar (Fig. 3). The pinholes are in a square pattern, covering a circle of ∼40 mm diameter, as shown in Fig. 4. The task of estimating the distortions is done in two parts. In the First part, the “exact positions” of centres of the pinholes are estimated, and in the second part positions of the centres in the images taken with the CPUs are compared with the “exact positions”.

Fig. 2
figure 2

Schematic of the optical arrangement used for estimation of distortions of CPUs

Fig. 3
figure 3

Optical layout of IUCAA Faint Object Spectrometer and Camera (based on Gupta et al. [11])

Fig. 4
figure 4

Image of the grid as taken in R-filter with IFOSC of IUCAA telescope

2.1 Positions of the centres of the pinholes obtained with IFOSC

2.2 Images taken with IFOSC

To obtain centroids of the pinholes, the grid is imaged by the high quality reducer of IUCAA Faint Object Spectrograph & Camera (IFOSC; [11]), at Ineter University Center for Astronomy and Astrophysics (IUCAA), Pune in, R and V bands. Schematic of IFOSC is shown in Fig. 2. The grid was placed in the slit-holder located at the “Telescope Focus”. The images were recorded, with a reduction by a factor ∼2.2, on a CCD with 2168 pixel × 2048 pixel of 13.5 μm. Two sets of data were taken in each R and V band. In the second set, the grid was rotated by ∼180 degree with reference to the first set. The observations were repeated for three exposures, 5 s, 10 s and 15 s each to obtain optimum dynamic range and to avoid saturation of pixels as the holes are of different sizes as seen in Fig. 4. For obtaining the centers of the pinholes, we use only IFOSC images with 10 s and 15 s integrations.

The pinhole positions of individual images are obtained with the help of daophot [13] routine provided with ‘ASTROLIB’ [8]. A two dimensional Gaussian is fitted to each pinhole to obtain the centers. For unique identification of the individual holes, a set of larger holes is drilled in a pattern of ‘L’ as can be seen in Fig. 4. Each ‘larger hole’ consists of multiple pinholes in a “ + ” pattern. The “FIND” routine detects these larger pinholes as multiple closely spaced sources and these closely spaced groups of positions are removed manually. The positions corresponding to other larger and un-even shaped pinhole images are also removed.

2.3 Combining the positions from different images

The IFOSC images of the grid can have mainly two defects:

  • Wedge effect: There could be some angle between the focal plane and the CCD and this would give unequal gains at different positions (the optics is NOT telecentric). This can be corrected by suitably combining images from the two sets.

  • Distortion due to optics: data on distortion are obtained by simulating the optics in Zemax; a polynomial fit with, even powers of radius, br 2 + cr 4, is made to these data as the optics of IFOSC is centro-symmetric. Positions of the pinholes in the images are corrected for this.

As mentioned earlier, there are two sets of images taken for two different orientations of the grid, which differed by a rotation of 180 degrees. An average of the positions in these two sets would correct for any distortion due to wedge effect. In order to take such average, it is essential to convert all the positions to the same frame of reference by allowing for any deviations in the angle of rotation from 180 degrees and for any shifts of centre of the grid. This process is described below.

Assuming that there is no warping in the images, the transformation will be a linear transformation and involves only rotation and scaling with offset. For a scale ‘g’, rotation ‘ 𝜃’ and offsets x 0 & y 0, the translated positions (x\(_{i}^{\prime }\), y\(_{i}^{\prime }\)) corresponding to the position (x i , y i ) can be written as,

$$\begin{array}{@{}rcl@{}} x^{\prime}_{i} &=& g[x_{i} \cos{\theta}- y_{i} \sin{\theta}]+x_{0}\\ y^{\prime}_{i} &=& g[x_{i} \sin{\theta}+ y_{i} \cos{\theta}]+y_{0} \end{array} $$
(1)

The positions viz., \(x_{0}, y_{0}, x_{i}, y_{i}, x^{\prime }_{i}, y^{\prime }_{i}\) are in units of pixels and the angle is in radians. To determine the rotation angle and the scale, we use the method of minimising sum of the squares of deviations,

$$ f(g,{\theta}, x_{0}, y_{0}) = {\sum}_{i} [(X_{i} - x^{\prime}_{i})^{2} + (Y_{i} - y^{\prime}_{i})^{2}] $$
(2)

where, X i and Y i are the observed positions in the reference image (for IUCAA IFOSC data, the image observed in R-band and integrated for 15 s is taken as the main image or reference image), and \(x^{\prime }_{i}\) and \(y^{\prime }_{i}\) are the transformed (zoomed, rotated with offset) positions of the comparison frame/image given by (1).

For 𝜃∼0, \(\sin {\theta }= {\theta }\) and \(\cos {\theta }= 1\). Also g=1 for images taken with same telescope, hence (2) will yield,

$$ f(g, {\theta}, x_{0}, y_{0}) = {\sum}_{i} \{[X_{i} - g(x_{i} - y_{i} {\theta})-x_{0}]^{2} + [Y_{i} - g(x_{i} {\theta}+ y_{i})-y_{0}]^{2}\} $$
(3)

where, (x i ,y i ) are the original positions in the comparison image.

The parameters of fit are found by equating the four partial derivatives \(\frac {{\partial } f}{{\partial } {\theta }}\), \(\frac {{\partial } f}{{\partial } g}\), \(\frac {{\partial } f}{{\partial } x_{0}}\) and \(\frac {{\partial } f}{{\partial } y_{0}}\) to zero and solving the linear equations. We note that before application of the above procedure, the coordinate system for the comparison image is rotated/shifted manually so that positions of the centres nearly match in the two images. The averaged positions are given by,

$$\begin{array}{@{}rcl@{}} X^{\prime}_{i} &=& X_{i} - \frac{1}{(J+1)}{\sum}_{j=1}^{j=J} F_{j}(x_{i}) \\ Y^{\prime}_{i} &=& Y_{i} - \frac{1}{(J+1)} {\sum}_{j=1}^{j=J} F_{j}(y_{i}) \end{array} $$
(4)

where, j = 1, 2.. corresponds to different corrections obtained by comparing the reference frame (j = 0, R-filter, 15 s, 0 deg rotation) with other frames. F (x i )=[X i g(x i y i 𝜃)−x 0] and F (y i )=[Y i g(x i 𝜃 + y i )−y 0]. F(x i ) and F(y i ) actually gives the errors in the position X i and Y i .

The difference of the centers of the reference and the matched image is plotted in Fig. 5. The plot shows that the difference in the positions of the centers of pinholes after rotation is less than 0.25 pixel except for three pinhole positions. A plot of the difference vectors is also shown in Fig. 5.

Fig. 5
figure 5

Plot of difference between the center positions of IFOSC reference image (R-filter, 15 s integration, 0 deg rotation) and comparison image (R-band, 15 s, 180 deg grid rotation) after fitting. Close-up view of the two positions showing large deviation are shown on the RHS. The top one has a deformed shape and the second largest deviation (bottom image) falls very close to the edge

Figure 5 suggests that only three points have large differences as compared to the average difference of other points. A close inspection of these points (as shown in the RHS of Fig. 5) shows that: in the first pinhole position (1), the pinhole is not circular. The second pinhole (2) falls very close to the edge. Hence, the three points are removed from the main and compared images and subjected to least square fit again. Figure 6 shows the plot of the difference vector after subtracting the three largest error vectors from the plot shown in Fig. 5. The exercise of obtaining the differences is repeated for all the remaining six images and an average difference map is obtained by averaging the seven difference maps thus obtained. The average difference map is plotted in RHS of Fig. 6. The mean and rms of this average difference map are 0.05 pixel and 0.04 pixel respectively. The maximum difference is 0.23 pixels close to the bottom center shown in blue color in the figure.

Fig. 6
figure 6

Similar to Fig. 5 after the second iteration after eliminating the three pinholes which show large deviations. RHS is the difference plot of average of six IFOSC images obtained by comparing with R-filter image taken with zero degree rotation. The maximum is 0.23 pixel which is near the middle of the bottom of the figure shown in blue color

2.4 Correcting for distortions in IFOSC images

As mentioned earlier, the images of the grid were taken by a camera called IFOSC and this camera has some distortion. Simulations with Zemax have been fitted to derive the distortion as,

$$ r^{\prime} = \frac{2.244}{5}r + \frac{0.010}{625}r^{2} + \frac{0.016}{(625*625)}r^{4} $$
(5)

where, “r\(^{\prime }\)” is the radius from centre of the CCD in “mm” and “r” is the radius on the object plane in “mm”.

From (5), we can write the approximation (which corrects for the distortion and the magnification/gain) as:

$$ \frac{2.244}{5}r = r^{\prime} - \left( \frac{5}{2.244}r^{\prime}\right)^{2} ~ \left( \frac{0.010}{625}\right) - \left( \frac{5}{2.244}r^{\prime}\right)^{4} \left( \frac{0.016}{(625*625)}\right) $$
(6)

The position coordinates (\(X_{p}^{\prime }, Y_{p}^{\prime }\)) in units of CCD pixels can be transformed to distance (\(X^{\prime } and Y^{\prime }\)) in units of “mm” as,

$$ X^{\prime} = (Xp^{\prime} - 1084) {\times}0.0135 $$
(7)
$$ Y^{\prime} = (Yp^{\prime} - 1024) {\times}0.0135 $$
(8)
$$ r^{\prime} = \sqrt{(X^{\prime})^{2} + (Y^{\prime})^{2})} $$
(9)

For the two co-ordinates, one can also write,

$$ X {\times} 2.244/5 = X^{\prime} {\times}r^{\prime\prime}/r^{\prime} $$
(10)
$$ Y {\times}2.244/5 = Y^{\prime} {\times}r^{\prime\prime}/r^{\prime} $$
(11)

where \(r^{\prime \prime } = 2.244/5r\).

Equations (10) and (11) give the corrected coordinates in the object plane in “mm”.

Procedure

The procedure for estimating the radial distortion is given below.

  1. 1.

    Positions of the pinholes are converted from pixels of the CCD to mm according to (7) and (8).

  2. 2.

    Radial distance of the pinholes from the center ‘r\(^{\prime }\)’ is calculated according to (9).

  3. 3.

    Estimate r\(^{\prime \prime }\).

  4. 4.

    Corrected positions are calculated according to (3) & (4).

  5. 5.

    The difference between X and X\(^{\prime }\)*5/2.244 gives the radial distortion in the X-direction. Similarly the distortions along Y-direction are estimated. The value “5/2.244” is introduced to account for the magnification.

The difference between the distortion corrected positions X & Y and the CCD positions X\(^{\prime }\) & Y\(^{\prime }\) are obtained as below.

$${\delta}X_{i} = X_{i} -X_{i}^{\prime}*5/2.244 \,\, \text{and}\,\, {\delta}Y_{i} = Y_{i} - Y_{i}^{\prime}*5/2.244$$

A difference vector plot of the radial distortions (rx, ry) corrected for magnification is shown in Fig. 7. The maximum radial distortion corresponds to 48.95 μm at position (−14.8 mm, −18.5 mm). The maximum distortion is shown as a black colored vector in Fig. 7. After correction for the radial distortion the positions are given as,

$$X_{i} = X^{\prime}_{i} + {\delta}X_{i}, \,\,\,\, Y_{i} = Y^{\prime}_{i} + {\delta}Y_{i}$$
Fig. 7
figure 7

Difference vector plot of estimated radial distortions after correcting for the magnification

3 Estimation of distortion in the CPUs

To estimate distortions in the CPUs, IIA images of the grid taken with the CPUs are analysed to find positions of the pinholes. These positions are compared with the final positions derived using IFOSC camera as discussed in Section 2.1. The positions obtained from IFOSC camera will be called “Reference Positions” from here afterwards. As the magnification and orientation of the images taken with CPUs is not predetermined, these are taken as unknowns to derived by comparing the positions in the IIA images with the “Reference Positions”. Any differences between the positions found, after correcting for the magnification and orientation, and the “Reference Positions” are taken as distortions. In order to find any overall distortion pattern, analysis is also made to find any elliptical distortion. The procedures for finding the distortion are described below.

3.1 Procedure for finding CPU distortion

The procedure for obtaining the magnification and the orientation of the images is similar to that described for comparing images of the grid taken with IFOSC (see Section 2.1). Thus, the following steps are implemented

  1. 1.

    The X and Y positions of the grid pattern in the IIA images are obtained by using daophot and are then refined using a 2d Gaussian fit.

    The units are 1/8 of a pixel (called sub-pixel) of Star250.

  2. 2.

    The multiple detections and positions corresponding to distorted/large holes are removed manually.

  3. 3.

    The “Reference Positions” are transformed for gain, rotation, and shift manually so as to obtain a close fit with the positions in the IIA image.

  4. 4.

    The final values of gain, rotation, and shift for the “Reference Positions” are obtained by minimising sum of the squares of deviations in positions of the pinholes.

  5. 5.

    The difference between the IIA image and IFOSC positions (corrected for the final rotation, gain and offset) gives the distortions.

    $${\Delta}X_{i} = imX_{i} - (IFOSCx_{i} - {\theta}{\times}IFOSCy_{i})*g - X0 $$
    $${\Delta}Y_{i} = imY_{i} - ({\theta}{\times}IFOSCx_{i} + IFOSCy_{i})*g - Y0 $$

    where, imX i and imY i are the X & Y positions of the IIA image in sub-pixel. IFOSCx i & IFOSCy i are the pre-rotated IFOSC positions.

  6. 6.

    The exercise is repeated for images with multiple orientations of the grid (rotation angles), with the constraint that the gain is identical for all the images.

The estimated distortion for the three grid positions taken with the FUV are plotted as vector plots in Fig. 8. The fit parameters obtained for different grid positions of the FUV images are listed in Table 1.

Fig. 8
figure 8

Vector plots of estimated distortion of the FUV detector. The three colors correspond to the three views of the grid: 0 deg (green), 180 deg (blue) and 270 deg (black) respectively. The size of the vector at the top left correspond to 16 sub-pixel

Table 1 The parameters for fitting the positions with “Reference positions”, for three orientations of the grid, are shown for FUV, NUV and VIS CPUs

3.2 Fit for elliptical distortion

The Figs. 89 showing the error vectors in the preceding subsection indicate presence of some elliptical distortion. The procedure for estimating this distortion is described below.

  1. a)

    The distortion is simulated by assuming unequal gain along two orthogonal directions.

  2. b)

    The directions can have any angle with reference to the axes of the image.

  3. c)

    The “Reference Positions” are first transformed to a frame with axes at a defined angle.

  4. d)

    The next transformation is applied for two unequal gains along the two axes.

  5. e)

    Now the positions are transformed back to a frame with the original direction of axes, with a shift of origin.

  6. f)

    The parameters of transformations are found by minimising sum of the squares of differences in positions with reference to those in the image with CPU

  7. g)

    Step “d)” is tried for many angles in step “c)” and angle for the best fit is chosen.

Fig. 9
figure 9

Similar to Fig. 8 for NUV (L) and VIS (R) channels. The largest vector at the bottom right correspond to 24 and 36 sub-pixels respectively

The above steps are captured by the following equations:

$$\begin{array}{@{}rcl@{}} X^{\prime\prime}\!& = & \!a \cos (T) [X \cos (T)\,-\, Y \sin (T)] \,+\, b \sin (T)[X \sin (T) + Y \cos (T)] \,-\, X_{0} \\ & = & \!X[a \cos^{2}(T) \,+\, b \sin^{2}(T)] \,+\, Y [ b \sin(T) \!\cos(T) \,-\, a \sin(T) \cos(T)] \,-\, X_{0} \end{array} $$
(12)
$$\begin{array}{@{}rcl@{}} Y^{\prime\prime}& = & \!b \cos (T) [X \sin (T)\,+\, Y \cos (T)] \!- a \sin (T)[X \cos (T) - Y \sin (T)] \,-\, Y_{0} \\ & = & \!Y[b \cos^{2}(T) \,+\, a \sin^{2}(T)] \,-\, X [ a \sin(T) \cos(T) \,-\, b \sin(T) \cos(T)] \,-\, Y_{0} \end{array} $$
(13)

where ‘X’ and ‘Y’ are the best fit reference positions obtained from steps 3 & 4 of Section 3.1, ‘T’ is the angle of directions along which the gains are ‘a’ and ‘b’ respectively, and X 0 and Y 0 give the shift of origin.

The sum of the square of the distances (d) between the image co-ordinates (imX i , imY i ) and the modified reference frame (X\(^{\prime \prime }_{i}\), Y\(^{\prime \prime }_{i}\)) can be written as,

$$ d^{2} = {\sum}[(imX_{i} - X^{\prime\prime}_{i})^{2} + (imY_{i} - Y^{\prime\prime}_{i})^{2}] $$
(14)

The parameters ‘a’, ‘b’, ‘X0’ and ‘Y0’ are found by equating the partial derivatives \(\frac {{\partial }d}{{\partial }a}\), \(\frac {{\partial }d}{{\partial }b}\), \(\frac {{\partial }d}{{\partial }X0}\) and \(\frac {{\partial }d}{{\partial }Y0}\) to zero and solving the resulting linear equations.

This process is repeated for several values of ‘T’, and the best value of ‘T’ (as inferred by sum of the squares of deviations) is selected.

The “Remainders” (the vectors given by F x i and F y i ) for the three images, taken with FUV detector, are plotted in Fig. 10. The parameters of the fits obtained for transformation with the corresponding best value of ‘T’ are listed in Table 2. The procedure is repeated for the remaining two detectors (NUV and VIS) and the results are presented in Table 2 and in Fig. 11 respectively.

Fig. 10
figure 10

Vector plots of estimated distortion of the FUV detector with elliptical gain fits. The three colors corresponding to the three views of the grid: 0 deg (green), 180 deg (blue) and 270 deg (black) respectively. The size of the vectors at the top right correspond to the highest distortion of 16.0 sub-pixel

Fig. 11
figure 11

Similar to Fig. 10 for NUV (L) and VIS (R) channels. The largest vector at the bottom right correspond to 24.0 sub-pixel

Table 2 Double gain (elliptical) fit parameters obtained by minimizing the difference between positions of IIA images and average IFOSC image positions shown in Figs. 10 and 11

4 Interpolation of distortion values

To obtain the distortion values at each CCD250 pixel position, the discrete distortion values obtained in Section 3 are interpolated using the utility interpolate.griddata available under python Scipy package [7]. The procedure followed for individual channels are as follows using FUV channel as example:

  1. 1.

    Combine the X and Y-distortion values corresponding to the three rotations separately to increase the density of values.

  2. 2.

    Subject the combined (grid) values to interpolation using the method “linear”. This fills all the values that can be interpolated with the values and the values beyond the edges with NAN (Not a number).

  3. 3.

    Re-do the interpolation of the combined values from point 1 using the method “nearest”.

  4. 4.

    Replace all the NAN values from (2) with the corresponding values from (3) above.

The resulting 512×512 array is the final distortion matrix corresponding to X and Y-directions of FUV channel as difference vectors is shown in Fig. 12. The above procedure is repeated for other two channels to obtain the distortion maps of all the three channels. The resulting interpolated maps are also shown in Fig. 12. Note that for clarity, only every twentieth position is shown in the figure.

Fig. 12
figure 12

Interpolated distortion values of FUV (top), NUV (bottom left) and VIS (bottom right) channels. Only every 20th positions are plotted for clarity

The 512×512 values corresponding to the X and Y-directions are written as individual tables of a fits file. The three fits files thus forms the UVIT distortion matrices and used for correcting the observed UVIT fileds. An analytic solution for the distortion map was not tried as a suitable analytic form which could reproduce the sharp changes near edges of the field is not available.

5 Conclusion

Distortions for the detectors of UVIT have been mapped by imaging a calibrated grid of holes. The extent of distortions is found to be 0.2 %–0.4 % of the full field or 3.5\(^{\prime \prime }\)–7\(^{\prime \prime }\) in the different detectors. The corrections for these distortions would make it possible to reduce the astrometric errors from 3.5\(^{\prime \prime }\)–7\(^{\prime \prime }\) to 1\(^{\prime \prime }\) or less.

For verifying accuracy of these measured distortion maps, we have taken images of few open clusters in the orbit [4]. Initial analysis of the VIS images indicates a marked improvement in the astrometry by application of corrections for the distortion. The rms error in positions of the stars is reduced to 2.24 sub-pixel from 6.1 sub-pixel. A detailed analysis is under progress [6].