angles - Computes satellite and solar viewing angles.

SYNOPSIS

angles  [ parameter=value ... ]  [ inputfile ... ]

Parameters are latitude, longitude, sat_zenith, sun_zenith, scatter_phase, sun_reflection, rel_azimuth, time, julian_day, land_mask, store_cosines, real_output, poly_size.

DESCRIPTION

angles computes per-pixel latitude, longitude, and five satellite and solar viewing angles: satellite zenith, solar zenith, scattering phase, solar reflection angle, and relative azimuth. Optionally, angles can compute GMT time, julian day, or land mask flag.

  1. The satellite zenith angle, sat_zenith, is the angle between the satellite and a line perpendicular to the Earth's surface at the view point (angle 1 in diagram below).


  1. The solar zenith angle, sun_zenith, is the angle between the sun and a line perpendicular to the Earth's surface at the view point (angle 2 in diagram below).


  1. The scattering phase angle, scatter_phase, is the angle at the view point between vectors pointing toward the sun and the satellite (angle 3 in diagram below).


  1. The solar reflection angle, sun_reflection, is the angle at the view point between vectors pointing toward the satellite and the sun's specular reflection (angle 4 in diagram below).


  1. The relative azimuth angle, rel_azimuth, is the angle between sun and satellite vectors projected on a plane tangent to the Earth's surface.


                                             satellite
          normal                                 |       solar
satellite   |       sun             sun          |    reflection
   \        |        /                  \        |        /
    \       |       /                    \       |       /
     \      |      /                      \      |      /
      \     |     /                        \     |     /
       \    |    /                          \    |    /
        \ 1 | 2 /                            \ 3 | 4 /
         \  |  /                              \  |  /
          \ | /                                \ | /
 __________\ /___________             __________\ /___________
 ------------------------            ------------------------


  1. time is the sensor scan time (GMT, in seconds). time does not wrap around to zero when it exceeds 24*60*60 (86400) seconds.


  1. julian_day is the fractional julian day, ranging between 0 and the number of days in the current year. julian_day does wrap around to zero at the end of a given year.


  1. land_mask is a boolean flag; one if land, zero if not land.


One or more TeraScan datasets are allowed for input. There are no output TeraScan datasets. This function appends the results to the end of the input datasets.

Angles can be output in degrees or as cosines. In both cases, angles are stored as either scaled short (16-bit) integers or unscaled (32-bit) reals. For output in degrees, the scale factor is .01. For output as cosines, the scale factor is .0001.

time is always output using the same datatype as angles, either scaled short integers or reals. The scale factor for short integer output is .1 seconds. The scale factor for real output is 1.. The scale offset for both cases is defined by the start_time attribute.

julian_day is always output using the same datatype as angles, either scale short integers or reals. The scale factor for short integer output is .02 days. The scale factor for real output is 1.. The scale offset for both cases is 0..

land_mask is always output as byte data.

PARAMETERS

latitude
 
Enter yes to compute pixel latitude, no otherwise. The default is yes.
 
longitude
 
Enter yes to compute pixel longitude, no otherwise. The default is yes.
 
sat_zenith
 
Enter yes to compute the satellite zenith angle. If U is a unit vector normal to a pixel and T is the unit vector pointing from the pixel to the satellite, the satellite zenith angle is defined as:

arccos (U dot T)

Valid responses are yes and no. The default is yes.

sun_zenith
 
Enter yes to compute the solar zenith angle. If U is a unit vector normal to a pixel and S is the unit vector pointing from the pixel to the sun, the solar zenith angle is defined as:

arccos (U dot S)

Valid responses are yes and no. The default is yes.

scatter_phase
 
Enter yes to compute the scattering phase angle. If T is a unit vector pointing from a pixel to the satellite, and S is the unit vector pointing from the pixel to the sun, the scattering phase angle is defined as:

arccos (S dot T)

Valid responses are yes and no. The default is yes.

sun_reflection  

Enter yes to compute the solar reflection angle. If T is a unit vector pointing from a pixel to the satellite, and R is a unit vector pointing from the pixel in the direction of solar reflection, then the solar reflection angle is defined as:

