MATLAB
`[r0, r0Screen] = PlaneR0(alpha,lambda,Geom,Atm)`

Computes the plane wave coherence diameter (Fried parameter) given turbulence assumptions, propagation geometry, and wavelength. Also calculates screen r0 if input Atm is a discrete structure from AtmStruct. Returns NaN if propagation path intersects earth surface.

 Parameters Description alpha [vector] Multiplier on turbulence model lambda [scalar] Wavelength of laser (m) Geom [struct/list] Geometry parameters. Can be a structure from GeomStruct or a comma separated list of (...,hp,ht,rd) - not required if Atm is a structure from AtmStruct. hp [scalar] Altitude of transmit/receive platform (m) ht [scalar] Altitude of target (m) rd [scalar] Downrange of target along spherical earth surface (m) Atm [struct/string] Atmospheric modeling parameters. Can be a structure from AtmStruct or a turbulence profile model to be used.
 Return Values Description r0 [vector] Plane wave coherence diameter (m) r0Screen [matrix] Plane wave coherence diameter at each phase screen. r0Screen is empty if Atm is not a discrete structure.

• Fried, D. L. "Limiting Resolution Looking Down through the Atmosphere." J. Opt. Soc. Am. 56, 1380-1384 (1966).

>> [r0, r0Screen] = PlaneR0(1.0,1.0e-6,AtmStruct);

• Compute r0 at 1 micron using the turbulence model in the input Atm struct.
>> [r0, r0Screen] = PlaneR0(2.0,1.0e-6,GeomStruct,AtmStruct)

• Compute r0 scaling the input turbulence model by a factor of 2 in addition to any turbulence multiplier already in the Atm struct. If Geom and geometry in Atm are not consistent, Atm will be updated.
>> [r0, r0Screen] = PlaneR0(1.0,1.0e-6,GeomStruct,'HV57')

• Cn2Model as turbulence profile string. r0Screen will be empty.
>> r0 = PlaneR0(1.0,1.0e-6,10,3000,10000,{'HufnagelValley',15,1e-15})

• Continous Atm model with geometry as a list. To pass additional parameters to the model, pass the model name and parameters in a cell array.