Cn2 = RandCn2(Atm,[N_Prof],[sigma],[thresh],[fixParam])
Returns a random Cn2 profile based on the input Cn2 model, baseModel, with the values specified by fixParam constrained to be equal to the computed values from the baseModel profile.
Parameters 
Description 
Atm [structure] 
Atmosphere structure from AtmStruct or a comma separated list of (h,x,dx,L,baseModel,...) 
h [vector] 
Altitude above sea level (m) 
x [vector] 
Normalized screen locations along the propagation path 
dx [vector] 
Normalized screen thicknesses along the propagation path 
L [scalar] 
Slant range of propagation (m) 
baseModel [string/fcnHandle] 
Base Cn2 profile model. If baseModel has more than a single input argument, must be passed in as 'ModelName(h,P1,...)'. Note that this may not work for all Cn2 models in ATMTools depending on the additional arguments required by the model. 
Nprof [scalar] 
(Optional) Number of random profiles to generate, defaults to 1. 
sigma [scalar] 
(Optional) Standard deviation of random vector  related to the standard deviation of the Cn2 profiles generated (by default this function will use the largest integer value that returns Nprof "Good" profiles). Cannot be passed in unless Nprof is also passed. Pass as empty ([]) to use default setting. 
thresh [scalar] 
(Optional) Threshold for the normalized Cn2 values. Values of normalized Cn2 less than threshold are not varied. Default is 0.01. Cannot be passed unless Nprof and sigma are passed. 
fixParam [string] 
String identifiers for parameters to be fixed across random profiles. 
Return Values 
Description 
Cn2 [struct/vect] 
An array of structures where each entry is a random profile generated using the profile in the first entry, or a vector of profiles Cn2 values if called by AtmStruct (${m}^{2/3}$). 
P [Matrix] 
Parameter matrix 4 by (Nprof+1) with the values of [r0 theta0 Rytov M0] for each of the profiles, where r0 is the Fried parameter (m) at 1 micron, theta0 is the isoplanatic angle (rad) at 1 micron, Rytov is the Rytov number at 1 micron, and M0 is the path average Cn2 (${m}^{2/3}$). If input is a structure this is added as a field in vector form (length of 4). 
>> Atm = AtmStruct(GeomStruct,10);
>> [Cn2, P] = RandCn2(Atm.h,Atm.z/Atm.L,Atm.dz/Atm.L,Atm.L, ...
'Clear1Night',100,5,0.01)
'Clear1Night',1,[],0.01,'r0','theta0','rytov')
'UniformCn2(h,''r0'',.05,1e6,L,x,dx)','r0')
'UniformCn2(h,''r0'',.05,1e6,L,x,dx)',...
1,[],0.01,'r0','theta0','rytov')
Copyright (c) 2009. All rights reserved.

What do you think about this topic? Send feedback!
