Coder Social home page Coder Social logo

jwagemann / era5_in_gee Goto Github PK

View Code? Open in Web Editor NEW
78.0 4.0 21.0 354 KB

Functions and Python scripts to ingest ERA5 data into Google Earth Engine

Python 54.81% Jupyter Notebook 45.19%
climate-data google-cloud-platform googleearthengine copernicus era5 reanalysis netcdf gdal

era5_in_gee's Introduction

ERA5 reanalysis data in Google Earth Engine

This repository contains a set of functions and example scripts to ingest Copernicus ERA5 reanalysis data into Google Earth Engine based on manifest uploads.

The functions were developed during the process of making a subset of the ERA5 reanalysis data available in Google Earth Engine.


Workflow overview

The workflow consists of six major steps:

  1. Downloading hourly data as daily files or monthly aggregates in NetCDF format from the Climate Data Store with cdsapi
  2. Aggregating hourly files to daily means or sums (total precipitation) with xarray
  3. Converting NetCDF data files to GeoTiff with gdal
  4. Uploading hourly, daily and monthly GeoTiff files to Google Cloud Platform (GCP) with google-cloud-storage Python API
  5. Creating image manifests (JSON-based files) describing the metadata and band names of the resulting Earth Engine asset
  6. Ingesting data files uploaded to GCP as assets into Earth Engine with earthengine-api and manifest uploads


Repository content


Python packages required


Naming convention and folder structure

The scripts base on the following naming convention and folder_structure:

Naming Convention

Data is downloaded from the Climate Data Store with the following syntax:

  • era5_ + name_of_variable_ + year_ + month_ + day + .nc
    • Example for a file of 2m dewpoint temperature from 1 January 1980: era5_2m_dewpoint_temperature_1980_01_01.nc

Folder Structure:

(example for 2m air temperature)

  • era5_t2m
    • nc
      • hourly
        • year (e.g. 1979)
      • daily
        • year (e.g. 1979)
      • monthly
        • year (e.g. 1979)
    • tiff
      • hourly
        • year (e.g. 1979)
      • daily
        • year (e.g. 1979)
      • monthly
        • year (e.g. 1979)
  • manifests
    • era5_hourly
      • year (e.g. 1979)
    • era5_daily
      • year (e.g. 1979)
    • era5_monthly
      • year (e.g. 1979)
    • manifest_template.json

References


License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

era5_in_gee's People

Contributors

jwagemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

era5_in_gee's Issues

Offset in image

First, thank you for putting these tools together and making them public! This is really helpful.

I was comparing the ERA5 and ERA5-Land image collections and noticed that there seems to be a slight shift or offset in the ERA5 images (https://code.earthengine.google.com/c71edc087f903a9cb61b55e1bfaf0e3f) that seemed to be about a half an ERA5 cell down and to the right.

Looking through these scripts I noticed that you are defining the geotransform is -180.0, 0.25, 0.0, 90.0, 0.0, -0.25 (https://github.com/jwagemann/era5_in_gee/blob/master/era5_in_gee_functions.py#L144). Since the latitude and longitude values in the NetCDF are for the "center" of the cells but the GeoTIFF is expecting the geotransform to be the upper-left corner "edge", shouldn't the geotransform be something like -180.125, 0.25, 0.0, 90.125, 0.0, -0.25?

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.