OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
b28_lin.f
Go to the documentation of this file.
1  subroutine b28_lin(scan,npix,b2,b8)
2 
3 c This subroutine removes the effect of the bilinear gains from
4 c SeaWiFS bands 2 and 8
5 
6 c Modified to reflect the redefinition of the knees. April 20, 2000.
7 
8  save
9  real*4 b2(*),b8(*)
10  real*4 b2tab(1024),b8tab(1024)
11  real*4 b2k(5),b2s(5),b2r(5),b8k(5),b8s(5),b8r(5)
12  integer*2 scan(8,*)
13 c data b1k/21.,814.4,814.6,818.5,1023./
14 c data b6k/23.,786.3,786.5,787.4,1023./
15  data b2k/18.,808.27,809.16,811.31,1023.0/
16  data b8k/21.,783.99,785.22,786.52,1023.0/
17 c data b1s/0.013733,0.013733,0.020049,0.037170,0.240156/
18 c data b6s/0.004254,0.004254,0.006344,0.012422,0.219265/
19  data b2s/0.013426,0.013426,0.022472,0.037209,0.274/
20  data b8s/0.0022241,0.0022241,0.0032520,0.0061538,0.139345/
21 c data b1r/0.,10.899,10.903,11.049,60.159/
22 c data b6r/0.,3.247,3.248,3.259,54.926/
23  data b2r/0.,10.61,10.63,10.71,68.713/
24  data b8r/0.,1.697,1.701,1.709,34.6613/
25  logical first
26  data first/.true./
27 
28 c If first time through, set up counts-to-radiances table
29  if (first) then
30  first = .false.
31  i1 = 1
32  i2 = b2k(2)+1
33  do i=i1,i2
34  b2tab(i) = b2s(2)*(i - b2k(1) - 1)
35  end do
36  do l=3,5
37  i1 = i2 + 1
38  i2 = b2k(l) + 1
39  if (i2.ge.i1) then
40  do i=i1,i2
41  b2tab(i) = b2s(l)*(i - b2k(l-1) - 1) + b2r(l-1)
42  end do
43  end if
44  end do
45 
46  i1 = 1
47  i2 = b8k(2)+1
48  do i=i1,i2
49  b8tab(i) = b8s(2)*(i - b8k(1) - 1)
50  end do
51  do l=3,5
52  i1 = i2 + 1
53  i2 = b8k(l) + 1
54  if (i2.ge.i1) then
55  do i=i1,i2
56  b8tab(i) = b8s(l)*(i - b8k(l-1) - 1) + b8r(l-1)
57  end do
58  end if
59  end do
60  end if
61 
62 c Loop through pixels
63 
64  do i=1,npix
65 
66 c Linearize Band 2
67 
68  b2(i) = b2tab(scan(2,i)+1)
69 
70 c Linearize Band 8
71 
72  b8(i) = b8tab(scan(8,i)+1)
73 
74  end do
75 
76  return
77  end
78 
#define real
Definition: DbAlgOcean.cpp:26
subroutine b28_lin(scan, npix, b2, b8)
Definition: b28_lin.f:2