Giter VIP home page Giter VIP logo

pyl4c's Introduction

pyl4c

DOI

This is a collection of Python tools for managing, analyzing, and visualizing SMAP L4C data; running L4C Science; and working with related models in the Terrestrial Carbon Flux (TCF) framework. In particular:

  • Working with data in EASE-Grid 2.0 projection (ease2.py;)
  • Converting HDF5 geophysical variables to GeoTIFF format (spatial.py);
  • Creating statistical summaries of SMAP L4C variables or other raster arrays (utils.py);
  • Reproducing L4C operational model logic (science.py);
  • Down-scaling 9-km SMAP fields to 1-km resolution (/apps/resample.py)
  • Calibrating the L4C model (apps/calibration);
  • Running the L4C model (apps/l4c);
  • Aligning and summarizing SMAP L4C variables with TransCom regions (lib/transcom.py);

The entire project is contained in the pyl4c module. Once installed:

import pyl4c

Documentation

Read the online documentation here.

Setup and Installation

Because this project is highly modular, it must be installed as a package in order to resolve module references/ paths. Check out setup.sh for an example of setting up the virtual environment prior to installation with pip. Installation with pip, inside a virtual environment (virtualenv), is the recommendation. Below, we install the pyl4c library in "development mode," which enables you to edit the source code.

$ pip install -e .

Some extra features must be requested in order to have their dependencies installed.

# To install support for calibration of L4C
pip install -e pyl4c[calibration]

# To install support for command line interfaces and the "scripts" folder
pip install -e pyl4c[cli]

# To install support for reading netCDF4 files
pip install -e pyl4c[netcdf]

# To install support for resampling L4C data by TransCom regions
pip install -e pyl4c[transcom]

This will also install the project's dependencies. NOTE: Because the GDAL Python bindings can be difficult to install, I recommend installing them as binaries through your system's package manager. For instance, on Ubuntu GNU/Linux:

sudo apt install python3-gdal

You may encounter an error installing pyl4c from setup.py, depending on the version of the GDAL library you have installed. See setup.py to check which version of GDAL that is expected. You can install a specific version of the GDAL Python bindings that is consistent with your system installation by:

pip install GDAL==$(gdal-config --version)

There can also be issues with installing GDAL in a virtual environment; see this thread and also try:

pip install --no-build-isolation --no-cache-dir --force-reinstall gdal==$(gdal-config --version)

Dependencies

This package requires system support for HDF5 and the Geospatial Data Abstraction Library (GDAL).

  • Python 3.5+
  • GDAL (2.4+)
  • HDF5

Development headers for GDAL might also be necessary to get the Python bindings to install correctly. On Ubuntu GNU/Linux:

# Install support for HDF5 (and the Python 3 bindings)
sudo apt install libhdf5-103 libhdf5-dev python3-h5py

# Install support for GDAL Python bindings (and the Python 3 bindings)
sudo apt install gdal-bin libgdal-dev python3-gdal

NOTE: For using calibration tools, NetCDF (3 and 4) and nlopt are required which, in turn, may require additional system libraries. On Ubuntu GNU/Linux:

sudo apt install libnlopt0

NOTE: The basemap toolkit for matplotlib must be installed separately:

pip install git+https://github.com/matplotlib/basemap.git

pyl4c's People

Contributors

arthur-e avatar schwehr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyl4c's Issues

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.