X

NV5 Geospatial Blog

Each month, NV5 Geospatial posts new blog content across a variety of categories. Browse our latest posts below to learn about important geospatial information or use the search bar to find a specific topic or author. Stay informed of the latest blog posts, events, and technologies by joining our email list!



Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

6/3/2025

Rethinking the Reliability of Type 1a Supernovae   How do astronomers measure the universe? It all starts with distance. From gauging the size of a galaxy to calculating how fast the universe is expanding, measuring cosmic distances is essential to understanding everything in the sky. For nearby stars, astronomers use... Read More >

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

5/26/2025

Whether you’re new to remote sensing or a seasoned expert, there is no doubt that large language models (LLMs) like OpenAI’s ChatGPT or Google’s Gemini can be incredibly useful in many aspects of research. From exploring the electromagnetic spectrum to creating object detection models using the latest deep learning... Read More >

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

From Image to Insight: How GEOINT Automation Is Changing the Speed of Decision-Making

4/28/2025

When every second counts, the ability to process geospatial data rapidly and accurately isn’t just helpful, it’s critical. Geospatial Intelligence (GEOINT) has always played a pivotal role in defense, security, and disaster response. But in high-tempo operations, traditional workflows are no longer fast enough. Analysts are... Read More >

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

Thermal Infrared Echoes: Illuminating the Last Gasp of a Dying Star

4/24/2025

This blog was written by Eli Dwek, Emeritus, NASA Goddard Space Flight Center, Greenbelt, MD and Research Fellow, Center for Astrophysics, Harvard & Smithsonian, Cambridge, MA. It is the fifth blog in a series showcasing our IDL® Fellows program which supports passionate retired IDL users who may need support to continue their work... Read More >

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

A New Era of Hyperspectral Imaging with ENVI® and Wyvern’s Open Data Program

2/25/2025

This blog was written in collaboration with Adam O’Connor from Wyvern.   As hyperspectral imaging (HSI) continues to grow in importance, access to high-quality satellite data is key to unlocking new insights in environmental monitoring, agriculture, forestry, mining, security, energy infrastructure management, and more.... Read More >

1345678910Last
«July 2025»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
11636 Rate this article:
No rating

ENVITask: The New ENVI 5.1 Analytics API

Anonym

ENVI 5.1 introduced a new ENVITask API for processing your data. We developed this new API with the information on how to use it built into the API and validation as you go. The first step is to query the system to learn what ENVITasks are available for you to use. This is available as the new TASK_NAMES property on the ENVI object:

IDL> nv = ENVI()
ENVI> PRINT, nv.TASK_NAMES
QUAC RPCOrthorectification RadiometricCalibration ReprojectGLT

 Once you have the task name you want, you create it using the new enviTask() function.

ENVI> oTask = ENVITask('RadiometricCalibration')
ENVI> help, oTask
oTASK          ENVIRADIOMETRICCALIBRATIONTASK <196531>

 Now that you have the task, you might be wondering how to use it. You can programmatically get information about individual parameters. You can get the list of parameters from the ParameterNames() function ,and can get a reference to one of the ENVITaskParameter objects by passing its name into the Parameter() function:

ENVI> print, oTask.ParameterNames()
CALIBRATION_TYPE INPUT_RASTEROUTPUT_DATA_TYPE OUTPUT_RASTER OUTPUT_RASTER_URI SCALE_FACTOR

ENVI> oParam = oTask.Parameter('input_raster')
ENVI> print, oParam
ENVITASKPARAMETER <196676>
CHOICE_LIST               = !NULL
DEFAULT                   = !NULL
DESCRIPTION               ='Specify an ENVIRaster object on which to perform radiometric calibration'
DIRECTION                 = 'IN'
NAME                      ='INPUT_RASTER'
REQUIRED                  = 1
TYPE                      ='ENVIRASTER'
VALUE                     = !NULL

As you can see from the print output, we give you all the information you need to construct a variable to pass in as each parameter’svalue. Aside from the parameter’s name, you get a human readable description of it, plus its IDL type, whether it is aninput or output parameter, if it’s required or optional, and its current value. Some parameters will have a default value already set for you, and some will have defined an array of allowed values in the CHOICE_LIST property. If you print on the ENVITask, you’ll get output like the above about all the parameters it owns. You don’t have to request each parameter by name to get or set its VALUE property, you can retrieve or set the values:

ENVI> print, oTask.Scale_Factor
       1.0000000000000000
ENVI> oTask.Scale_Factor= 3.0

Each time you set a parameter value, it is validated. Any values that can’t be converted to the required type or don’t match the CHOICE_LIST, if it’s defined, will give you immediate feedback so you can fix them now instead of waiting for their use halfway through a lengthy calculation. Once you’ve set all your input parameters, you call the ENVITask::Execute method to run the algorithm. Here is an example that loads a user selected raster and calibrates it to a percent reflectivity, and then loads the resulting output in a raster layer:

; load the raster
nv = ENVI()
inputFile = Dialog_Pickfile(TITLE='Select a file to calibrate')
oRaster = nv.OpenRaster(inputFile)
; load the enviTask
oTask = enviTask('RadiometricCalibration')
; Set parameters
oTask.INPUT_RASTER = oRaster
oTask.CALIBRATION_TYPE = 1 ; TOA Reflectance
oTask.SCALE_FACTOR = 100
oTask.OUTPUT_DATA_TYPE = 12 ; UInt
; run the task
oTask.Execute
; load output into layer
oView = nv.GetView()
oLayer = oView.CreateLayer(oTask.Output_Raster)

This example is a little contrived, but shows how you can easily use ENVITasks for bulk batch processing of entire collections ofdata. You don’t have to open each raster in ENVI and use the Radiometric Calibration toolbox item UI anymore, you can use FILE_SEARCH and do a FOR loop over each file in a given directory. One thing to note is that this example did not use the OUTPUT_RASTER_URI parameter at all. The ENVITasks are defined using a convention where each ENVIRaster output parameter is coupled with an input parameter, which has the same name with ‘_URI’ appended. This allows the user of the task to specify the output location and filename they want, if they want to keep the output raster. If the input URIparameter is not defined, then ENVITask will generate a temporary file. Furthermore, it will delete the temporary file when ENVI shuts down. This way if you want to chain multiple ENVITasks together you don’t have to worry about cleaning up intermediate products.

In ENVI 5.1 we released just a few ENVITasks, however look for many more ENVITasks in future releases.

Please login or register to post comments.