Git Product home page Git Product logo

pyqg_da's Introduction

pyqg_DA

Data assimilation system for the PyQG model

This repository provides data assimilation (DA) capability for the PyQG model, as documented in the Lorenz-96 notebooks.

File Structure

DA related

  • DA_core.py: data assimilation related functions
  • DA_QG2L.ipynb: notebook for data assimilation examples in 2-layer QG model
  • DA_analysis.ipynb: notebook to analyze DA results
  • ENKF.py, ENKF_training.py: Python script to run EnKF DA experiments in bulk

ML related

  • ML_core.py: machine learning related functions
  • B_UNet.ipynb: notebook to train U-Net to predict ensemble covariances
  • UNet_analysis.ipynb: notebook to analyze trained U-Nets
  • training.py: Python script to train U-Net
  • UNetKF.py: Python script to run UNetKF DA experiments

Current Issues

For the code clinic, I would like to optimize the code related to the training and inference, especially in the case of using GPU.

The scheme of the data pipline is as follows:

At each time step, the full q datasets have the size of (level,Ny,Nx), so the full covariance matrix of q would have size of (level,Ny,Nx,level,Ny,Nx). In this current PyQG implementation of EnKF, we use the full covariance matrices during the data assimilation step. However, the full covariance matrices at all time steps are prohibitively big to save for training U-Nets. Since we normally use covariance localization in EnKF applications, only part of the full covariance matrix is used (usually based on physical distance), we can save only localized matrices. As a result, the saved q datasets have the size of (time,level,Ny,Nx), while the saved covariance matrices B have the size of (time,level,Nx,Nx,level,Ny_local,Nx_local), where Ny_local and Nx_local are significantly smaller than Ny and Nx.

During training, each data sample consists of a localized q matrix and a localized B matrix. The localized B with size of (level,Ny_local,Nx_local) would simply be a subset of the full dataset, while the localized q is taken as subset of the full matrix at runtime.

The same process happens during inference. When the U-Net is applied in the DA processs, a localized q matrix is constructed around each model gridpoint.

ML_core.py

Because the training samples are taken as moving subsets of the full datasets, after reading the input data, the "get item" function takes one sample at a time to generate the data batches.

B_UNet.ipynb

DA_core.py

pyqg_da's People

Contributors

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