Configuration¶
Configuration of the system is handled by the confParse module, that reads the simulation parameters from a given configuration file. This file should be a YAML file, which contains groups for each simulation sub-module. Where a sub-module may consist of multiple components i.e. Wave-front sensors, each WFS must be specified seperately, with an integer index, for example:
WFS:
0:
GSMag: 0
GSPosition: (0, 0)
1:
GSMag: 1
GSPosition: (1, 0)
Example configuration files can be found in the conf directory of the soapy package.
(Note: Previously, a Python file was used for configuration. This format is still supported but can lead to messy configuration files! There are still examples of these in the source repository if you prefer.)
Below is a list of all possible simulation parameters. Parameters which have a description ending in ** can be altered while the simulation is running. When others are changed and aoinit must be run before they will take effect and they may break a running simulation.
Simulation Parameters¶
-
class
soapy.confParse.SimConfig(N=None)[source]¶ Configuration parameters relavent for the entire simulation. These should be held at the beginning of the parameter file with no indendation.
- Required:
Parameter Description pupilSizeint: Number of phase points across the simulation pupil nItersint: Number of iteration to run simulation loopTimefloat: Time between simulation frames (1/framerate) - Optional:
Parameter Description Default nGSint: Number of Guide Stars and WFS 0nDMint: Number of deformable Mirrors 0nSciint: Number of Science Cameras 0reconstructorstr: name of reconstructor class to use. See reconstructormodule for available reconstructors."MVM"simNamestr: directory name to store simulation data NonewfsMPbool: Each WFS uses its own process Falseverbosityint: debug output for the simulation ranging from 0 (no-ouput) to 3 (all debug output) 2logfilestr: name of file to store logging data, NonelearnItersint: Number of learn iterations for Learn & Apply reconstructor 0learnAtmosstr: if random, then random phase screens used for learnrandomsimOversizefloat: The fraction to pad the pupil size with to reduce edge effects 1.2loopDelayint: loop delay in integer count of loopTime0threadsint: Number of threads to use for multithreaded operations 1photometric_zpfloat: Photometric zeropoint - number of photons/meter/second from a magnitude 0 star 2e9- Data Saving (all default to False):
Parameter Description saveSlopesSave all WFS slopes. Accessed from sim with sim.allSlopessaveDmCommandsSaves all DM Commands. Accessed from sim with sim.allDmCommandssaveWfsFramesSaves all WFS pixel data. Saves to disk a after every frame to avoid using too much memory saveStrehlSaves the science camera Strehl Ratio. Accessed from sim with sim.longStrehlandsim.instStrehlsaveWfeSaves the science camera wave front error. Accessed from sim with sim.WFE.saveSciPsfSaves the science PSF. saveInstPsfSaves the instantenous science PSF. saveInstScieFieldSaves the instantaneous electric field at focal plane. saveSciResSave Science residual phase
Telescope Parameters¶
-
class
soapy.confParse.TelConfig(N=None)[source]¶ - Configuration parameters characterising the Telescope. These should be held in the
Telescopegroup in the parameter file.- Required:
Parameter Description telDiamfloat: Diameter of telescope pupil in metres - Optional:
Parameter Description Default obsDiamfloat: Diameter of central obscuration 0maskstr: Shape of pupil (only accepts circlecurrently)circle
Atmosphere Parameters¶
-
class
soapy.confParse.AtmosConfig(N=None)[source]¶ Configuration parameters characterising the atmosphere. These should be held in the
Atmospheregroup in the parameter file.- Required:
Parameter Description scrnNoint: Number of turbulence layers scrnHeightslist, int: Phase screen heights in metres scrnStrengthlist, float: Relative layer scrnStrength windDirslist, float: Wind directions in degrees. windSpeedslist, float: Wind velocities in m/s r0float: integrated seeing strength (metres at 500nm) - Optional:
Parameter Description Default scrnNameslist, string: filenames of phase if loading from fits files. If Nonewill make new screens.NonesubHarmonicsbool: Use sub-harmonic screen generation algorithm for better tip-tilt statistics - useful for small phase screens. FalseL0list, float: Outer scale of each layer. Kolmogorov turbulence if None.NonerandomScrnsbool: Use a random set of phase phase screens for each loop iteration? Falseinfinitebool: Use infinite phase screens? Falsetau0float: Turbulence coherence time, if set wind speeds are scaled. NonewholeScrnSizeint: Size of the phase screens to store in the atmosphereobject. Required if large screens used.None
Wave-front Sensor Parameters¶
-
class
soapy.confParse.WfsConfig(N=None)[source]¶ Configuration parameters characterising Wave-front Sensors. These should be held in the
WFSgroup in the parameter file. Each WFS is specified by first specifying an index, then the WFS parameters. Any entries abovesim.nGSwill be ignored.- Required:
Parameter Description GSPositiontuple: position of GS on-sky in arc-secs wavelengthfloat: wavelength of GS light in metres nxSubapsint: number of SH sub-apertures - Optional:
Parameter Description Default typestring: Which WFS object to load from WFS.py? ShackHartmannGSMagfloat: Apparent magnitude of the guide star 0photonNoisebool: Include photon (shot) noise. FalseeReadNoisefloat: Electrons of read noise 0throughputfloat: Throughput of the entire optical and electronic system from guide star photons to recorded WFS detector counts. Includes atmospheric effects, the optical train and detector gain. 1.propagationModestring: Mode of light propogation from GS. Can be “Physical” or “Geometric”**. "Geometric"subapFieldStopbool: if True, add a field stop to the wfs to prevent spots wandering into adjacent sub-apertures. if False, oversample subap FOV by a factor of 2 to allow into adjacent subaps. FalseremoveTTbool: if True, remove TT signal from WFS slopes before reconstruction.** FalsefftOversampint: Multiplied by the number of of phase points required for FOV to increase fidelity from FFT. 3GSHeightfloat: Height of GS beacon. 0if at infinity.0subapThresholdfloat: How full should subap be to be used for wavefront sensing? 0.5lgsbool: is WFS an LGS? FalsecentMethodstring: Method used for Centroiding. Can be centreOfGravity,brightestPxl, orcorrelation.**centreOfGravityreferenceImagearray: Reference images used in the correlation centroider. Full image plane image, each subap has a separate reference image NoneangleEquivNoisefloat: width of gaussian noise added to slopes measurements in arc-secs 0centThresholdfloat: Centroiding threshold as a fraction of the max subap value.** 0.1exposureTimefloat: Exposure time of the WFS camera - must be higher than loopTime. If None, will be set to loopTime. NonewvlBandWidthfloat: Width of wavelength band sent to WFS in nm 100extendedObjectndarray or str: The object used as extended source for WFS, of size 2*fftOversamp*pxlsPerSubap. The FOV of the object should be twice the FOV of the sub-aperture. NonefftwThreadsint: number of threads for fftw to use. If 0, will use system processor number.1fftwFlagstr: Flag to pass to FFTW when preparing plan. FFTW_PATIENTpxlsPerSubapint: number of pixels per sub-apertures 10subapFOVfloat: Field of View of sub-aperture in arc-secs 5correlationFFTPadint: Padding for correlation WFS Nonenx_guard_pixelsint: Guard Pixels between Shack-Hartmann sub-apertures (Not currently operational) 0
Laser Guide Star Parameters¶
-
class
soapy.confParse.LgsConfig(N=None)[source]¶ - Configuration parameters characterising the Laser Guide Stars. These should be held in the
LGSsub-group of the WFS parameter group.- Optional:
Parameter Description Default uplinkbool: Include LGS uplink effects FalsepupilDiamfloat: Diameter of LGS launch aperture in metres. 0.3wavelengthfloat: Wavelength of laser beam in metres 600e-9propagationModestr: Mode of light propogation from GS. Can be “Physical” or “Geometric”. "Phsyical"heightfloat: Height to use physical propogation of LGS (does not effect cone-effect) in metres 90000elongationDepthfloat: Depth of LGS elongation in metres 0elongationLayersint: Number of layers to simulate for elongation. 10launchPositiontuple: The launch position of the LGS in units of the pupil radii, where (0,0)is the centre launched case, and(1,0)is side-launched.(0,0)fftwThreadsint: number of threads for fftw to use. If 0, will use system processor number.1fftwFlagstr: Flag to pass to FFTW when preparing plan. FFTW_PATIENTnaProfilelist: The relative sodium layer strength for each elongation layer. If None, all equal. None
Deformable Mirror Parameters¶
-
class
soapy.confParse.DmConfig(N=None)[source]¶ Configuration parameters characterising Deformable Mirrors. These should be held in the
DMsub-group of the parameter file. Each DM is specified seperately, by first specifying an index, then the DM parameters. Any entries abovesim.nGSwill be ignored.- Required:
Parameter Description typestring: Type of DM. This must the name of a class in the DMmodule.nxActuatorsint: Number independent DM shapes. e.g., for stack-array DMs this is number of actuators in one dimension, for Zernike DMs this is number of Zernike modes. gainfloat: The loop gain for the DM.** svdConditioningfloat: The conditioning parameter used in the pseudo inverse of the interaction matrix. This is performed by numpy.linalg.pinv. - Optional:
Reconstructor Parameters¶
-
class
soapy.confParse.ReconstructorConfig(N=None)[source]¶ Configuration parameters describing the reconstructor that will be used to calculate DM commands from WFS measurements. The
typemust be an object in thesoapy.reconstructionmodule. Other parameters may be specific to this reconstructor- Optional:
Parameter Description Default typestring: Type of reconstructor to use. Must be a class in reconstruction module. MVMsvdConditioningfloat: Conditioning parameter to be using in Least Squares reconstructor inversion SVD to cut off unwanted DM modes. See numpy.linalg.pinvfor details about the inversion.0gainfloat: Gain of the integrator loop. 0.6imat_noisebool: include WFS noise when making in interaction matrix True
Science Camera Parameters¶
-
class
soapy.confParse.SciConfig(N=None)[source]¶ Configuration parameters characterising Science Cameras.
These should be held in the
Scienceof the parameter file. Each Science target is created seperately with an integer index. Any entries abovesim.nSciwill be ignored.- Required:
Parameter Description positiontuple: The position of the science camera in the field in arc-seconds FOVfloat: The field of fiew of the science detector in arc-seconds wavelengthfloat: The wavelength of the science detector light pxlsint: Number of pixels in the science detector - Optional:
Parameter Description Default pxlScalefloat: Pixel scale of science camera, in arcseconds. If set, overwrites FOV.Nonetypestring: Type of science camera This must the name of a class in the SCImodule.PSFfftOversampint: Multiplied by the number of of phase points required for FOV to increase fidelity from FFT. 2fftwThreadsint: number of threads for fftw to use. If 0, will use system processor number.1fftwFlagstr: Flag to pass to FFTW when preparing plan. FFTW_MEASUREheightfloat: Altitude of the object. 0 denotes infinity. 0propagationModestr: Mode of light propogation from object. Can be “Physical” or “Geometric”. "Geometric"instStrehlWithTTbool: Whether or not to include tip/tilt in instantaneous Strehl calculations. False