Downloading, Visualizing and Preprocessing Sentinel-2 Data in SNAP

From CUOSGwiki
Jump to navigationJump to search

Introduction

Sentinel Application Platform, or SNAP is an earth observation data processing tool which allows for the analysis of satellite imagery data. SNAP was created by Copernicus ESA to allow for the processing, visualizing and transforming of data. It is a powerful software package that Copernicus has given open and unlimited access to. Its original use was for the processing and analysis of Sentinel imagery but is also adapted to allow for other sensor data. SNAP is a lesser known tool that is powerful, easily accessible and freely available, making it a great beginner tool for users. SNAP also has Python integration which can help optimize the importation and analytical processes if the user has experience with the language.

Copernicus provides free-of-cost access to Sentinel data, in raw and preprocessed formats. In this tutorial we will be making use of Copernicus data and software to explore some pre-processing and interpretation tools. Specifically, data retrieved from the Sentinel-2 constellation at a 1C pre-processing level. Examples in this tutorial are located on the southern tip of Ireland and ingested on November 2nd, 2021. However, this tutorial facilitates any Sentinel-2 scene and encourages you to explore your region or area of interest while developing your remote sensing and SNAP usage skills.

Getting Started

Install Required Software

Figure 1: Default setup for SNAP once open

A comprehensive guide through the installation can be found below. this is an excerpt taken from the Basic Processing of Radarsat-1 data in Snap ESA tutorial.

Snap ESA software can be downloaded at the following link [1]. Click the Download link in the Sentinel Toolboxes row that corresponds to your OS. Once the installer is downloaded, follow the instructions to install the software package onto your computer. When the portion of the installer asking to configure the Python library appears, skip this section as it will not be used in this tutorial or for most small processing scenarios. (Fitpatrick & Hamilton, 2021)

Once installation is complete, open SNAP. The default configuration is illustrated in Figure 1.

Why do we need to take these steps

Satellite data are extremely useful, once they have been processed and interpreted to reveal the underlying meaning and inferences. Raw data must be corrected for implicit and operational errors like orbit related and wavelength interpretation, so accurate and meaningful analyses can be conducted. The tools and processes in this tutorial will give you the knowledge and steps necessary to effectively explore and interpret multispectral data.

Getting Sentinel-2 Data

There are two ways outlined in this tutorial to access Sentinel-2 data, through two Copernicus data servers, Scientific Data Hub and SNAP Product Library.

Copernicus account

To create a Copernicus account:

  1. Navigate to the Copernicus open access hub through this link [SCI Hub Homepage]
  2. Click the person icon with a question mark located in the upper right hand corner of your screen (Figure 2).
  3. In the lower left corner of the drop down, click Sign Up and fill out all the necessary fields of the corresponding forms, being sure to enter a valid email address.
  4. Once your account has been created and validated, sign in using the same dropdown in step 3.

We now have access to our Copernicus account and therefore Sentinel data. For more help, this link provides a comprehensive overview of the steps necessary SciHub Help

Scientific Data Hub (SCI Hub)

Figure 2: SCI Hub Display page

In Figure 2 we see the default SCI Hub display. depending on the data we are looking for, we are able to filter our search by location, sensor, and in Sentinel-2's case, even satellite. Below the login icon there are three icons oriented vertically (Figure 2) The top one shows the map layers. Click through the options and note the Sentinel-2 Cloudless + Overlay. The second and third icons are in a slider format. the upper icon allows for navigation around the globe. Use this to find your area of interest. Once found, switch the slider to the lower icon. This setting allows you to select an area of interest (AOI), your first filter for Sentinel data.

Next, navigate to the three horizontal lines icon, found on upper left corner of figure 2. This opens the advanced search dropdown, which allows for the filtering of available data by metrics of sensing and ingestion period, mission and the associated characteristics of each mission. After filtering, click the search icon to scan the repository for images that meet both your included location and advanced search criteria.

If any images match your criteria, the advanced search dropdown will be replaced with the results. If you place your mouse over an entry/ result, four icons will appear in the lower right corner of the entry which correspond to

  1. Zoom to Product,
  2. View Product Details,
  3. Add product to Cart,
  4. Download Product

These are illustrated by the compass, eye, shopping cart and download icons respectively. To find a tile by its location, ensure the Navigation icon from above is activated then click on the tile of interest.

Figure 3: Product Library tab with configured parameters

