Home

Awesome

OCO-2 CO<sub>2</sub> peak detector

General presentation

The goal of our project is to localize CO<sub>2</sub> emissions on Earth based on the the carbon concentration data measured by the OCO-2 Satellite from the NASA.

We are working with:- Matthieu Porte, from IGN who submit the projet- Marie Heckmann, from the French Ministry of Ecology

What we have as input

1/ OCO-2 Satellite data

The OCO-2 Satellite (Orbiting Carbon Observatory) from the NASA orbits around Earth and measures the CO<sub>2</sub> concentration in the atmosphere.

Here is a visualisation of the CO<sub>2</sub> concentration mesured by the OCO-2 satellite in December 2019. CO2_ concentration_OCO2

The satellite uses spectrometers to detect CO<sub>2</sub> in the atmosphere, as shown in the image bellow.

OCO2 spectrometers

source

More info here : https://oco.jpl.nasa.gov/instrument/

There are some limitations to the satellite measurement of the CO<sub>2</sub> concentration:

OCO2 spectrometers !!

More info on the mission on https://earth.esa.int/web/eoportal/satellite-missions/o/oco-2.

The NASA made a global CO<sub>2</sub> image (see bellow), however this is an extrapolation of the data, and not what the satellite really see.

NASA Global CO<sub>2</sub>

2/ Data on known CO<sub>2</sub> emissions

CO2_emissions_Edgar_2018

power_plant_emissions_2017

What we do

First approach: peak detection from O-CO2 & inference from inventory data

Second approach: supervised model to learn to detect peaks from inventory data [not started]

On top: dynamic visualization of data

What we have achieved

Here is a sample of a peak witth the gaussian found :

Gaussian Peak

And the result on the website :

OCO2 Peak app

We need help

Git directories structure

Warning : The project use NBDev so the doc (including this README !) and the modules ar generated from Notebooks. So you have only to edit the Notebooks.

Open Stack directories structure

We do not store the original OCO-2 files from NASA.

Install

Python Package Only

If you are interested to use only our modules for your own project : pip install oco2peak

With Docker

For use only

docker-compose up

Front on http://localhost:7901

For dev

docker-compose -f docker-compose-dev.yml up

Dataset access

You need a config.json with token to your OpenStack:

{
    "swift_storage": {
        "user":"B..r",
        "key":"ep..ca",
        "auth_url":"https://auth.cloud.ovh.net/v3/",
        "tenant_name":"8..8",
        "auth_version":"3",
        "options" : {
            "region_name": "GRA"
        },
        "base_url" : "https://storage.gra.cloud.ovh.net/v1/AUTH_2...d/oco2/"
    }
}
config = '../configs/config.json'
datasets = Datasets(config)
datasets.get_files_urls(prefix="/datasets/oco-2/peaks-and-invent/", pattern='1908')
['https://storage.gra.cloud.ovh.net/v1/AUTH_2aaacef8e88a4ca897bb93b984bd04dd/oco2//datasets/oco-2/peaks-and-invent/peaks_and_invent_1908.csv']
datasets.get_files_urls(prefix="/map/peaks_map/", pattern='1908')
['https://storage.gra.cloud.ovh.net/v1/AUTH_2aaacef8e88a4ca897bb93b984bd04dd/oco2//map/peaks_map/peaks_capture_map_1908.html']

Upload a file

datasets.upload(mask='../*.md', prefix="/Trash/",content_type='text/text')
<div> <style> /* Turns off some styling */ progress { /* gets rid of default border in Firefox and Opera. */ border: none; /* Needs to be in here for Safari polyfill so background images work as expected. */ background-size: auto; } .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar { background: #F44336; } </style> <progress value='1' class='' max='1', style='width:300px; height:20px; vertical-align: middle;'></progress> 100.00% [1/1 00:00<00:00] </div> <div> <style> /* Turns off some styling */ progress { /* gets rid of default border in Firefox and Opera. */ border: none; /* Needs to be in here for Safari polyfill so background images work as expected. */ background-size: auto; } .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar { background: #F44336; } </style> <progress value='3' class='' max='3', style='width:300px; height:20px; vertical-align: middle;'></progress> 100.00% [3/3 00:01<00:00] </div>

Build docs and modules

make all

Or if you are using Docker:

docker exec -it batch7_satellite_ges_oco2-dev_1 make all

Process NASA Files

In docker-compose-dev.yml change source: /media/NAS-Divers/dev/datasets/ to the path to you NC4 files.

Then run : docker-compose -f docker-compose-dev.yml up

In another terminal, run:

docker exec -it batch7_satellite_ges_oco2-dev_1 /bin/bash
python pipeline/01_extract_nc4_to_csv.py
python pipeline/02_find_peak_in_all_files.py
python pipeline/03_upload_json_to_the_cloud.py