Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions PVLIB/pvl_absoluteairmass.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function AMa = pvl_absoluteairmass(AMrelative,pressure)
% PVL_ABSOLUTEAIRMASS Determine absolute (pressure corrected) airmass from relative airmass and pressure
%
%
% Syntax
% AMa = pvl_absoluteairmass(AMrelative, pressure)
%
Expand Down Expand Up @@ -29,11 +29,11 @@
% clear sky solar irradiance models using theoretical and measured data,"
% Solar Energy, vol. 51, pp. 121-138, 1993.
%
% See also PVL_RELATIVEAIRMASS
% See also PVL_RELATIVEAIRMASS

p=inputParser;
p.addRequired('AMrelative', @(x) all(isnumeric(x) | isnan(x)));
p.addRequired('pressure', @(x) all(isnumeric(x) & x>=0));
p.addRequired('AMrelative', @(x) isnumeric(x));
p.addRequired('pressure', @(x) isnumeric(x) & all(x>=0 | isnan(x)));
p.parse(AMrelative,pressure);

AMa = AMrelative.*pressure/101325;
115 changes: 36 additions & 79 deletions PVLIB/pvl_calcparams_desoto.m
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
function [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S,Tcell,alpha_isc,ModuleParameters, EgRef, dEgdT, varargin)
% PVL_CALCPARAMS_DESOTO Applies temperature and irradiance corrections to reference parameters per [1]
% PVL_CALCPARAMS_DESOTO Calculates five parameters to compute IV curves using the De Soto model.
%
% Syntax
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, M)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, M, Sref)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, M, Sref, Tref)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, Sref)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, Sref, Tref)
% [IL, I0, Rs, Rsh, nNsVth] = pvl_calcparams_desoto(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdt, 'Sref', Sref, 'Tref', Tref)
%
% Description
% Applies the temperature and irradiance corrections to the IL, I0,
% Rs, Rsh, and a parameters at reference conditions (IL_ref, I0_ref,
% etc.) according to the De Soto et. al description given in [1]. The
% results of this correction procedure may be used in a single diode
% model to determine IV curves at irradiance = S, cell temperature =
% Tcell.
% Applies the temperature and irradiance corrections to calculate the
% five parameters for an IV curve according to the De Soto model [1].
% The results of this procedure may be used to determine the IV curve
% at effective irradiance S and cell temperature Tcell.
%
% Input Parameters:
% S - The irradiance (in W/m^2) absorbed by the module. S must be >= 0.
% May be a vector of irradiances, but must be the same size as all
% other input vectors. Due to a division by S in the script, any S
% S - The effective irradiance (in W/m^2) absorbed by the module. S must be >= 0.
% May be a vector the same size as Tcell. Due to a division by S in the script, any S
% value equal to 0 will be set to 1E-10.
% Tcell - The average cell temperature of cells within a module in C.
% Tcell must be >= -273.15. May be a vector of cell temperatures, but
% must be the same size as all other input vectors.
% Tcell must be >= -273.15. May be a vector of the same size as S.
% alpha_isc - The short-circuit current temperature coefficient of the
% module in units of 1/C.
% module in units of A/C (or A/K).
% ModuleParameters - a struct with parameters describing PV module
% performance at reference conditions according to DeSoto's paper. A
% performance at reference conditions according to DeSoto's paper.
% Parameters may be generated or found by lookup. For ease of use, a library
% of parameters may be found within the System Advisor Model (SAM) [2].
% of modules A SAM library of modules is provided with PV_LIB (|\Required Data\CECModuleDatabaseSAM2014.1.14.mat|),
% which may be read by the SAM library reader
% function <pvl_SAMLibraryReader_CECModules_help.html |pvl_SAMLibraryReader_CECModules|>. may be found within the System Advisor Model (SAM) [2].
% The SAM library has been provided as a .mat file, or may
% be read and converted into a .mat file by the SAM library reader
% functions. The ModuleParameters struct must contain (at least) the
% following 5 fields:
% following fields:
% ModuleParameters.a_ref - modified diode ideality factor parameter at
% reference conditions (units of eV), a_ref can be calculated from the
% reference conditions, a_ref can be calculated from the
% usual diode ideality factor (n), number of cells in series (Ns),
% and cell temperature (Tcell) per equation (2) in [1].
% ModuleParameters.IL_ref - Light-generated current (or photocurrent)
% in amperes at reference conditions. This value is referred to
% as Iph in some literature.
% as Iphi in some literature.
% ModuleParameters.I0_ref - diode reverse saturation current in amperes,
% under reference conditions.
% ModuleParameters.Rsh_ref - shunt resistance under reference conditions (ohms)
Expand All @@ -51,14 +49,6 @@
% May be either a scalar value (e.g. -0.0002677 as in [1]) or a
% vector of dEgdT values corresponding to each input condition (this
% may be useful if dEgdT is a function of temperature).
% M - An optional airmass modifier, if omitted, M is given a value of 1,
% which assumes absolute (pressure corrected) airmass = 1.5. In this
% code, M is equal to M/Mref as described in [1] (i.e. Mref is assumed
% to be 1). Source [1] suggests that an appropriate value for M
% as a function absolute airmass (AMa) may be:
% M = polyval([-0.000126, 0.002816, -0.024459, 0.086257, 0.918093], AMa)
% M may be a vector, but must be of the same size as all other input
% vectors.
% Sref - Optional reference irradiance in W/m^2. If omitted, a value of
% 1000 is used.
% Tref - Optional reference cell temperature in C. If omitted, a value of
Expand Down Expand Up @@ -119,44 +109,37 @@
% Silicon (Si):
% EgRef = 1.121
% dEgdT = -0.0002677
% M = polyval([-0.000126 0.002816 -0.024459 0.086257 0.918093], AMa)
% Source = Reference 1
% Cadmium Telluride (CdTe):
% EgRef = 1.475
% dEgdT = -0.0003
% M = polyval([-2.46E-5 9.607E-4 -0.0134 0.0716 0.9196], AMa)
% Source = Reference 4
% Copper Indium diSelenide (CIS):
% EgRef = 1.010
% dEgdT = -0.00011
% M = polyval([-3.74E-5 0.00125 -0.01462 0.0718 0.9210], AMa)
% Source = Reference 4
% Copper Indium Gallium diSelenide (CIGS):
% EgRef = 1.15
% dEgdT = ????
% M = polyval([-9.07E-5 0.0022 -0.0202 0.0652 0.9417], AMa)
% Source = Wikipedia
% Gallium Arsenide (GaAs):
% EgRef = 1.424
% dEgdT = -0.000433
% M = unknown
% Source = Reference 4