The results list will find and highlight the respective entry. It is recommended to view the product details for a preview of the product before downloading. Once the download is complete, open the product in SNAP. This can be done by the path, File -> Open Product then navigating to your working folder.

SNAP Product Library

The same data found in SCI Hub can be acquired directly in the SNAP application by using the Product Library (Figure 3). A Copernicus account is necessary for this option. However, this option does have the benefit of only utilizing one platform. The product library can be found as a tab on the upper right side of the SNAP console. It may also be found using the path, View -> Tool Windows -> Product Library. Toggle the repository to Scientific Data Hub, Mission to Sentinel-2 and Product type to S2MSI1C. All other entries are specific to the parameters you want to set for your intended data. Figure 3 shows the parameters used for this tutorial. Once all parameters are completed click the search directory button next to the repository name. You may be prompted to enter your Copernicus account information. The bottom border will tell you the progress of the search and outline the amount of entries that coincide with your parameters. Select a tile and download. Once the download is complete, open the product in SNAP. This can be done by the path, File -> Open Product, then navigating to your working folder.



Subsetting to AOI

Figure 4: Subset popup with selected AOI

It is beneficial to subset the downloaded Sentinel data package if your AOI is only a portion of the downloaded image. This will increase efficiency, reduce processing time as well as increase clarity of intent.

The simplest method is to navigate to Raster toolbar then the Subset option. In the popup window (figure 4) a blue bounding box will appear, this represents the extent of your image or view. Move the edges of the box to your desired location to resize, then press OK. If your desired AOI has exact coordinates or measurements, this option is not the most ideal.

A few other ways to accomplish a subset are discussed in the Subset section of the Basic Processing of Radarsat-1 data in Snap ESA tutorial found on the main Wiki course page.

Exploring Data in SNAP

Navigation Tab

This tab, found in the default view at the lower left corner of the SNAP screen (figure 1) is a very useful tool for data exploration and comparison. This section will provide an overview of its capabilities. If the navigation tab is not immediately apparent, the navigation tab can be opened through this path: View -> Tool Windows -> Navigation. In the right panel of the navigation tab, there are four magnifying glasses and two other special characters:

  1. The first is the Zoom In icon, which allows for investigation and visualization at a larger scale or higher resolution.
  2. Next, Zoom Out, which opposes the Zoom In tool.
  3. The magnifying glass with the 'P' shows the MSI at it highest granular pixel size. In other words the furthest extent one can zoom into the image, to a pixel level.
  4. The magnifying glass containing an 'A' opposingly yet similarly pans to the furthest extent of the multispectral image (MSI). In other words, by clicking this icon, the image zooms out to show the entire tile or scene.

The next two icons in the line up are extremely useful when comparing two expressions of the same scene. Open two of the image composites explored earlier (like the true colour and and infrared composite). They should be visualized as tabs in your main or major area that you can click between. Then use the path: Window -> Tile Vertically to create a split screen of sorts with both images.

  1. The first special character synchronizes views across multiple windows, so the exact same frame at the exact same resolution is being shown when panning in one image or in the navigation bar.
  2. The second synchronizes the cursor across multiple views, so the cursor point in the master tile can be identified easily in the drone/slave tiles.

Both these actions can be used concurrently. This configuration can be used to highlight finer resolution details and help drive analyses.

Note: There are also options to tile horizontally, evenly and singly. Choose the option which best displays the active image.

RGB Exploration

RGB image profiles

Figure 5: illustration for sampling navigation in SNAP

Sentinel-2 Multispectral data has 13 bands which can span from the 443nm to 2190nm on the electromagnetic scale. Any visual representation of a multispectral image (MSI) however can only display three bands at any time, using the Red, Green and Blue colour signatures. It is thus possible to change and manipulate the bands used to understand more about the landscape or focus of the image.

To do this, open an RGB Image Window either by right clicking the file name and scrolling to Open RGB Image Window or by higlighting the product then following the path: Window -> Open RGB Image Window. A popup will appear which outlines the current orientation of bands to colours. A true colour image can be illustrated by matching red: band 4, green: band 3 and blue: band 2 (This should be the default dropdown). Click Ok and wait as the RGB image loads. To save this colour composite as a band, check the box next to Store RGB channels as virtual bands in current product. This option is useful when you need to toggle quickly between two composites. Otherwise, the composite will be displayed as a tab in the main window. Play around with the possible colour combinations and think about what the arrangements are telling you.