arccos (R dot T)

Valid responses are yes and no. The default is yes.

rel_azimuth

Enter yes to compute the relative azimuth between the unit vector pointing from a pixel to the satellite, and the unit vector pointing from a pixel to the sun.
 
Valid responses are yes and no. The default is yes.
 
time
 
This parameter is optional. Enter yes to compute the GMT time (in seconds) for each image pixel.
Valid responses are yes and no. The default is no.
 
land_mask
 
This parameter is optional. Enter yes to compute the land mask flag for each image pixel.
Valid responses are yes and no. The default is no.
 
store_cosines
 
angles can either return the viewing angles, or the cosines of the angles. Enter yes to store angles as cos(angle) or no to store the angles in degrees.
 
Valid responses are [yes, no]. The default is yes.
 
real_output
 
Enter yes to store angles as reals. Enter no to store angles as short integers. The default is yes.
 
poly_size
 
This function speeds up the computation process by using piecewise polynomial interpolation. The input image is divided up into nearly square regions, each of which is covered by its biquadratic polynomial. A region's polynomials are determined by computing angles exactly from satellite ephemeris at 9 points in the region.
 
Specify the width of these regions in kilometers.
 
Valid range is [>= 1]. The default is 100.
 
 

EXAMPLES

Compute the satellite viewing angles for the TeraScan dataset named big.

[1] % angles
input file(s)  : char(75) ? big
sat_zenith     : char( 3) ? [yes]
sun_zenith     : char( 3) ? [yes]
scatter_phase  : char( 3) ? [yes]
sun_reflection : char( 3) ? [yes]
rel_azimuth    : char( 3) ? [yes]
store_cosines  : char( 3) ? [yes]
real_output    : char( 3) ? [yes] no
poly_size      : real     ? [100]

[2] % contents big

printout       : char( 3) ? [no]

Dimension       Size     Coord         Scale     Offset
 line            1199      y               1          0
 sample          1410      x               1          0

Attribute       Type     Units            Value
  history        byte                      1 2 3 4 5
  projection     long     std_projection   sensor_scan
  et_affine      double                    1 0 0 1 -67 -367
  satellite      byte                      noaa-9
  sensor         long     std_sensor       avhrr
  pass_date      long     std_date         88/09/13
  start_time     double   std_time         21:18:22.6
  time_adjust    double   std_time         00:00:00
  attitude       double   degrees          0 0 0
  sensor_tilt    double   degrees          0
  scan_samples   long                      2048
  scan_rates     double                    6 40000 37.6991
  sensorient     double   degrees          0 45 0 55.3 -55.3
  orb_elem_date  long     std_date         88/09/13
  orb_elements   double               0.476962 0.828252 4e-05 0.001585
                                         0.0363905 0.669068 0.275306
  history        byte

Variable         Type           Units
  hrpt_header     short
  avhrr_ch1       short          raw_counts
  avhrr_ch2       short          raw_counts
  avhrr_ch3       short          raw_counts
  avhrr_ch4       short          raw_counts
  avhrr_ch5       short          raw_counts

Variable         Dimension      Size
  hrpt_header     line            611
  hrpt_header     dim_2           103
  avhrr_ch1       line            611
  avhrr_ch1       sample          637
  avhrr_ch2       line            611
  avhrr_ch2       sample          637
  avhrr_ch3       line            611
  avhrr_ch3       sample          637
  avhrr_ch4       line            611
  avhrr_ch4       sample          637
  avhrr_ch5       line            611
  avhrr_ch5       sample          637

FILES

orbdata, sensorfile

SEE ALSO

master

NOTES

The scale factor of .1 seconds for short integer time output was chosen so that the effective data range was +/- 50 minutes from the scale offset. This accomodates half orbit datasets from polar orbiting satellites.

The scale factor of .02 days for short integer julian_day output corresponds roughtly to steps of one-half hour. This rather coarse step size was chosen to accomodate wrapping around to zero at year's end.