p = inputParser;
p.addRequired('S',@(x) all(x>=0) & isnumeric(x) & isvector(x) );
p.addRequired('Tcell',@(x) all(x>=-273.15) & isnumeric(x) & isvector(x) );
p.addRequired('alpha_isc', @(x) (isnumeric(x) & isvector(x)));
p.addRequired('ModuleParameters', @(x) (isstruct(x)));
p.addRequired('EgRef', @(x) (isnumeric(x) & isvector(x) & x>0));
p.addRequired('dEgdT', @(x) (isnumeric(x) & isvector(x)));
p.addOptional('M', 1, @(x) (isnumeric(x) & isvector(x)));
p.addOptional('Sref',1000, @(x) (all(x>0)& isnumeric(x) & isvector(x)));
p.addOptional('Tref',25, @(x) (all(x>-273.15) & isnumeric(x) & isvector(x)));
p.addRequired('S',@(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('Tcell',@(x) isnumeric(x) && isvector(x) && all(x>=-273.15 | isnan(x)));
p.addRequired('alpha_isc', @(x) isnumeric(x) && isvector(x));
p.addRequired('ModuleParameters', @(x) isstruct(x));
p.addRequired('EgRef', @(x) isnumeric(x) && isvector(x) && all(x>0 | isnan(x)));
p.addRequired('dEgdT', @(x) isnumeric(x) && isvector(x));
p.addOptional('Sref',1000, @(x) isnumeric(x) && isvector(x) && (all(x>0 | isnan(x))));
p.addOptional('Tref',25, @(x) isnumeric(x) && isvector(x) && (all(x>-273.15 | isnan(x))));
p.parse(S, Tcell, alpha_isc, ModuleParameters, EgRef, dEgdT, varargin{:});

S = p.Results.S(:);
M = p.Results.M(:);
M = max(M,0); % Ensure that the airmass modifier is never negative

Sref = p.Results.Sref(:);
Tref = p.Results.Tref(:);
Tcell = p.Results.Tcell(:);
Expand All @@ -165,57 +148,31 @@
dEgdT = p.Results.dEgdT(:);
EgRef = p.Results.EgRef(:);

%Reference parameter should be taken and input from CEC database or similar
a_ref=ModuleParameters.a_ref(:);
IL_ref=ModuleParameters.IL_ref(:);
I0_ref=ModuleParameters.I0_ref(:);
Rsh_ref=ModuleParameters.Rsh_ref(:);
Rs_ref=ModuleParameters.Rs_ref(:); %R_s=R_s_ref
%
VectorSizes = [numel(S), numel(M), numel(Tcell), numel(dEgdT),...
numel(Sref), numel(Tref), numel(EgRef), numel(a_ref), numel(IL_ref),...
numel(I0_ref), numel(Rsh_ref), numel(Rs_ref), numel(alpha_isc)];
Rs_ref=ModuleParameters.Rs_ref(:);

VectorSizes = [numel(S), numel(Tcell)];
MaxVectorSize = max(VectorSizes);
if not(all((VectorSizes==MaxVectorSize) | (VectorSizes==1)))
error(['Input vectors S, Tcell, alpha_isc, EgRef, dEgdT, M, Sref (if used), '...
'Tref (if used), and all used components of ModuleParameters must '...
error(['Input vectors S and Tcell must '...
'either be scalars or vectors of the same length.']);
end

%k=1.3806488e-23; %Boltzman's constant in units of J/K
k = 8.617332478e-5; % Boltzmann constant in units of eV/K


Tref_K=Tref+273.15; % Reference cell temperature in Kelvin
Tcell_K=Tcell+273.15; % cell temperature in Kelvin




% We divide by S later, so make S a very small number for any S == 0.
S(S==0) = 1E-10;

%
% % If any input variable is not a scalar, then make any scalar input values
% % into a column vector of the correct size.
% if MaxVectorSize >1
% if VectorSizes(1) < MaxVectorSize
% S = S.*ones(MaxVectorSize , 1);
% end
% if VectorSizes(2) < MaxVectorSize
% M = M.*ones(MaxVectorSize, 1);
% end
% if VectorSizes(3) < MaxVectorSize
% Tcell_K = Tcell_K.*ones(MaxVectorSize, 1);
% end
% end

%These parameters (a, I_L, I_o, M, and R_sh) need to be vectors of equal
%length to the number of conditions (number of S,Tcell pairs).
E_g=EgRef.*(1+dEgdT.*(Tcell_K-Tref_K)); % Equation 10 in [1]
nNsVth=a_ref.*(Tcell_K./Tref_K); % Equation 8 in [1]
IL=S./Sref.*M.*(IL_ref+alpha_isc.*(Tcell_K-Tref_K));
% Equation 9 in [1]
IL=S./Sref.*(IL_ref+alpha_isc.*(Tcell_K-Tref_K));
IL(S <= 0) = 0; % If there is no light then no current is produced
I0=I0_ref.*((Tcell_K./Tref_K).^3).*exp((EgRef./(k.*Tref_K))-(E_g./(k.*Tcell_K)));
I0(IL==0) = 0; % If there is no light-generated current, there is no reverse saturation current
Rsh=Rsh_ref.*(Sref./S); % Equation 12 in [1]
Rsh(S <= 0) = inf; % Rsh is undefined if there is no current
Rs = Rs_ref;
6 changes: 3 additions & 3 deletions PVLIB/pvl_grounddiffuse.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@


p = inputParser;
p.addRequired('GHI',@(x) all(isnumeric(x) & isvector(x) & x>=0));
p.addRequired('Albedo', @(x) all(isnumeric(x) & isvector(x) & x>=0 & x<=1));
p.addRequired('SurfTilt', @(x) all(isvector(x) & isnumeric(x)));
p.addRequired('GHI',@(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('Albedo', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=1) | isnan(x)));
p.addRequired('SurfTilt', @(x) isnumeric(x) && isvector(x));
p.parse(GHI,Albedo,SurfTilt);

GHI = GHI(:);
Expand Down
4 changes: 2 additions & 2 deletions PVLIB/pvl_isotropicsky.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
%

p = inputParser;
p.addRequired('SurfTilt', @(x) all(isnumeric(x) & x<=180 & x>=0 & isvector(x)));
p.addRequired('DHI', @(x) all(isnumeric(x) & isvector(x) & x>=0));
p.addRequired('SurfTilt', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=180) | isnan(x)));
p.addRequired('DHI', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.parse(SurfTilt, DHI);

SkyDiffuse = DHI *(1+ cosd(SurfTilt)) * 0.5;
Expand Down
36 changes: 18 additions & 18 deletions PVLIB/pvl_perez.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
function SkyDiffuse = pvl_perez(SurfTilt, SurfAz, DHI, DNI, HExtra, SunZen, SunAz, AM, varargin)
% PVL_PEREZ Determine diffuse irradiance from the sky on a tilted surface using one of the Perez models
% PVL_PEREZ Determine diffuse irradiance from the sky on a tilted surface using the Perez model
%
% Syntax
% SkyDiffuse = pvl_perez(SurfTilt, SurfAz, DHI, DNI, HExtra, SunZen, SunAz, AM)
% SkyDiffuse = pvl_perez(SurfTilt, SurfAz, DHI, DNI, HExtra, SunZen, SunAz, AM, model)
%
% Description
% Perez models determine the diffuse irradiance from the sky (ground
% reflected irradiance is not included in this algorithm) on a tilted
% The Perez model [3] determines the sky diffuse irradiance on a tilted
% surface using the surface tilt angle, surface azimuth angle, diffuse
% horizontal irradiance, direct normal irradiance, extraterrestrial
% irradiance, sun zenith angle, sun azimuth angle, and relative (not
% pressure-corrected) airmass. Optionally a selector may be used to use
% pressure-corrected) airmass. An optional selector may be used to specify
% any of Perez's model coefficient sets.
%
% Inputs:
Expand Down Expand Up @@ -64,17 +63,18 @@
% the input vector(s).
%
% References
% [1] Loutzenhiser P.G. et. al. "Empirical validation of models to compute
% solar irradiance on inclined surfaces for building energy simulation"
% 2007, Solar Energy vol. 81. pp. 254-267
% [1] Loutzenhiser P.G. et. al., 2007. Empirical validation of models to compute
% solar irradiance on inclined surfaces for building energy simulation,
% Solar Energy vol. 81. pp. 254-267.
% [2] Perez, R., Seals, R., Ineichen, P., Stewart, R., Menicucci, D., 1987. A new
% simplified version of the Perez diffuse irradiance model for tilted
% surfaces. Solar Energy 39 (3), 221�232.
% [3] Perez, R., Ineichen, P., Seals, R., Michalsky, J., Stewart, R., 1990.
% Modeling daylight availability and irradiance components from direct
% and global irradiance. Solar Energy 44 (5), 271�289.
% [4] Perez, R. et. al 1988. "The Development and Verification of the
% Perez Diffuse Radiation Model". SAND88-7030
% [4] Perez, R. et. al 1988. The Development and Verification of the
% Perez Diffuse Radiation Model,.SAND88-7030, Sandia National
% Laboratories.
%
% See also PVL_EPHEMERIS PVL_EXTRARADIATION PVL_ISOTROPICSKY
% PVL_HAYDAVIES1980 PVL_REINDL1990 PVL_KLUCHER1979 PVL_KINGDIFFUSE
Expand All @@ -84,15 +84,15 @@
%
%

p = inputParser;
p.addRequired('SurfTilt', @(x) all(isnumeric(x) & x<=180 & x>=0 & isvector(x)));
p.addRequired('SurfAz', @(x) all(isnumeric(x) & x<=360 & x>=0 & isvector(x)));
p.addRequired('DHI', @(x) all(isnumeric(x) & isvector(x) & x>=0));
p.addRequired('DNI', @(x) all(isnumeric(x) & isvector(x) & x>=0));
p.addRequired('HExtra', @(x) all(isnumeric(x) & isvector(x) & x>=0));
p.addRequired('SunZen', @(x) all(isnumeric(x) & x<=180 & x>=0 & isvector(x)));
p.addRequired('SunAz', @(x) all(isnumeric(x) & x<=360 & x>=0 & isvector(x)));
p.addRequired('AM', @(x) (all(((isnumeric(x) & x>=0) | isnan(x))) & isvector(x)));
p=inputParser;
p.addRequired('SurfTilt', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=180) | isnan(x)));
p.addRequired('SurfAz', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=360) | isnan(x)));
p.addRequired('DHI', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('DNI', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('HExtra', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('SunZen', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=180) | isnan(x)));
p.addRequired('SunAz', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=360) | isnan(x)));
p.addRequired('AM', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addOptional('model', '1990', @(x) ischar(x));
p.parse(SurfTilt, SurfAz, DHI, DNI, HExtra, SunZen, SunAz, AM, varargin{:});

Expand Down
38 changes: 13 additions & 25 deletions PVLIB/pvl_sapmcelltemp.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [Tcell Tmodule] = pvl_sapmcelltemp(E, E0, a, b, windspeed, Tamb, deltaT)
function [Tcell, Tmodule] = pvl_sapmcelltemp(E, E0, a, b, windspeed, Tamb, deltaT)
% PVL_SAPMCELLTEMP Estimate cell temperature from irradiance, windspeed, ambient temperature, and module parameters (SAPM)
%
% Syntax
Expand Down Expand Up @@ -41,33 +41,21 @@
% See also PVL_SAPM
%
p = inputParser;
p.addRequired('E', @(x) all(isnumeric(x) & (x >= 0) & isvector(x)));
p.addRequired('E0', @(x) all(isnumeric(x) & isscalar(x) & (x >= 0)));
p.addRequired('a', @(x) all(isscalar(x) & isnumeric(x)));
p.addRequired('b', @(x) all(isscalar(x) & isnumeric(x)));
p.addRequired('windspeed', @(x) all(isvector(x) & isnumeric(x)));
p.addRequired('Tamb', @(x) all(isnumeric(x) & (x >= -273.15) & isvector(x)));
p.addRequired('deltaT', @(x) all(isnumeric(x) & (x >= 0) & isscalar(x)));
p.addRequired('E', @(x) isnumeric(x) && isvector(x) && all(x>=0 | isnan(x)));
p.addRequired('E0', @(x) isnumeric(x) && isscalar(x) && all(x>=0 | isnan(x)));
p.addRequired('a', @(x) isnumeric(x) && isscalar(x));
p.addRequired('b', @(x) isnumeric(x) && isscalar(x));
p.addRequired('windspeed', @(x) isnumeric(x) && isvector(x));
p.addRequired('Tamb', @(x) isnumeric(x) && isvector(x) && all(x >= -273.15 | isnan(x)));
p.addRequired('deltaT', @(x) isnumeric(x) && isscalar(x) && all(x>=0 | isnan(x)));
p.parse(E, E0, a, b, windspeed, Tamb, deltaT)

E = E(:);

if isscalar(p.Results.windspeed)
windspeed = p.Results.windspeed*ones(size(E));
else
windspeed = p.Results.windspeed(:);
end

if isscalar(p.Results.Tamb)
Tamb = p.Results.Tamb*ones(size(E));
else
Tamb = p.Results.Tamb(:);
if ~(isscalar(windspeed) || numel(windspeed) == numel(E))
error('Input windspeed must be scalar or vectors of same length as E.');
end

if (numel(E) ~= numel(windspeed)) || (numel(E) ~= numel(Tamb)) || (numel(E) ~= numel(windspeed))
error(['Error in pvl_kingcelltemp. Inputs E, Tamb, and windspeed must '...
'be scalars or vectors of same length.']);
if ~(isscalar(Tamb) || numel(Tamb) == numel(E))
error('Input Tamb must be scalar or vectors of same length as E.');
end

Tmodule = E.*(exp(a+b.*windspeed))+Tamb;
Tcell = Tmodule + E./E0.*deltaT;
Tcell = Tmodule + E./E0.*deltaT;
16 changes: 8 additions & 8 deletions PVLIB/pvl_singleaxis.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
%
%
p = inputParser;
p.addRequired('SunZen', @(x) all(isnumeric(x) & x>=0 & x<=180) & isvector(x));
p.addRequired('SunAz', @(x) all(isnumeric(x) & x>=0 & x<=360) & isvector(x));
p.addRequired('Latitude', @(x) (isnumeric(x) & isscalar(x)));
p.addRequired('AxisTilt', @(x) (isnumeric(x) & isscalar(x) & x>=0 & x<=90));
p.addRequired('AxisAzimuth', @(x) (isnumeric(x) & isscalar(x) & x>=0 & x<=360));
p.addRequired('MaxAngle', @(x) (isnumeric(x) & isscalar(x) & x<=180 & x>=0));
p.addOptional('BackTrack', 0, @(x) (isscalar(x)));
p.addOptional('GCR',1/3.5, @(x) (isnumeric(x) & isscalar(x) & x<=1));
p.addRequired('SunZen', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=180) | isnan(x)));
p.addRequired('SunAz', @(x) isnumeric(x) && isvector(x) && all((x>=0 & x<=360) | isnan(x)));
p.addRequired('Latitude', @(x) isnumeric(x) && isscalar(x));
p.addRequired('AxisTilt', @(x) isnumeric(x) && isscalar(x) && x>=0 && x<=90);
p.addRequired('AxisAzimuth', @(x) isnumeric(x) && isscalar(x) && x>=0 && x<=360);
p.addRequired('MaxAngle', @(x) isnumeric(x) && isscalar(x) && x>=0 && x<=180);
p.addOptional('BackTrack', 0, @(x) isscalar(x));
p.addOptional('GCR',1/3.5, @(x) isnumeric(x) & isscalar(x) & x<=1);
p.parse(SunZen, SunAz, Latitude, AxisTilt, AxisAzimuth, MaxAngle, varargin{:})

if Latitude<0
Expand Down
Loading