This function method returns a reference to an IDLParameter* or ENVIParameter* object with the requested name. You can then query the task parameter to learn more about it, including the rules (constraints) for defining it.

Example


Suppose that you wanted to know more information about the scale factor property for the RadiometricCalibration task, including the rules (constraints) for defining this property.

  1. Copy and paste the following code into the IDL command line.
  2. ; Start the application
    e = ENVI()
     
    ; Open an input file
    file = FILEPATH('qb_boulder_msi',SUBDIR=['data'], $
       ROOT_DIR=e.root_dir)
    raster = e.OpenRaster(file)
     
    ; Define gains and offsets for a QuickBird file saved
    ; to ENVI format
    gains = [0.21044118, 0.10555556, 0.13633803, 0.13754386]
    offsets = [0.0, 0.0, 0.0, 0.0]
    metadata = raster.METADATA
    metadata.AddItem,'data gain values', gains
    metadata.AddItem,'data offset values', offsets
     
    ; Create the RadiometricCalibration task
    task = ENVITask('RadiometricCalibration')
  3. If you already know that SCALE_FACTOR is the correct property name, you can check its current setting as follows:
  4. print, task.SCALE_FACTOR

    Or, type the following commands if you are unfamiliar with the properties of a given task and want to learn more about their rules and settings:

    props = task.ParameterNames()
    print, props

    You can see that scale_Factor is the proper string for the scale factor property. You could also issue a PRINT command on the task itself to see all properties for that task and their rules/settings.

  5. Create an object reference to the scale_Factor property and print its properties/parameters:
  6. scaleFactorRules = task.parameter('scale_Factor')
    print, scaleFactorRules

You can see that the default value is 1.0, and the current setting is also 1.0. It is not a required property, but if you set it to a data type other than double-precision floating-point, IDL will cast it to a double-precision floating-point value. See the IDL Help for more information about data type casting.

Syntax


Result = ENVITask.Parameter('TaskProperty' [, ERROR=variable])

Arguments


TaskProperty

Specify a string with the property name for the given ENVITask. Use the following code to print a list of parameter names for a task:

task = ENVITask('TaskName')
props = task.ParameterNames()
print, props

Keywords


ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

Version History


ENVI 5.1

Introduced

ENVI 5.4.1

Returns a reference to an IDLParameter* or ENVIParameter* object, instead of using ENVITaskParameter (which has been deprecated)

API Version


4.2

See Also


ENVITask, ENVI Parameter Classes