# PhoSim Physics Override Command Format

The following are internal PhoSim commands that override the realistic physics. By default, all physics is turned on and thus with no options it should be the most realistic simulation.

For detailed studies, however, there are a large number of commands that can be used. To use these commands, put them in a file and specify the file using the -c or --command argument. Note the order of the following command could matter, such that later commands will override earlier commands.

## Physics Module Switches

The following are the different physics module switches. These are the most common commands to be used, because they simply ignore a part of the simulation for investigation into the cause of measurement systematics.

atmospheremode X (X=2 turns atmosphere on, X=1 only pupil diffraction, X=0 turns off; Default is X=2)

atmosphericdispersion X (X=1 is to turn atmospheric dispersion on and X=0 is to turn off)

clearopacity (resets all forms of atmospheric opacity to 0 (clouds, aerosols, molecular, rayleigh)

clearclouds (resets all clouds to 0)

clearturbulence (sets seeing in all layers to 0 including dome seeing)

telescopemode X (X=1: normal telescope; X=0: perfect dummy telescope; Default is X=1)

perturbationmode X (X=0: ideal design; X=1: ideal design+deliberate control (move commands); X=2: ideal design + non-controlled environmental/fabrication; X=3: all on (ideal design + deliberate control + non-controlled); Default is X=3)

clearperturbations (resets all perturbations to 0 (body, izernike, chip angle))

trackingmode X (X=1: tracking on; X=0: tracking turned off; Default is X=1)

windshake X (X=1: wind shake on; X=0; wind shake off; Default is X=1)

cleartracking (resets all tracking to 0)

diffractionmode X (X=1: monte carlo diffraction; X=0 diffraction off; X=2 full FFT approach (very slow); Default is X=1)

coatingmode X (X=1: coatings on surfaces on; X=0: coatings turned off; Default is X=1)

opticsonlymode X (X=1: turns off atmosphere/detector; X=0: all on; Default is X=0)

contaminationmode X (X=1 dust/condensation ; X=0 perfect surfaces)

detectormode X (X=1: charge diffusion in detector on; X=0 charge diffusion off; Default is X=1)

cleardefects (removes all detector defects)

chargesharing X (X=1 allows charge sharing approaching saturation; X=0 effect off)

pixelerror X (X=1 imperfect pixel boundaries; X=0 effect off)

fringing X (X=1 fringing on; X=0 off)

fieldanisotropy X (X=1 lateral fields; X=0 perfectly parallel)

impurityvariation X (X=1 dopant impurity variation ; X=0 no variation)

saturation X (X=1: saturation is on X=0: saturation is off)

blooming X (X=1: blooming is on; X=0 blooming is off)

quickbackground (turn on the quick background optimization-- fast but averages detector physics)

normalbackground (turn on the normal background optimization (default)-- reasonably fast, near perfect approximation)

singlephotonbackground (generate the background one photon at a time-- very slow)

See also the background options comparison.

## Advanced Commands

The following advanced commands generally modify internal physics functionality in PhoSim. Generally, these will only be modified for very specific situations.

rotationjitter X (X is jitter in arcseconds of rotation tracker)

elevationjitter X (X is jitter in arcseconds in elevation)

azimuthjitter X (X is jitter in arcseconds in azimuth)

pixelsize X (X is pixelsize in microns)

siliconthickness X (X is thickness of silicon in microns)

izernike X Y Z (zernike Y on surface X of Z in mm)

ipoly X Y Z (x-y polynomial Y (numbered 0=00, 1=01, .. 6=06, 7=10, ..) on surface X of Z in mm)

body X Y Z (6 degrees of freedom of optic X for degree of freedom Y in Z radians/microns)

seeing X Y (Y is the seeing at zenith at 500 nm of layer X)

outerscale X Y (Y is the outer scale in meters of layer X)

densityfluc X Y (Y is the density fluctuations of layer X)

densitymean X Y (Y is the mean density of layer X)

cloudmean X Y (Y is the mean opacity in magnitudes of layer X)

cloudvary X Y (Y is the opacity variation in magnitudes of layer X)

winddir X Y (Y is the wind direction of layer X)

height X Y (Y is the height of layer X)

waterpressure X (X is the water vapor pressure at ground level)

reldensity X (X is the density of air relative to nominal)

relo2 X (X is the relative fraction of O2 relative to nominal)

relo3 X (X is the relative fraction of O3 relative to nominal)

relh2o X (X is the relative fraction of H2O relative to nominal)

lascatprob X (X is the large angle scattered light fraction)

domeseeing X (X is the dome seeing in arc seconds)

raydensity X (X is the density of cosmic rays)

scalenumber X (X is the scaling in electrons of the cosmic ray images)

shuttererror X (X=error in shutter in seconds)

surfacemap X Y Z (perturbed map of surface of individual optic (either zemax format or x,y,z points) (X=surface number, Y=filename, Z=relative scaling)

eventfile X (X=1 on, X=0 off) outputs a four column FITS file of all the ray positions for every photon the first two rows will be: angle1, angle2, wavelength, 0 arrival time, source ID, 0, 1 then the next rows will be: x, y, z, surface # there may be a variable number of rows per photons when photons are destroyed

Optimization Commands:

backalpha X (X is the signal to noise of a groups of background photons above the background itself, default = 0.2, set to 0 for single photon background (very slow), set to 0.5 for quick background (very fast))

backgamma X (X is the number of photons to simulate at a time (and therefore smooth over detector physics) when a photon hits the sensor, default = 1.0 for both normal background and single photon background, for quickbackground use 50.0)

See the background options comparison.

Optimization Commands that should not be changed:

backdelta X (X is the size factor to divide by to get the size of the grouping in the sensor, for quick background use 1.0)

backbeta X (X is the size factor (times 10") of the background groups above the detector, default = 4.0 which means 40" gaussian radius)

Commands to generate a fake PSF (often used by setting telescopemode 0 and sensormode 0):

toypsf X (X is the size of the PSF)

toyg1 X (X is the gamma 1 of the PSF to generate ellipticity)

toyg2 X (X is the gamma 2 of the PSF to generate ellipticity)