Files
fourierOptics/scripts/SPIE/generate_ADC_input_field.py

35 lines
1.2 KiB
Python

import numpy as np
import sys
sys.path.insert(0, '/Users/joost/Dropbox/Werk/PhD/Documents/Published/FourierOptics GitHub release/')
from fourierOptics import *
'''
Author: Joost van den Born, PhD student at University of Groningen
Contact: born@astro.rug.nl
Description: Script to propagate an input field to a surface in the
ELT-MICADO system. Here we propagate to the first ADC
surface and save the result, saving us a lot of time
in later analyses.
Script made for the SPIE manuscript.
'''
if __name__ == '__main__':
plt.rc('font', family='serif')
plt.rc('text', usetex=True)
# Setting some input parameters
dpix = 160
n, m = 1001, 1001
l = 1.49e-3 # wavelength
input_field_location = './data/ADC_input_field_{}x{}_{:.2f}_onaxis_obscured.pkl'.format(n,m,l*1e3)
# Initiate ELT-MICADO and wavefront error objects
mcd = ParaxialMICADO(l=l, n=n, m=m, dpix=dpix, entrance_pupil='obscured')
print ('Your resolution is {}x{} with a pixel size of {}'.format(n,m,dpix))
# Propagation up to the first ADC surface.
E, x, y = mcd.propagate(l=l,surface=3, zoom=False, show=True,
print_progress=True, hx=0, hy=0)
save_variable(input_field_location, (E,x,y))