sebascharlier

Get Sentinel-2 L1C and L2A in Arcgis

Blog Post created by sebascharlier on Mar 1, 2017

Working with sentinel-2 product and as I need a solution to use it in ArcGIS I made a script that can create a multiband product similar to what ESRI made in mosaic loader but this script don’t request last version of product, work on 10.3.1 and probable previous version. The big difference between the mosaic builders is that you’ll create multiband product so you’ll get a duplication of your product in geodatabase.

 

This script work on version 13 and 14 of metadata so you can use the brand new product without waiting and the best part is you can use L2A product (as I have only used Sen2Cor I can’t warranty support for other way to produce L2A) and of course L1C product is supported as well, some option simply don’t work if you use L1C product.

 

The tool needs a geodatabase to place multiband file, the naming is automated and will be described later. You need to provide xml metadata, the tool check if you send him .xml file and if it’s a report file (it happened sometime to me to make the confusion after running Sen2cor).

The tools looks like the ESRI mosaic tool, you can make 10m, 20m or 60m multiband, regarding to the product level the result will be different of course. As it could be interesting for some to get mask from level 2 product you can make multiband including them. Because of the variability of name in xml metadata file I too the option to point directly on it. The mosaic builder use GDAL to load the metadata that’s why you don’t need to point on it. To avoid the usage external module like a newer version of GDAL the metadata is read as a text file and all the info is stored in variable. In case of specific need you can edit or adapt. I think to make a version that can load multiband directly in mosaic and add some information from metadata inside the mosaic.

Other note, this loader not work if you try to import directly from granule, if there is enough request I can see to make it possible.

The product itself:

The naming of the product is made as fellow S2X_GRANULE_DATE_LEVEL_TYPE the naming convention is the following :

  • S2X refer to the spaceship name S2A or S2B
  • GRANULE refer to the name of the acquisition space like T31UFS
  • DATE is the date and time of acquisition dateTtime it’s the format from ESA to name file
  • LEVEL refer to the level of treatment L1C or L2A like that, it’s possible to have the same area on 2 different level
  • TYPE refer to the type of multiband build _10 is for 10m, _20 for 20m _60 for 60m _OP_20 and _OP_60 respectively for optional at 20m or 60m

Band convention :

In case of L1C the raster distribution is the following:

  • at 10m : B02, B03,  B04, B08
  • at 20m :  B05, B06, B07 , B08A, B11, B12
  • at 60m : B01, B09, B10

In case of L2A the raster distribution is the following:

  • at 10m : B02, B03, B04, B08
  • at 20m : B02, B03, B04, B05, B06, B07, B08A, B11, B12
  • at 60m : B02, B03, B04, B05, B06, B07, B08A, B09, B10, B11, B12
  • In addition you get the mask and land classification raster for 20m and 60m the mask are ordered the same way : Cloud, Snow, Scene classification.

The scrip is very verbose like that you can easily track what its running and where you are in the process.

I still need to make template to provide viewing version of product like you can found in mosaic product in case you want (like I do) to build mosaic with your multiband.

Attachments

Outcomes