User's Guide

TRIG

Performs chosen trigonometric function on one or two input images.

Function:

Allows the user to perform the following trigonometric operations on an input image or images of any data type:


  ARCSIN_ONE  Takes the arc sine of each pixel of the 
              input image. 
  ARCSIN_TWO  Takes the arc sine of the quotient of the
              two corresponding input image pixels.
  ARCCOS_ONE  Takes the arc cosine of each pixel of the 
              input image.
  ARCCOS_TWO  Takes the arc cosine of the quotient of
              the two corresponding input image pixels.
  ARCTAN_ONE  Takes the arc tangent of each pixel of 
              the input image.
  ARCTAN_TWO  Takes the arc tangent of the quotient of 
              the two corresponding input image pixels.

The output image is a real image of radian values.

Parameters:

Subcommand -ARCSIN_ONE:
Computes the arc sine of an image. The input pixels are restricted to the -1 to +1 interval and are set to the extremes if they are outside of that range. The calculated arc sine value in radians is used for output.

IN
Input image. The input image may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4, but only pixel values between -1 and 1 will be used.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions.
Subcommand -ARCSIN_TWO:
Computes the arc sine of two images. The quotient of the pixels from the two input images is quotient is restricted to the -1 to +1 interval and is set to the extremes if it is outside of that range. If the pixel value from the second image is zero or if both pixel values are zero, the user supplied value, PIXVAL, is used for output. Otherwise, the calculated arc sine value in radians is used for output.

IN
Input images. The input images may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4. Both input images should be the same data type.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions. The image will contain one band for each band pair specified in IN.

PIXVAL(1.)
Pixel value. The pixel value to be placed in the output image when the pixel values in both input images equal zero or when the pixel value in the second image equals zero.
Subcommand -ARCCOS_ONE:
Computes the arc cosine of an image. The input pixels are restricted to the -1 to +1 interval and are set to the extremes if they are outside of that range. The calculated arc cosine value in radians is used for output.

IN
Input image. The input image may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4, but only pixel values between -1 and 1 will be used.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions.
Subcommand -ARCCOS_TWO:
Computes the arc cosine of two images. The quotient of the pixels from the two input images is restricted to the -1 to +1 interval and is set to the extremes if it is outside of that range. If the pixel value from the second image is zero or if both pixel values are zero, the user supplied value, PIXVAL, is used for output. Otherwise, the calculated arc cosine value in radians is used for output.

IN
Input images. The input images may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4. Both input images should be the same data type.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions. The image will contain one band for each band pair specified in IN.

PIXVAL(1.)
Pixel value. The pixel value to be placed in the output image when the pixel values in both input images equal zero or when the pixel value in the second image equals zero.
Subcommand -ARCTAN_ONE:
Computes the arc tangent of an image. The calculated arc tangent value in radians is used for output.

IN
Input image. The input image may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions.
Subcommand -ARCTAN_TWO:
Computes the arc tangent of two images. If the pixel from the second image is zero or if both pixels are zero, the user supplied value, PIXVAL, is used for output. Otherwise, the calculated arc tangent value in radians is used for output.

IN
Input images. The input images may be any data type, BYTE, INTEGER*2, INTEGER*4, or REAL*4.

OUT
Output image. The REAL*4 image which will contain radian values from the trigonometric functions. The image will contain one band for each band pair specified in IN.

PIXVAL(4.)
Pixel value. The pixel value to be placed in the output image when the pixel values in both input images equal zero or when the pixel value in the second image equals zero.

Examples:

  1. LAS> trig-arcsin_one in="a(1,1,30,30)" out=c

    The arc sine function is applied to each input image pixel in the window specified for image A. If the given pixel is less than -1 or greater than 1, an error is noted. If no error occurs, the resulting calculated image pixels are placed in output image C.

  2. LAS> trig-arcsin_two in="a(1,1,30,30) b(20,20,30,30)" out=c pixval=1.

    The arc sine function is applied to the quotient of the corresponding pixels from input images A and B which lie within the specified image windows. If both of the pixels are zero or the pixel value in image B is zero, the specified PIXVAL value is used for the result. If the calculated quotient was less than -1 or greater than 1, an error is noted. If no error occurs, the calculated asin value is placed in output image C.

  3. LAS> trig-arccos_one in="a(1,1,30,30)" out=c

    The arc cosine is applied to each input image pixel in the window specified for image A. If the given pixel is less than -1 or greater than 1, an error is noted. If no error occurs, the resulting calculated image pixels are placed in output image C.

  4. LAS> trig-arccos_two in="a(1,1,30,30) b(20,20,30,30)" out=c pixval=1.

    The arc cosine function is applied to the quotient of the corresponding pixels from input images A and B which lie within the specified image window. If both of the pixels are zero or the pixel value in image B is zero, the specified PIXVAL value is used for the result. If the calculated quotient was less than -1 or greater than 1, an error is noted. If no error occurs, the calculated acos value is placed in the output image C.

  5. LAS> trig-arctan_one in="a(1,1,30,30)" out=c

    The arc tangent is applied to each input image pixel in the window specified for image A. The resulting calculated image pixels are placed in the output image C.

  6. LAS> trig-arctan_two in="a(1,1,30,30) b(20,20,30,30)" out=c pixval=1.

    The arc tangent is applied to the quotient of the corresponding pixels from input images A and B which lie within the specified image window. If both of the pixels are zero or the pixel value in image B is zero, the specified PIXVAL value is used for the result. The calculated atan value is placed in output image C.

