X
77 Rate this article:
No rating

[INTERNAL] Testing ENVI Issues From A Customer Provided Header File

Anonym

As 'big data' becomes the norm, customers may run into issues working with ENVI data that exceed easy file sharing sizes of 8GB or less, which is the limitation on transfer.harris.com file size. Several helpful tips to still assisting the customer working on large datasets are as follows:

I. Generating Test Data From A Provided Header File

  1. Obtain an ENVI header file (e.g. customer.hdr) from the customer. Header files are smaller and thus easier to share.
  2. Open the customer.hdr in a text editor to see the needed parameters used in future steps.
  3. Open up ENVI and locate the Tool, "Generate Test Data" (Toolbox > Raster Management > Generate Test Data)
  4. Fill out the Parameters within the "Generate Image Parameters." For example:
    1. Output Image Value: This option has a drop-down menu with various options for values to fill the image raster with. Generally, the spectrral value is not the issue in errors, so pick whatever you prefer, such as going with Random (uniform) or Random (normal).
    2. Output Image Dimensions: Fill in the values from your customer.hdr file here for Samples, Lines, and Bands. Match Output Data Type to the Data Type referenced within the customer.hdr file. NOTE: Data Type may be referenced by an integer - this is a Type Code from IDL. A good reference for what these integers mean can be found here: IDL Data Types
  5. Output the Result to a file within your working directory, with a name like "test.dat" and select OK. This will create a "test.hdr" file as well.
  6. Navigate to where the "test.dat" file is located. Rename this to match the "customer.hdr" file name.
  7. Open this file within ENVI and proceed in testing!

II. Error tracking and Debugging ENVI:

In addition, having the customer run specific debugging routines and sending the output can also assist in errors working with big data. For reference, check this document - Manage Errors.

  1. For ENVI+IDL 5.X.X:
    1. Open the IDL Workbench
    2. Open ENVI from the IDL Console using: e=envi(/debug) This will provide an output to the console when an error in ENVI is hit that will point to the location of the error within the source code. 
  2. Create a debugging procedure in IDL: 

    Create a procedure: debugtest.pro
              pro debugtest

              compile_opt idl2

              ;This assumes running ENVI in headless mode:

              e = envi(/headless, /debug)

              ;You can also add:

              e = envi(/headless, /debug, log = 'C:\temp') ;outputs error to a log file within temp directory

              end

  3. Debugging ENVI+IDL Classic:
    1. Open the IDL Classic Workbench
    2. Type the following into the Console:
           envi_toggle_catch
           This is a toggled on/off catch for errors. Then run your code. This will output errors into the console and show where the code is stopping.

- Written by JB 10/18/2018