5.1 KiB
fourierOptics - Another beam propagation code
Code for fourier optics and my specific implementation relevant to the MICADO project.
Repository summary
This repository contains all code that I used to perform the analyses shown in
-
van den Born, J. A., Jellema, W., Navarro, R., Tolstoy, E., Jayawardhana, B., and Janssen, A. W. (2020). A Fourier optics approach to evaluate the astrometric performance of MICADO. In Modeling, Systems Engineering, and Project Management for Astronomy IX, volume 11450 of Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series, page 114500V and
-
van den Born, J.A. (in preparation, 2023), The MICADO Atmospheric Dispersion Corrector, PhD dissertation, University of Groningen - In particular, Chapter 2.
The /fourierOptics folder - effectively a python package - are also used in other works, such as
- J.A. van den Born et al. (2022). The MICADO Atmospheric Dispersion Corrector: Optomechanical design, expected performance and calibration techniques, Proc. SPIE.
- van den Born, J.A. (in preparation, 2023), The MICADO Atmospheric Dispersion Corrector, PhD dissertation, University of Groningen - In particular, Chapter 2.
Contents of this repository
-
/demonstration scripts: Some short scripts demonstrating a selection of the things that can be done with the propagation code. The examples include off-axis propagation and a demonstration of a PSF with a diffraction mask. -
/fourierOptics: The main source code for analysing optical systems through diffractive beam analysis -
/scripts: Many scripts used at some point during my project. In particular the./SPIEfolder contains all scripts - and more - used to generate the results presented in van den Born et al. (2020). -
/test cases (standalone): Scripts used during the early stages in the development of the/fourierOpticspackage. These scripts will run stand-alone, provided that the necessary python packages are installed.
The fourierOptics package
Many beam propagation codes exist of which poppy and HCIPY are two example Python implementations.
However, you learn the most by doing it yourself. So that is why I developed my own code from scratch. To speed things up I moved from numpy's implementation of the Fast Fourier Transform (np.fft.fft) to PyFFTW. Which makes PyFFTW a requirement for this code to run.
The goal of the code was to be able to run physical beam propagations, including wavefront errors and custom pupil functions through an optical system with multiple optical surfaces, not necessarily in either Fourier plane. This all should also be possible for large distance off-axis points. Later on I also implemented features for simulating simple Single Conjugate Adaptive Optics (SCAO) systems and seeing limited observations.
We summarise a few of the features below.
fourier.py: Contains the main propagation code. All beam propagation is done either by the angular spectrum method for plane waves (e.g. in collimated space) or the Fresnel diffraction integral (when light is diverging or converging in a more or less spherical wavefront).optics.py: Most optical components are implemented as infinitely thin phase transformers. The properties of the phase transformation is dependent on the type of optic considered. Included are thin (paraxial), thick spherical and thick even aspherical lenses, as well as flat, parabolic and freeform mirrors. Dummy surfaces can be added as well. Finally, the MICADO Atmospheric Dispersion Corrector is included.profiles.py: Contains a range of pupil functions. From the ELT pupil to Bahtinov masks.WavefrontError: Contains a class with functions to generate wavefront errors defined by Zernike polynomials and or a Power Spectral Density definiton, fit Zernike polynomials, scale wavefront errors or set low-, high- or bandpass filters on a wavefront error.micado.py: The paraxial optical system simulating the MICADO instrument at the ELT. This is the main optical system that I have used for my analyses.misc.py: Various functios that are sometimes useful.atmosphere.py: Contains several functions that are useful if simulating a seeing limited observation or an observation with SCAO is desired.
A simple example
We simulate a MICADO PSF where we add a 200 nm WFE on the first ADC prism. Note that all length units are in millimeters (mm).
import numpy as np
import sys
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Documents/Published/FourierOptics GitHub release/')
from fourierOptics import *
if __name__ == '__main__':
# Initiate MICADO paraxial model
mcd = ParaxialMICADO()
# Initiate WFE object
wfe = WavefrontError(mcd.n, mcd.m)
# Generate PSD surfaces
psd = wfe.generate_height_map(200e-6, 2, 1)
# Add it to ADC-P1
mcd.ELT_ADC.p1.add_wavefront_error(psd)
# Generate the PSF and plot it
E, x, y = mcd.propagate(l=1.35e-3,surface=-1, zoom=True, show=True)
