GithubHelp home page GithubHelp logo

cristianrubioa / pale-blue-dot-challenge Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 588.65 MB

NASA's visualization challenge project of the dynamic climate trends in the Los Glaciares National Park, Argentine. Leveraging Landsat 8/9 imagery from 2013 to 2024, the visual highlights warming temperatures and diminishing snow cover percentage.

License: MIT License

Python 2.12% Jupyter Notebook 97.88%
climate-change driven-data-competition jupyter-notebook landsat-8 landsat-9 poetry python3 snow temperature usgs-earth-explorer

pale-blue-dot-challenge's Introduction

pale-blue-dot-challenge

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

Table of Contents

  1. Summary
  2. Dataset
  3. Prerequisites
  4. Project Setup
  5. Usage
  6. Main Jupyter Lab

Summary

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.

Historic Example

Dataset

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.

Dataset Example

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.

Prerequisites

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.

Project Setup

Follow these steps to set up the project:

  1. Install Dependencies: Use the following command to install all project dependencies via Poetry:

    poetry install
  2. 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.

  3. Activate the Virtual Environment: Activate the Poetry-created virtual environment with:

    poetry shell

    This allows for running scripts and using packages within this environment.

  4. 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.

Usage

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.

CLI and/or Demo Jupyter Lab

A basic guide to using the functions:

Generate Image Metadata

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.

Clip the Area of Interest in the Image

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.

Calculate the Temperature of the ROI for Each Image

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.

Create the Temperature Image

oibur make temp

In the lab, process_bands_for_temperature_image is used.

Create the True Color Image

oibur make color

In the lab, process_bands_for_true_color_image is called.

Create the Binary Image

oibur make binary

In the lab, process_bands_for_binary_image is used.

Calculate and Store Snow Cover Percentages

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.

Generate the NDSI Image

oibur make ndsi

In the lab, process_bands_for_ndsi_image is used.

Calculate Cloud Existence

This process is manual and involves identifying images with clouds. Updates are made to landsat_images_tags.json under the key has_clouds.

Final Combined Image

See the final result of one of the images comprising the final output, generated using main_image_frame_visualization from frame_image_processor.

Main Jupyter Lab

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.

pale-blue-dot-challenge's People

Contributors

cristianrubioa avatar alejandro-zz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.