Resampling to Increase Usefulness

Figure 6:Error message for band combinations

All bands in the Sentinel-2 product are not of equal resolution, so you may have had trouble combining some bands in your exploration (Figure 6). This is a problem as it restricts analyses and visualization techniques. To combat this, resampling of the bands is conducted using the following steps:

  1. Navigate to the resampling tool using the path: Raster -> Geometric -> Resampling.
  2. in the I/O parameters tab, select the product on which the resampling will be conducted. There is also an option to rename the output file, by default it keeps the input name and appends _resampled.
  3. Select the Resampling Parameters tab. In the section Define size of resampled product, There are three options by which you can determine the resolution of your new product's bands,
    • by reference band of source product
    • by target width and height
    • by pixel resolution

Using the first option, select a visible wavelength band as the reference band, like band 2 or band 3.

  1. Accept all default parameters for the section Define resampling algorithm.
  2. A popup will appear notifying of the completed process and its delayed implementation. Click Okay.
  3. Ensure Resample on pyramid levels (for faster imaging) is checked, then Run.

Image Classification Exploration

Spectrum View

Figure 7:Spectral response of pixel in image shown in Spectral View

The spectrum view, found through the path Optical -> Spectrum View, shows the wavelength associated with a specific pixel as it is hovered over. It is useful in determining how different types of landcover reflect and absorb each wavelength in a given RGB composite. Figure 8 shows the popup with the spectral response of a pixel in the Natural colour composite. The icons on the right side of the pop up are:

  1. filter icon which allows for the customization of the spectral view popup including symbol size and shape. By clicking the down arrow near Bands measured in dl you can select which bands the graph should include and exclude, allowing for focused analysis.
  2. The next icon shows the spectrum at the cursor position. If this option is not already selected, press the Shift key to activate, or select this icon.
  3. The following two inactive icons refer to the pin manager and its capabilities, outlined below.
  4. the grid icon allows the user to toggle between displaying gridlines and no gridlines.
  5. the final icon allows for exportation of the graph data which is particularly useful with multiple pins.

Pin Manager

Pins can be added using the pin icon Figure 9:Pin icon location to select any distinct or representative pixels in the scene. The Pin Manager is found follow the path: View -> Tool Windows -> Pin Manager. In the Pin Manager, the X, Y, Latitude, Longitude, Colour and Label are displayed in a table format with each row representing a pin. To change the colour of the pin, click on the colour in the corresponding pin row, several colour options will appear. Try using representative or meaningful colour associations. To edit the label of a pin, double click the cell to be edited. The right side panel holds ten icons which serve the following purposes:

Figure 8:Spectrum graph for pins
    • Create a new pin
    • Copy and existing pin
    • Edit a selected pin
    • Remove a selected pin
    • Import from XML file
    • Export to XML file
    • Filter pixel data
    • Export selected data
    • Zoom to selected pin
    • Transfer the selected pins to other products

After pins are created, reopen the Spectrum View popup. The previously inactive icons associated with pins are now accessible. The first icon allows you to select and view a specific pin's spectrum, then compare it to other pixels by hovering or moving the cursor and noting the variation in visually similar pixels or visually distinct/exclusive pixels. The second icon graphs all pins' spectrums which also allows for separation and other landcover type analyses (figure 8).

Note: deselect one icon before attempting to select another. The Spectrum Manager does not intuitively do this.

Conclusion

Working with multispectral imagery can provide insight on crop health, land cover and a host of other topics. This tutorial has given your insight into some basic to intermediary processes to explore, discuss and analyze this imagery as well as knowledge on workflows in SNAP using Sentinel data.

References

Basic Processing of Radarsat-1 data in Snap ESA

Geospatial Ecology and Remote Sensing. (2018a, March 13). Exploring Sentinel-2 multi-spectral band combinations in SNAP. https://www.youtube.com/watch?v=vtlN5MXYGaY

Geospatial Ecology and Remote Sensing. (2018b, March 13). Exploring spectral response curves from Sentinel-2 in SNAP. https://www.youtube.com/watch?v=E8Tu_IaJl6c&list=PLf6lu3bePWHCOUjTDZRNx5N07otDM8iUq&index=2

SNAP - Explore Sentinel-2 products (Old version). (2016, January 16). https://www.youtube.com/watch?v=tR_7Oq80TkA