Description/Algorithm:

TRIG has six options within it to perform various trigonometric operations with image pixels. Each one generates an image on a pixel-by-pixel basis for all bands in the input image. In the one image case, the input image will be used in the calculation of:

	out = afn(x)

where out is the output image pixel value (in radians) 
      afn is the trigonometric function requested, and 
      x   is the pixel value from the input image.

For -ARCSIN_ONE and -ARCCOS_ONE, the input pixel values should be in the range of -1 to 1. If the values are outside this range, an error is reported, the negative values are reset to -1, and the positive values are reset to 1.

In the two image case, the pixels from the first image will serve as the numerator and the pixels from the second image will serve as the denominator in the calculation of:

		out = afn(rt/rt2)

where out is the output image pixel value (in radians), 
      afn is the requested trigonometric function,
      rt  is the pixel value from the first image, and
      rt2 is the pixel value from the second image.

For -ARCSIN_TWO and -ARCCOS_TWO, the quotient of rt/rt2 should be in the range of -1 to 1. If the values are outside this range, an error is reported, the negative values are reset to -1, and the positive values are reset to 1.

If both of the pixels are zero or the pixel value in the second image is zero, the specified PIXVAL value is used for the result.

Nonfatal Error Messages:

  1. [trig-information] For band nn values outside the valid range of -1 to +1: nnnn

    For an actual run the given band and number of invalid values would be listed.

  2. [trig-close] Error closing image files

    An error was encountered while trying to close a file. Contact the system manager when this error occurs.

  3. [trig-minmax] Error calculating MIN/MAX values

    The program executed successfully but some problem occurred in the calculation of MIN-MAX values. You should contact your local LAS system manager.

  4. [trig-save] MIN-MAX values were not saved

    The program executed successfully but some problem occurred in the saving of the MIN-MAX values. You should contact your local LAS system manager.

  5. [trig-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The message that is displayed immediately preceding this message is the specific error that was encountered from a library routine. Processing continues.

Fatal Error Messages:

  1. [trig-alloc] Error allocating dynamic memory

    An error occurred while trying to dynamically allocate buffer space. Contact the system manager when this error occurs.

  2. [trig-bands] Both input images must have the same number of bands

    You cannot run any of the _TWO subcommands with images that have a different number of input bands.

  3. [trig-nomnmx] Minimum and maximum values were not initialized

    This is most likely a LAS system problem. Contact your local LAS system manager.

  4. [trig-noread] Error reading image files

    The file itself may have some type of error or the access unit, (the disk), may have some internal problem. Contact your local LAS system manager.

  5. [trig-open1] First image could not be opened

    Check that you have read privileges for the image. Another user may concurrently accessing it which would lock out your access. If neither of these possibilities exists, contact your local LAS system manager.

  6. [trig-open2] Second image could not be opened

    Check that you have read privileges for the image. Another user may concurrently accessing it which would lock out your access. If neither of these possibilities exists, contact your local LAS system manager.

  7. [trig-openo] Output image could not be opened

    You may not have enough disk space to store the file. If this is not the problem, contact your local LAS system manager.

  8. [trig-window1] Input images have a different number of samples

    The number of samples of the two input images must be the same.

  9. [trig-window2] Input images have a different number of lines

    The number of lines of the two input images must be the same.

  10. [trig-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  11. [trig-group] Error grouping image files

    An error was encountered while trying to group the file. Contact the system manager when this error occurs.

User Notes:

  1. During the processing, the total number of invalid values, those not in the range of -1 to +1, found by the function for each band during execution is displayed.

  2. Though any values are valid for input in the sense that the program will not abort, clearly it does not make sense to calculate the arc sine or arc cosine of values which are pure image pixel values.