Giter Site home page Giter Site logo

jonatanmoreno777 / candex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wknoben/candex

0.0 0.0 0.0 1.47 MB

Python code to create shapefile for NetCDF lat and lon and intersection with other shapefiles and returning the average time series for the shapefile

License: Apache License 2.0

Python 100.00%

candex's Introduction

DOI

CANDEX: CAtchment NetcDf EXtractor

This package allows you to extract and aggregate the relevant values from a cfconventions compliant netcdf files given shapefiles.

CANDEX is a collection of functions that allows extraction of the data from a NetCDF file for a given shapefile such as a basin, catchment. It can map gridded data or model output to any given shapefile and provide area average for a target variable. CANDEX can:

  1. Read a regular lat/lon gridded data or model to any shapefile
  2. Read a rotate lat/lon gridded data or model to any shapefile
  3. Map a non-regular shapefile data, such as Thiessen polygon for example, to any shapefile such as sub-basin.
  4. Looping over many shapefile and NetCDF files

The code can be used for the following purposes:

  1. Calculation of forcing variables, such as precipitation or temperature and other variables for the effortless model set up. This transfer can be from Thiessen polygon or gridded data, for example.
  2. Mapping the output of a model to force another model, such as providing the gridded model output in sub-basin for routing.

Features of the functions:

  1. No manual ID is needed. The code needs an ID for any target value but it works with lat/lon instead of ID. This reduces the chance of confusion in mapping the source to sink polygons.
  2. The code can handle varying resolution and jump in the NetCDF file. in any itteration, the user can ask the grided shapefile to be generated and intersected with the target polygon.
  3. It can redo the calculation for a shapefile many times over many files if the files are separated for yearly, monthly or daily time period.

Example

The pictures show mapping of the gridded averaged temperature for period for daily temprature of 2010 from the WFDEI dataset. The temperature field is mapped to the sub-basins of the Bow and Oldman River Basin (using Matlab topotoolbox and hydrologically conditioned Hydroshed DEM).

Temperature field in degree celsius for the grids of WFDEI data set

Temperature field in degree celsius remapped for the sub-basin of Bow and Oldman River Basin

candex's People

Contributors

shervangharari avatar bpmweel avatar wknoben 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.