Development of the submission for the NASA's challenge to create a visualization using Earth observation data that advances at least one of the following Sustainable Development Goals (SDGs):
- Zero Hunger
- Clean Water and Sanitation
- Climate Action
- Summary
- Dataset
- Prerequisites
- Project Setup
- Usage
- CLI and/or Demo Jupyter Lab
- Generate Image Metadata
- Clip the Area of Interest in the Image
- Calculate the Temperature of the ROI for Each Image
- Create the Temperature Image
- Create the True Color Image
- Create the Binary Image
- Calculate and Store Snow Cover Percentages
- Generate the NDSI Image
- Calculate Cloud Existence
- Final Combined Image
- CLI and/or Demo Jupyter Lab
- Main Jupyter Lab
The visual representation depicts annual climate trends in Los Glaciares National Park, Argentina, from 2013 to 2024. The visualization reveals a warmer climate, evidenced by a positive slope in surface temperature, along with a decreasing trend in the percentage of snow cover, indicating the impact of climate change. This comprehensive analysis uses the Landsat Collection-2 Level-2 data set for the Landsat 8 and 9 OLI/TIRS satellites. The main Sustainable Development Goal (SDG) addressed is SDG 13: Climate Action. The tools used for this visualization include Python for data processing, Matplotlib for plotting, and Geographic Information System (GIS) tools for spatial analysis.
The USGS EarthExplorer is the source of our satellite imagery datasets. We utilized the Landsat Collection 2 Level 2 dataset from Landsat 8 and 9 OLI/TIRS C2 L2 satellites. These datasets provide high-resolution images with atmospheric and geometric corrections, making them ideal for detailed earth surface analysis.
Sample images are available for testing via this Google Drive link: Sample dataset. These samples cover an area of interest as defined by the shapefile files. Access the shapefile folder in the repository here. The Google Drive folder contains a broader sample of our collected images. Due to space limitations in the repository, only a couple of images are included dataset/original as a tool demonstration.
Additional Comment on Image Selection: During the image selection process (as shown in the previous GIF), the first step was to choose the area of interest. Then, within the known database and collection, a key criterion for selection was that the cloud cover percentage ranged from 0% to 25%. This metric allowed us to find several suitable images for download. Subsequently, we expanded our selection criterion to a range of 0% to 50% cloud cover. The reason for this expansion is that, although the total area of the image could have cloud coverage of up to 25% or 50%, the specific area of interest we marked might not be affected by cloudiness. This process was manual, involving a review of each image to ensure the quality and relevance of the selected images for our analysis.
Before starting, ensure you have the following installed:
- Python: The programming language used for project development. This project requires Python version 3.10 or higher.
- Poetry: A tool for dependency management and packaging in Python.
- Jupyter Notebook: An interactive development environment for writing and executing code.
Follow these steps to set up the project:
-
Install Dependencies: Use the following command to install all project dependencies via Poetry:
poetry install
-
Install GDAL: This project requires GDAL version 3.4.1 with NumPy support. Use the following command for the correct installation:
poetry run pip install --no-cache-dir --force-reinstall 'GDAL[numpy]==3.4.1'
This ensures the proper version and configuration of GDAL.
-
Activate the Virtual Environment: Activate the Poetry-created virtual environment with:
poetry shell
This allows for running scripts and using packages within this environment.
-
Set Up Jupyter Kernel: To use Jupyter notebooks with the project's virtual environment, set up a Jupyter kernel:
python -m ipykernel install --user --name=<project_name>
Replace
project_name
with a desired name for the Jupyter kernel. This integrates the virtual environment and dependencies with Jupyter notebooks.
We've encapsulated certain tasks within the code. While frame_image_processor generates individual images for video creation using frame_video_processor, pre-processing is required to organize everything.
A basic guide to using the functions:
Use the command:
oibur make metadata
In the lab, process_satellite_images_metadata
is called. This extracts and organizes image information in the original directory and creates a JSON file with the following structure:
{
"year": {
"satellites": ["LXSS"],
"correction_level": ["L2SP"],
"collection_number": ["CC"],
"collection_category": ["TX"],
"values": [
{
"satellite": "LXSS",
"wrs": "PPPRRR",
"acquisition_date": "YYYYMMDD",
"processing_date": "yyyymmdd",
"bands": ["SX_BX", ...]
},
...
],
"missing_months": ["01", "02", ...]
},
...
}
This is saved as landsat_images_metadata.json. A report file detailing images, dates, and bands available is also created and saved as landsat_images_report.txt.
This step is crucial as it informs subsequent operations.
oibur make clipped
In the lab, process_and_clip_landsat_images
is used. This command crops the images, focusing only on the desired area. The downloaded images are large in terms of coverage, so we select a specific area of interest, defined using shapefiles. Check the path dataset/roi_clipped.
oibur make temproi
In the lab, process_temperature_roi
is called. This calculates and adds temperature_roi information to each image in landsat_images_tags.json.
oibur make temp
In the lab, process_bands_for_temperature_image
is used.
oibur make color
In the lab, process_bands_for_true_color_image
is called.
oibur make binary
In the lab, process_bands_for_binary_image
is used.
oibur make snow
In the lab, process_snow_cover_percentange
is called. This calculates and adds snow_cover_per information to each image in landsat_images_tags.json.
oibur make ndsi
In the lab, process_bands_for_ndsi_image
is used.
This process is manual and involves identifying images with clouds. Updates are made to landsat_images_tags.json under the key has_clouds
.
See the final result of one of the images comprising the final output, generated using main_image_frame_visualization
from frame_image_processor.
This explains the end-to-end process for obtaining the final visualization and results. If you're interested in a quick implementation of this visualization, open this lab in Colab. This bypasses the need to set up a virtual environment and install dependencies. Ensure it's synchronized with your images on Drive, for example.