1 subroutine attcmp(nlines, gaclac, tlm, pos, vel, timref,
2 1 time, navctl, navqc, attxfm, navblk, tiltpr, tiltfl)
84 #include "tlm_str.fin"
85 #include "navctl_s.fin"
86 #include "navqc_s.fin"
87 #include "navblk_s.fin"
95 integer*4 nlines, gaclac, isens
96 real*4 pos(3,nlines), vel(3,nlines), attxfm(3,3,nlines)
97 real*8 timref(3), time(nlines)
99 integer*4 ilin, i, l, sunbodfl(maxlin), nadbodfl(maxlin), year,
100 1 day, delday, tiltfl(maxlin), widphfl(maxlin,2)
101 real*4 sun_bod(3,maxlin), nad_bod(3,maxlin), tiltpr(maxlin),
102 1 widphse(2,maxlin,2), yaw_lim, covar(3), delta_t,
103 1 att_prev(3), covpass1(3,maxlin), maxcov
106 data yaw_lim/6.0/, att_prev/3*0.0/, maxcov/1.0e-6/
110 call suncomp( tlm, time, nlines, gaclac, navqc, navctl,
111 1 sun_bod, sunbodfl )
114 if (navctl%lvdbug.gt.1)
then
115 open(unit=21,file=
'sun_bod.out',status =
'unknown')
117 write(21,1200)(sun_bod(isens,ilin),isens=1,3),
119 1200
format(2x,3f12.7,i7)
126 call earcomp(tlm, time, pos, vel, nlines, gaclac, navqc,
127 1 navctl, nad_bod, nadbodfl, widphse, widphfl )
131 call tiltcomp( nlines, tlm, timref, time, gaclac, navqc,
151 call ydsadd( year, day, sec, delday, time(ilin) )
153 call l_sun( year, day, sec, navblk(ilin)%sun_ref(1), rs )
157 navblk(ilin)%l_vert(1) = attxfm(1,1,ilin)
158 navblk(ilin)%l_vert(2) = attxfm(1,2,ilin)
159 navblk(ilin)%l_vert(3) = attxfm(1,3,ilin)
163 if( (widphfl(ilin,1).ne.0) .and. (widphfl(ilin,2).ne.0))
then
164 navblk(ilin)%nflag(4) = 1
167 if( sunbodfl(ilin) .ne. 0 )
then
168 navblk(ilin)%nflag(3) = 1
171 if( navblk(ilin)%nflag(2) .eq. 0 )
then
177 delta_t = time(ilin) - time(ilin-1)
180 call attdet(navblk(ilin), navctl, nad_bod(1,ilin),
181 1 attxfm(1,1,ilin), pos(1,ilin), vel(1,ilin),
182 1 widphse(1,ilin,1), widphfl(ilin,1), widphse(1,ilin,2),
183 1 widphfl(ilin,2), sun_bod(1,ilin), sunbodfl(ilin),
184 1 att_prev, delta_t, covar)
188 att_prev(i) = navblk(ilin)%att_ang(i)
189 covpass1(i,ilin) = covar(i)
196 if ((covar(1).ge.maxcov).or.
197 1 (
abs(navblk(nlines)%att_ang(1)).gt.yaw_lim))
then
198 navblk(nlines)%nflag(8) = 1
199 navblk(nlines)%nflag(5) = 1
208 if( navblk(ilin)%nflag(2) .eq. 0 )
then
211 navblk1%sun_ref(i) = navblk(ilin)%sun_ref(i)
213 delta_t = time(ilin) - time(ilin+1)
215 call attdet(navblk1, navctl, nad_bod(1,ilin),
216 1 attxfm(1,1,ilin), pos(1,ilin), vel(1,ilin),
217 1 widphse(1,ilin,1), widphfl(ilin,1), widphse(1,ilin,2),
218 1 widphfl(ilin,2), sun_bod(1,ilin), sunbodfl(ilin),
219 1 att_prev, delta_t, covar)
222 att_prev(i) = navblk1%att_ang(i)
227 navblk(ilin)%att_ang(i) =
228 1 ( navblk(ilin)%att_ang(i)*covar(i) +
229 1 navblk1%att_ang(i)*covpass1(i,ilin)) /
230 1 (covar(i) + covpass1(i,ilin))
231 covpass1(i,ilin) = 1./(1./covpass1(i,ilin) +
238 if ((covpass1(1,ilin).ge.maxcov).or.
239 1 (
abs(navblk(ilin)%att_ang(1)).gt.yaw_lim))
then
240 navblk(ilin)%nflag(8) = 1
241 navblk(ilin)%nflag(5) = 1
248 if (navctl%lvdbug.gt.1)
then
249 open(unit=21,file=
'nad_bod.out',status =
'unknown')
251 if ((widphfl(ilin,1).ne.0) .and. (widphfl(ilin,2).ne.0))
then
256 write(21,1200) (nad_bod(isens,ilin),isens=1,3),
266 navblk(ilin)%nflag(7) = tiltfl(ilin)
267 if ( tiltfl(ilin) .eq. 1)
then
268 navblk(ilin)%nflag(1) = 1
269 else if ( tiltfl(ilin) .eq. 2)
then
270 navblk(ilin)%nflag(8) = 1
273 call ellxfm( attxfm(1,1,ilin), navblk(ilin)%att_ang(1),
274 1 tiltpr(ilin), pos(1,ilin), navctl,
275 1 navblk(ilin)%sen_mat(1,1), navblk(ilin)%scan_ell(1) )