| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Algorithm :: Related |
| Back to top |
| Back to top |
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILE * | String | Input file name | 1 - 192 | |
| DBIC * | Integer | Input elevation channel or layer | 1 - 1 | |
| DBOC * | Integer | Output channel | 1 - 1 | |
| PXSZ | Float | Pixel ground-size, in meters | 0 - 2 | 0.0 - Default: 30 |
| ELSZ | Float | Elevation step size, in meters | 0 - 1 | Default: 1 |
| LSRC * | Float | Light source location | 3 - 3 |
| Back to top |
FILE
Specifies the name of the PCIDSK file containing the elevation data for angle of incidence analysis.
DBIC
Specifies the input channel or layer that contains the elevation data.
DBOC
Specifies the output channel that will receive the Angle of Incidence image.
PXSZ
Specifies, in meters, the x and y dimensions of one pixel on the ground. If the dimensions are not specified, ANG uses the pixel size stored in the database header. Correct calculation of the angle of incidence depends on proper specification of this value.
ELSZ
Specifies, in meters, the elevation corresponding to one gray level. A change of 1 gray level in the elevation image corresponds to a change in elevation of ELSZ (Elevation Step) meters. Correct calculation of the angle of incidence depends on proper specification of this value.
LSRC
Specifies the azimuth angle, elevation angle, and distance to the point light source, relative to the top-left corner of the image. This parameter is the straight-line measurement from 0.0 to the light source.
When the illumination source is solar, the variation in sun-to-earth distance in most applications of ANG is insignificant, so a nominal or average distance value can often be used; for example, 9 290 000 miles or 149 476 000 km.
When the illumination source is non-solar, the angle between a ray from a point source and the surface normal can vary over the ground extent of a DEM even if the surface is perfectly flat. The range of this angle variation for a given ground extent decreases as the distance between the point source and the surface increases.
LSRC = Aang, Eang, D
where:
Aang: specifies the azimuth angle, which can be any non-negative number. Values greater than 359 degrees are treated as MOD(360).
Eang: specifies the elevation angle. This value must be a real number between 0 and 90 degrees.
D: specifies the distance, in kilometers. This value can be any non-negative real number.
| Back to top |
ANG uses a specified elevation channel as input to calculate incidence angles between a user-selected point light source and the surface normal for each pixel of the input channel. The output image contains angles, which range from 0 to 90 degrees.
Assuming a line is drawn connecting the point source to the top-left pixel of the image, the azimuth angle is the azimuth of the line in degrees clockwise from north (top of the image); the elevation angle is the elevation of the line in degrees from the horizontal; the distance is the length of this line in kilometers; that is, the distance from a zero elevation point at the top-left corner of the image (0,0) to the point source.
Correct calculation of incidence angles is dependent on the proper specification of ELSZ (Elevation Step Size) and PXSZ (Pixel X Size, Pixel Y Size). If unspecified, ELSZ is set equal to one. If PXSZ is not specified, ANG uses the pixel size stored in the database header.
The angle of incidence at a point is calculated as the angle between a point on the surface and the line connecting this point to the point light source. Output angle values will be in the range of 0 to 90 degrees. See the Algorithm section for more information.
| Back to top |
This example calculates an angle of incidence image using 16-bit elevation data from channel 10 of the file irvine.pix and places the output in channel 7. Each pixel in the image represents a projected ground area of 30 meters by 30 meters, and each increment in the gray level of the elevation image corresponds to the default elevation change of 1 meter. The point source is 75 degrees east of the top-left corner of the image, with an elevation angle of 35 degrees and a distance of 4.5 km.
EASI>FILE="irvine.pix" EASI>DBIC=10 EASI>DBOC=7 EASI>PXSZ=30,30 EASI>ELSZ= EASI>LSRC=75,35,4.5 EASI>RUN ANG
Run NUM to print out a portion of the input image (elevation) and the output image (angle of incidence).
Terminal Listing:
NUM Database Image Numeric Window
IRVINE.PIX;1 [S 6PIC 512P 512L]
10 [16S]: C8TO16
Offset: ( 459, 49) Size: ( 10, 10)
460 461 462 463 464 465 466 467 468 469
+------------------------------------------------------------
50| 567 577 586 598 613 623 624 618 607 590
51| 559 568 578 598 621 635 636 634 625 609
52| 558 568 578 596 616 630 636 640 633 619
53| 558 569 579 594 611 625 637 646 642 630
54| 561 573 579 588 604 619 632 642 643 637
55| 564 577 579 583 597 613 628 638 644 644
56| 575 586 587 590 602 615 630 642 647 645
57| 587 595 596 598 608 618 633 646 650 647
58| 600 608 612 616 625 634 643 648 646 636
59| 614 622 628 635 643 650 654 651 642 626
NUM Database Image Numeric Window
IRVINE.PIX;1 [S 6PIC 512P 512L]
8 [ 8U]: ANG Angle of incidence from elevation channel 10
Offset: ( 459, 49) Size: ( 10, 10)
460 461 462 463 464 465 466 467 468 469
+------------------------------------------------------------
50| 24 22 25 34 35 24 10 1 0 0
51| 24 25 34 44 42 25 12 5 0 0
52| 27 29 35 41 36 25 20 10 0 0
53| 30 30 33 35 33 30 28 15 0 0
54| 31 29 24 29 32 31 28 18 6 0
55| 32 27 18 27 35 36 31 25 17 0
56| 31 25 18 27 35 36 35 27 14 0
57| 30 23 18 26 32 35 37 27 11 0
58| 29 26 23 27 31 31 27 14 0 0
59| 28 26 26 27 27 23 12 0 0 0
| Back to top |
LSRC, PXSZ, and ELSZ are user-defined parameters.
Light Source Location, Pixel Ground Size, and Elevation Step Size are user-defined parameters.
Convert the azimuth angle, elevation angle, and distance values to a cartesian coordinate position (lx,ly,lz) in meters.
lx = sin(azimuth angle) * cos(elevation angle) * distance*1000 ly = -cos(azimuth angle) * cos(elevation angle) * distance*1000 lz = sin(elevation angle) * distance*1000
For each pixel p = (px,py,pz), define px,py as the pixel/row location and pz as the elevation. The immediate neighbors of p are a,b,c,and d, where a=(px,py-1,az), b=(px-1,py,bz), etc.
. a .
b p c
. d .
Define two vectors, V1 and V2, across the pixel in question:
V1 = (dx,0,dzx) = (2*PXSZ(1),0,(bz-cz)*ELSZ) (left to right) V2 = (0,dy,dzy) = (0,2*PXSZ(2),(az-dz)*ELSZ) (top to bottom)
where dzx and dzy are the elevation changes between pixels, and dx and dy are the projected distances between pixels. PXSZ and ELSZ are user-specified parameters giving pixel ground size and elevation sizes. dx and dy will be twice the actual pixel ground size because the elevation differences (or gradients) are taken over 2-pixel distances.
Find the normal vector to the plane formed by the two vectors V1 and V2, by taking the cross product:
N = V1 X V2 = (-dy*dzx, -dx*dzy, dx*dy) = (nx, ny, nz).
Find the vector connecting the current pixel p with the point light source by subtracting the coordinates of the pixel (shifted so that the top left corner (1,1) has the co-ordinates (0,0)) from the light source vector:
(rlx,rly,rlz) =
(lx,ly,lz) - ((px+2)*PXSZ(1), (py+2)*PXSZ(2), pz*ELSZ)
The cosine of the angle between two vectors is the dot product of the vectors divided by the sum of their magnitudes:
cos(ang) = (nx*rlx + ny*rly + nz*rlz) /
(sqrt(nx**2+ny**2+nz**2)*sqrt(rlx**2+rly**2+rlz**2))
The angle that the vector from the light source forms with the surface will be the complement of the angle that it forms with the normal vector, calculated by taking the arcsin of cosine of the angle with the normal vector, as calculated in step 4. Any values outside the range 0 to 90 (indicating that light will not strike the surface) are set to 0.
POINT LIGHT *)
SOURCE \
\ i = local incidence angle
\
\
\
\
\
i \
+------------------------+
SURFACE
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.