OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
scpar.f
Go to the documentation of this file.
1  subroutine scpar(nlines, attxfm, att_ang, attangfl,
2  1 timref, time, pos, tiltpr, tiltfl, navctl, navblk)
3 
4 c $Header: /app/shared/RCS/irix-5.2/seawifsd/src/mops/mopsV4.1/swfnav/scpar.f,v 1.1 1995/01/17 23:02:39 seawifsd Exp seawifsd $
5 c $Log: scpar.f,v $
6 c Revision 1.1 1995/01/17 23:02:39 seawifsd
7 c Initial revision
8 c
9 c
10 c scpar(nlines, attxfm, att_ang, attangfl, timref, time, navblk)
11 c
12 c Purpose: compute additional spacecraft parameters for path
13 c where attitude is provided by the spacecraft
14 c
15 c Calling Arguments:
16 c
17 c Name Type I/O Description
18 c -------- ---- --- -----------
19 c nlines I*4 I number of lines to process
20 c attxfm R*4 I size 3 by 3 by nlines attitude transform
21 c matricies
22 c att_ang R*4 I 3 by nlines array of spacecraft yaw,
23 c roll and pitch
24 c attangfl I*4 I array of flags for the attitude values
25 c timref R*8 I size 3 reference time of the start of
26 c the current segment
27 c time R*8 I size nlines time of each line in seconds
28 c past the reference time
29 c pos R*4 I size 3 spacecraft position: x, y, z
30 c tiltpr R*4 I size nlines processed tilt data
31 c for each line and for two tilt measurements
32 c tiltfl I*4 I flags for goodness of tilts 0 - good,
33 c 1 - bad but tilt assumed = 0.
34 c navctl struct I controls for navigation processing
35 c navblk struct O navigation block containing finished nav
36 c information
37 c
38 c By: W. Robinson, GSC, 29 Mar 93
39 c
40 c Notes:
41 c
42 c Modification History:
43 c
44 c Changed declaration of sec to R*8. F. S. Patt, January 12, 1995.
45 c
46 c Added rs to call to l_sun. F.S. Patt, GSC, August 15, 1996.
47 c
48 c Modified to compute sen_mat and scan_ell using zero tilt if tilt flags
49 c are set. F. S. Patt, GSC, October 9, 1996.
50 c
51 c Added initial index to some array references for Sun OS compatibility.
52 c B. A. Franz, GSC, November 14, 1997.
53 c
54 
55  implicit none
56 #include "navblk_s.fin"
57 #include "navctl_s.fin"
58 #ifdef LINUX
59 #include "nav_cnst.fin"
60 #endif
61 c
62  integer*4 nlines
63 c
64 #ifdef LINUX
65  type(navblk_struct) :: navblk(maxlin)
66 #else
67  type(navblk_struct) :: navblk(nlines)
68 #endif
69  type(navctl_struct) :: navctl
70 c
71  integer*4 attangfl(nlines), tiltfl(nlines), j
72  real*4 tiltpr(nlines)
73  real*4 attxfm(3,3,nlines), att_ang(3,nlines), pos(3,nlines)
74  real*8 timref(3), time(nlines), sec, rs
75 c
76  integer*4 ilin, iyr, iday
77 c
78 c
79 c start, loop through all the lines
80 c
81  do ilin = 1,nlines
82 c
83 c pull the local verical from the attitude transform matrix
84 c
85  navblk(ilin)%l_vert(1) = attxfm(1,1,ilin)
86  navblk(ilin)%l_vert(2) = attxfm(1,2,ilin)
87  navblk(ilin)%l_vert(3) = attxfm(1,3,ilin)
88 c
89 c get the sun ref angle relative to the earth
90 c
91  iyr = timref(1)
92  iday = timref(2)
93  sec = timref(3)
94  call ydsadd(iyr, iday, sec, 0, time(ilin) )
95  call l_sun(iyr, iday, sec, navblk(ilin)%sun_ref(1), rs )
96 c
97 c set navigation flags for bad angles or tilt
98 c
99  navblk(ilin)%nflag(7) = tiltfl(ilin)
100  navblk(ilin)%nflag(5) = attangfl(ilin)
101  if ((navblk(ilin)%nflag(5) .eq. 1) .or.
102  * (navblk(ilin)%nflag(7) .eq. 1)) then
103  navblk(ilin)%nflag(1) = 1
104  end if
105 c
106 c get the scan ellipse coefficients and sensor xfm matrix
107 c
108  call ellxfm( attxfm(1,1,ilin), att_ang(1,ilin),
109  1 tiltpr(ilin), pos(1,ilin), navctl,
110  1 navblk(ilin)%sen_mat, navblk(ilin)%scan_ell )
111 
112 c
113  do j = 1, 3
114  navblk(ilin)%att_ang(j) = att_ang(j,ilin)
115  end do
116 c
117  end do
118 c
119 c and exit
120 c
121  return
122  end
Definition: l_sun.py:1
#define real
Definition: DbAlgOcean.cpp:26
subroutine ydsadd(iy, id, sec, deld, delsec)
Definition: ydsadd.f:2
subroutine scpar(nlines, attxfm, att_ang, attangfl, timref, time, pos, tiltpr, tiltfl, navctl, navblk)
Definition: scpar.f:3
subroutine ellxfm(attxfm, att_ang, tilt, p, navctl, smat, coef)
Definition: ellxfm.f:2