-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRW2rrs.m
More file actions
47 lines (38 loc) · 1.36 KB
/
RW2rrs.m
File metadata and controls
47 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function [U, rrs, nm] = RW2rrs(RW, nm, L)
% MW algorithm and for SPM and associated uncertainty estimates
%
% Juliana Tavora, University of Maine, 2020
%
% See the following publication for details on the method:
% Tavora, J, et al., An algorithm to estimate Suspended Particulate Matter
% concentrations and associated uncertainties from Remote Sensing Reflectance
% in Coastal Environments
%
% INPUTS:
%
% nm - wavelengths associated with measured Remote sensing reflectance
% RW - measured water-leaving reflectance
% L - constants to calculate U by Gordon et al (1988)
%
% OUTPUTS:
%
% U - function of IOPs by Gordon et al (1988) at 630 nm and longer
% rrs - measured below water rrs(nm) at 630 nm and and longer
% nm - wavelengths from 630 nm and longer
%
%-------------------------------------------------------------------------%
% water-leaving reflectance to above water remote sensing reflectance
Rrs = RW ./ pi;
% Lee et al., 2002 approach to transfer above water remote sensing
% reflectance to below water remote sensing reflectance
rrs = Rrs ./ (0.52+ (1.7 .* Rrs));
% Gordon et al (1988) approach
raiz_delta = sqrt((L(1)).^2 - (4*L(2).*(-rrs)));
if imag(raiz_delta) ~= 0
raiz_delta = NaN;
end
U = (-L(1) + raiz_delta)./(2*L(2));
rrs = rrs(:,(nm>=630));
U = U(:,(nm>=630));
nm = nm(nm>=630);
end