OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
satang.f
Go to the documentation of this file.
1  subroutine satang(pi,rad,tilt,roll,pitch,yaw,xlon,ylat,senz,
2  *sena)
3 c
4 c Given lons and lats and nominal satellite info, computes
5 c satellite (sensor) zenith and azimuth angles
6 c
7  implicit real*8 (a-h,o-z)
8  parameter(npix=1968)
9  parameter(re=6378.0,hs=955.0)
10  parameter(altcor=(re+hs)/re)
11  real*4 xlon(npix),ylat(npix)
12  real*4 senz(npix),sena(npix)
13  real*4 tilt,roll,pitch,yaw
14  data xinclp /9.28/
15  data difov /0.04/ !IFOV in degrees
16 c
17 c Satellite ground point (sub-satellite point)
18  xnu = 0.0 - 10.0*difov !stay a litle off center to keep precision
19  ip = npix/2 - 10
20  call subsat(pi,rad,ylat(ip),xlon(ip),xinclp,altcor,tilt,xnu,
21  * pitch,roll,yaw,ylats,xlons)
22  rinclp = xinclp/rad
23  rlats = ylats/rad
24 c
25 c Compute satellite zenith and azimuth
26  do ip = 1,npix
27  xnu = -39.36 + 0.04*float(ip)
28  call czsuba(rad,altcor,tilt,xnu,pitch,roll,yaw,rpsi,rths,rth)
29 c
30 c Calculate the true bearing from north to pixel
31  tmp = sin(rinclp)/cos(rlats)
32  tmp1 = min(tmp,1.0d0)
33 c rinclo = asin(sin(rinclp)/cos(rlats))
34  rinclo = asin(tmp1)
35  if (rinclo .gt. rpsi)then
36  rpsip = 2.0*pi + (rpsi - rinclo)
37  else
38  rpsip = rpsi - rinclo
39  endif
40  ssca = rpsip*rad
41 c
42 c Re-orient spacecraft azimuth with respect pixel
43  rlatp = ylat(ip)/rad
44  if (abs(rth) .gt. 1.0e-4)then
45  cosca = (sin(rlats)-cos(rth)*sin(rlatp))/(sin(rth)*cos(rlatp))
46  eps = abs(cosca)
47  if (eps .ge. 1.1)then
48 c write(6,*)'Error in acos argument in azimuth'
49 c write(6,*)'argument = ',cosca
50  if (cosca .lt. 0.0)cosca=-1.0
51  if (cosca .gt. 0.0)cosca=1.0
52  else if (eps .gt. 1.0)then
53  if (cosca .lt. 0.0)cosca=-1.0
54  if (cosca .gt. 0.0)cosca=1.0
55  endif
56  sca = acos(cosca)*rad
57  if (ssca .le. 180.0)sca = 360.0 - sca
58  else
59 c if (rpsi .lt. pi)sca = rpsip*rad+180.0
60 c if (rpsi .ge. pi)sca = rpsip*rad-180.0
61  if (rpsi .lt. pi)sca = 180.0
62  if (rpsi .ge. pi)sca = 0.0
63  endif
64  sena(ip) = sca
65 c
66 c Calculate spacecraft zenith angle
67 c re and Hs are Earth radius and satellite altitude
68  r = altcor*sin(abs(rths))
69  temp = asin(r)
70  senz(ip) = temp*rad
71  enddo
72 c
73  return
74  end
#define real
Definition: DbAlgOcean.cpp:26
subroutine satang(pi, rad, tilt, roll, pitch, yaw, xlon, ylat, senz, sena)
Definition: satang.f:3
README for MOD_PR03(V6.1.0) 2. POINTS OF CONTACT it can be either SDP Toolkit or MODIS Packet for Terra input files The orbit validation configuration parameter(LUN 600281) must be either "TRUE" or "FALSE". It needs to be "FALSE" when running in Near Real Time mode
subroutine czsuba(rad, altcor, tilt, xnu, pitch, roll, yaw, rpsi, rths, rth)
Definition: czsuba.f:3
#define re
Definition: l1_czcs_hdf.c:701
#define min(A, B)
Definition: main_biosmap.c:62
#define pi
Definition: vincenty.c:23
subroutine subsat(pi, rad, ylatp, xlonp, xinclp, altcor, tilt, xnu, pitch, roll, yaw, ylats, xlons)
Definition: subsatxy.f:3
#define abs(a)
Definition: misc.h:90