X
75 Rate this article:
No rating

Internal: How to open Mars PDS THEMIS .qub data in ENVI

Anonym
Although Mars PDS THEMIS .qub data cannot be opened automatically in ENVI 4.1, there is a simple way to set the image header parameters and view your image. Please follow these instructions in order to open and view the image in ENVI.

The image parameters that you need to enter manually in ENVI are embedded in the header of the THEMIS data. If you are on a Windows machine, you will need to view the header information in a text editor (for example, Notepad or Wordpad). If you are on a UNIX machine, you can use the commands "less filename.qub" or "cat filename.qub | more" to view the necessary text.


Once you are looking at the header information of the .qub file, scroll down until you see the section entitled:


    OBJECT = SPECTRAL_QUBE

    /* QUBE Structure */

    AXES = 3
    AXIS_NAME = (SAMPLE, LINE, BAND)

    /* Core Description */

    CORE_ITEMS = (320, 7184, 10)
    CORE_NAME = "CALIBRATED_SPECTRAL_RADIANCE"
    CORE_ITEM_BYTES = 2
    CORE_ITEM_TYPE = SUN_INTEGER

The primary field you need to note is:

(1) CORE_ITEMS is a three-element array that corresponds to the image's number of samples, lines, and bands (as referenced in the AXIS_NAME field). In this example, this image has 320 samples, 7184 lines, and 10 bands.


You also may need to note:

(2) CORE_ITEM_BYTES corresponds to the the data type. A value of "2" here equals 2-byte integer data. A value of "1" would denote byte data.

(3) CORE_ITEM_TYPE corresponds to the byte storage of the data. Sun (IEEE) machines are "Big Endian" machines, meaning that multiple byte integers are stored in memory beginning with the most significant byte. But Windows (Intel) machines are "Little Endian", meaning that multiple byte integers are stored in memory beginning with the least significant byte. You may also see this field set to MSB_INTEGER. MSB stands for "most significant byte." In the example here, you would set the byte order to IEEE in the ENVI header dialog.

    If you have access to the IDL command line, an easy way to determine the byte ordering for your system is to issue the following command from the IDL prompt:

    print,'This machine is: ', byte(1,0)?'little endian':'big endian'


    For example:

    ENVI> print, !version
    { x86 Win32 Windows Microsoft Windows 6.1 Jul 14 2004 32 64}
    ENVI> print,'This machine is: ', byte(1,0)?'little endian':'big endian'
    This machine is: little endian

How to open in ENVI:

1. Select File->Open Image File and select your .qub filename.


2. You will see a dialog box that says that your image appears to not contain any image data. Please just click "ok."


3. The ENVI Header Info dialog box will pop up. Here, you will need to enter your sample, lines, and band data. Additionally, you can edit the Data Type and Byte Order if necessary.


4. Click OK.


5. View the image in ENVI to make sure that it looks "correct." If any of the parameters were entered incorrectly, the image will usually look obviously "incorrect". For example, the image may look like a checkerboard pattern or noise, instead of an actual image. Please re-check the parameters that need to be entered into ENVI to make sure that they are correct. You may also need to enter the CORE_ITEM_BYTES and CORE_ITEM_TYPE.


6. If you need to make further adjustments to the header information of this image, go to File->Edit ENVI Header and select the image. Once these parameters have been entered, ENVI will create a header file (.hdr) that is associated with the .qub data. Provided that you have the .qub and .hdr files together, ENVI will be able to automatically open that same image the second time around.


For additional information on the field definitions in the THEMIS data header, please see the PDS Data Dictionary Lookup table
here.

This Help Article is a workaround for CR # 38423.

 

Update:

Two .pds readers are available in the ENVI Code Library.  Please note:  All examples in the Code Library are not supported by Exelis Visual Information Solutions.

http://www.exelisvis.com/Default.aspx?tabid=1540&id=1304

http://www.exelisvis.com/Default.aspx?tabid=1540&id=1198