Coder Social home page Coder Social logo

xarray_subset's Introduction

Subsetting Example with Xarray - using a large 30-year climate dataset

Charlie Becker

04-30-19

The varlist file contains a full list of variables for the currrent dataset we're pulling from. Such lists can be generated through list(< nc_file >.variables

It is neccessary to comment OUT the variables you want to INCLUDE in your subset, as this is a brief work around that allows a subset of specific variables within the multi-file function open_mfdataset(). The 'data_vars = [list of str] should be able to specify targeted variables, but for unknown reasons this dataset pulls all variables even under the data_vars = 'minimal' constriant. We thus feed 'drop_variables = ' our custum variable list as an alternative. The variable 'XTIME' must remain commented out for any temporal adjustments, as it is the coordinate variable depended upon for transformation.

This generates a subset of 30 files, one for each water year with a time dimention of 365/366 ('dayofyear'). Modification for different domains, temporal schemes, and variables should be fairly intuitive.

As a base size estimation, a seven single layered variable subset averaged by day, equates to ~ 35 GB over 30 years.

xarray_subset's People

Contributors

charlie-becker avatar

Watchers

James Cloos 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.