-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindbadends.f
More file actions
executable file
·50 lines (43 loc) · 1.09 KB
/
findbadends.f
File metadata and controls
executable file
·50 lines (43 loc) · 1.09 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
47
48
49
50
c findbadends differs from findends because it does not
c exclude zero/small values.
c find the first/last points with data that is not bad
c subroutine findends(n,wave,spec,imin,imax,wmin,wmax)
subroutine findbadends(n,spec,imin,imax)
c real wave(n),spec(n)
real spec(n)
include 'pcredshift.h'
c buffer sizes - ignore the first ibuff1 and last ibuff2 pixels
ibuff1= 0
ibuff2= 0
c find first point with good data, i.e. data is not <bad or near zero
c wmin = wave(1)
imin = 1 + ibuff1
i = 1
100 continue
if (spec(i) .gt. bad) then
c wmin = wave(i)
imin = i
else if (i .eq. n) then
go to 110
else
i = i+1
go to 100
end if
110 continue
c find last point with good data by counting down
c wmax = wave(n)
imax = n - ibuff2
i=n
150 continue
if (spec(i) .gt. bad) then
c wmax = wave(i)
imax = i
else if (i .eq. 1) then
go to 160
else
i = i-1
go to 150
end if
160 continue
return
end