IDL ENVI: save the Radiometric in different interleave formats (BIL, BIP)

104 views
Skip to first unread message

rueg

unread,
Apr 12, 2018, 8:52:45 AM4/12/18
to idl-pvwave
Dear all,
Iam new to the IDL and I used it in ENVI to perform the  Radiometric Calibration.

By using the tool in GUI there is an option to choose from the Output Interleave formats (BSQ, BIL, BIP). However using IDL the option of Interleave formats is not valid.
Can somebody help me and explain what I should do to have the output in BIL or BIP interleaves?

Here is the example code taken from the ENVI web:

e=envi()
Task1=ENVITask(´RadiometricCalibration´)

File = Filepath('qb_boulder_msi', Subdir=['data'], $
   Root_Dir=e.Root_Dir)

Raster = e.OpenRaster('c:temp\r1.tif'')

Task1 = ENVITask('RadiometricCalibration')
Task1.Input_Raster = Raster
Task1.Output_Raster_URI = ('c:temp\t1_rad.tif')
Task1.Execute



Now how I can the  ENVITask(´RadiometricCalibration´) to save the raster in BIL, or BIP format (BSQ is the default)?

Best,
Rob

markus.sc...@gmail.com

unread,
Apr 12, 2018, 12:31:10 PM4/12/18
to idl-pvwave
 I don't know whether that's your problem, but aren't your paths missing a \:
c:\temp\...

Brian G

unread,
Apr 12, 2018, 3:01:30 PM4/12/18
to idl-pvwave
Rob -
  The RadiometricCalibration task will maintain the interleave of the input raster, to avoid performance-degrading data rotations.
Since you appear to be writing your own code, and aren't using only the UI, there is an alternative available to you for headless batch processing.  The ENVICalibrateRaster (http://www.harrisgeospatial.com/docs/envicalibrateraster.html) is a virtual raster that gives you the same results.  The virtual raster will inherit the interleave from its source raster, but you can create one of these rasters and then call ENVIRaster::Export to specify a different interleave.
  So your code becomes:

e = envi()

raster = e.OpenRaster('c:temp\r1.tif'')

calRaster = ENVICalibrateRaster(raster, DATA_TYPE='double')

calRaster.Export, 'c:temp\t1_rad.tif', 'ENVI', INTERLEAVE='bip'

outputRaster = e.OpenRaster('c:temp\t1_rad.tif')


cheers,
Brian J Griglak
IDL Technical Lead
Reply all
Reply to author
Forward
0 new messages