Center for Earth Observation

...supporting the remote sensing needs of the University

How to import Sentinel 2 data into ENVI

Once you have extracted the Sentinel 2 data and renamed the initial data folder as described in the previous FAQ, you are ready to import these data into ENVI.  As mentioned earlier, data with an Entity ID of S2A_OPER can be opened in ENVI 5.3.x and data with an Entity ID of L1C_T requires ENVI version 5.4 which is not installed on the YCEO Lab systems yet.  You can open these data using the ESA Sentinel tool kit.

S2A_OPER format:

From the main ENVI menu select File | Open As | Optical Sensors | Sentinel 2.  Navigate into the new folder and select the XML file.  This will also be a very long filename such as:
S2A_OPER_MTD_SAFL1C_PDMC_20160613T000058_R084_V20160612T181447_20160612T181447.xml

ENVI should open the data into files based on spatial resolution.  You can examine the data and save the file to ENVI format if you wish to use these data in the future.  From the ENVI main menu select File | Save As | ENVI Standard.  Save this file to a new folder structure for your project; it should not be placed in any of the original Sentinel folders.  Consider including 10m or 20m as part of the filename to distinguish the resolution.

In some cases ENVI will generate an error message such as: 
       File: S2A_OPER_MSI…..  File does not appear to be a valid JPEG2000 file
This message is generated when the XML header file references data that are not part of the distribution package provided by the USGS.  You will need to edit the XML file to remove these references. 

First determine what files are provided in your package.  Using the Windows File Explorer open the Snetinel data folder.  Within the double click on the folders Granule | S2A… (the long name again) | IMG_Data.  Expand the column width to show the full file name.  A typical filename is:
  S2A_OPER_MSI_L1C_TL_SGS__20160612T214651_A005086_T12TWM_B01.jp2

You want to keep any data references to the files ending with T12TWM and remove the rest.

First amke a backup copy of the XML file used to open the data.  Now open the original XML file using the text editor Notepad++ found on the YCEO systems.  Scroll down to the  <Product_Organisation> section and examine the many <Granule_List> … </Granule_List> entries.  Remove all but the entry that refers to your specific data set.  In this example, this would be the <Granule_List> that has images with T12TWM as the end part of the filenames.  Save the XML file and return to ENVI to open this as you did earlier.  ENVI should create three new files based on the spatial resolution.

L1C_T format

The YCEO Lab currently supports ENVI 5.3.1 and cannot be used to open Sentinel 2 data in this new format.  You can open these data using the ESA Sentinel Toolbox.  This is installed on the YCEO Lab systems.  You can also download this software from the ESA site:
  https://sentinel.esa.int/web/sentinel/toolboxes/sentinel-2

The ESA website has links to documentation and YouTube videos to instruct users.  For specific information on how to open these data and export them to ENVI please see a member of the YCEO staff.

Category: