# Piston Error Measurement for Segmented Telescopes with an Artificial Neural Network
## 4 Simulation
### Simultaneous Multi-Piston Measurement  
In the part, we utilized the proposed method to simultaneously detect multi-piston errors of the whole aperture. Based on the theoretical deduction in Section 3.1, we can see that the MTF model of the \(N\) sub-pupils segmented telescope consisted of \(N^{2}\) sub-MTFs. In the spatial frequency domain, the \(N\) sub-MTFs overlapped at the position where the center spatial frequency was zero to form the central peak, while the other \(N\) (\(N-1\)) sub-MTFs distributed around the central peak to form the sidelobes. Every pair of sub-pupils produced a pair of MTF sidelobes, the sidelobes symmetrically distributed on both sides of the central peak. If all of the sidelobes did not overlap, their amplitudes could be obtained at the same time by one CCD image, hence the piston errors of all sub-mirrors were retrieved at the same time by inputting the peak height of sub-MTF corresponding to each sub-mirror into the trained network. In order to verify the feasibility of simultaneous multi-piston measurement with the proposed method, we took a primary mirror composed of four hexagonal sub-pupils as an example. We modeled the four-segment imaging system using MATLAB, results of which are shown in Figure 10a. The No. 1 sub-mirror was set as reference pupil, and the piston errors were introduced on the No. 2, No. 3 and No.4 sub-pupils, respectively. The corresponding system MTF without piston errors is shown in Figure 10b: there was one MTF central peak and 12 MTF sidelobes (\(N\) (\(N-1\)) = 4 \(\times\) (4 \(-\) 1) = 12). Four sub-MTFs (\(N\) = 4) overlapped at the position where the center spatial frequency was zero to form this central peak, and every pair of sub-pupils produced a pair of MTF sidelobes. Note that a colored MTF was used here in order to describe which peaks were actually used to solve the piston error of the corresponding sub-mirror. When the No. 1 sub-mirror was set as reference pupil, No. 2 sub-mirror produced the two red sub-MTFs, No. 3 sub-mirror produced the two green sub-MTFs and No. 4 sub-mirror produced the two yellow sub-MTFs. The six light blue sub-MTFs at the outermost periphery were produced either by No. 2 and No. 3 sub-mirrors together, or by No. 2 and No. 4 sub-mirrors together, or by No. 3 and No. 4 sub-mirrors together, which could not be used to measure piston errors. Thus, we could use any one of the red sub-MTFs to measure the piston error of No. 2 sub-mirror, any one of the green sub-MTFs to measure the piston error of No. 3 sub-mirror and any one of the yellow sub-MTFs to measure the piston error of No. 4 sub-mirror, respectively. For the detailed generation principle between the sub-MTFs and sub-mirrors, refer to paper [31]. In order to simultaneously detect piston errors of the three segments, we first had to establish the neural network and train it with the generated dataset. Here we still used the broadband light source centered at 632.8 nm with bandwidth 1 nm, since \(N\) = 4, and  
Figure 10: The 4 hexagonal segmented telescope showing (**a**) the position arrangement of the 4 sub-mirrors and (**b**) the corresponding system MTF colored without piston error. according to Equation (16) we could directly obtain the datasets of the peak heights of the MTF sidelobes varying with the piston errors to train the network. The curve of the relation between the peak heights of the sub-MTF and the piston errors is shown in Figure 11. One hundred thousand sets of data were fed into the network to train it, and the network settings were the same as those of the two sub-pupils' telescope except the ratio between the training set, validation set and test set was 65%: 20%: 15%. We added more data to the validation set to avoid the overfitting problem. The training results are shown in Figure 12.  
Then we used the PSF images directly collected from the established optical system composed of 4 hexagonal segments shown in Figure 9a to simultaneously measure piston errors for all sub-mirrors based on the trained network.