This method returns the index of the raster whose TIME property is closest to what you specify. If the value you specify is exactly in the middle of two candidates, the method returns the index that is ordered first in the series.


; Start the application
; Locate a raster series file
seriesFile = Filepath('AirTemp.series', Subdir=['data','time_series'], $
  Root_Dir = e.Root_Dir)
; Create a raster series object
series = ENVIRasterSeries(seriesFile)
; Print the contents of the series file
Print, series
; Find the raster whose acquisition date is closest to
; 30 December at 08:00.
Result = series.Query('2012-12-30T08:00:00Z', 'TIME')
PRINT, Result

IDL prints:


The raster that corresponds to index #5 has an acquisition time of 2012-12-30T06:00:00Z. This is the closest match to the specified value.


Result = ENVIRasterSeries.Query(Value, Key [, Keywords=value])


Value (required)

Specify a string value for the Key argument.

Key (required)

Specify a metadata field to search. Surround it with double quotes. TIME and URI are the only currently supported keys. Use an implied PRINT statement to print a list of available acquisition times and URIs:



Keywords are applied only during the initial creation of the object.


Set this keyword to retrieve a value that is exactly what you specify. If no values are found, the method returns !NULL.


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.


Set this keyword to retrieve the next value in the series that is greater than what you specify.


Set this keyword to retrieve the next value in the series that is less than what you specify.

Version History

ENVI 5.2


API Version


See Also

ENVIRasterSeries, ENVIRaster