ATTENTION : PORT INCOMPLETE. FOR WORKING VERSION, USE ESMF 7.1.0beta and after
================================================================================
README
Earth System Modeling Framework Python Interface (ESMPy)
Earth System Modeling Framework Python Interface Copyright 2002-2016, University Corporation for Atmospheric Research, Massachusetts Institute of Technology, Geophysical Fluid Dynamics Laboratory, University of Michigan, National Centers for Environmental Prediction, Los Alamos National Laboratory, Argonne National Laboratory, NASA Goddard Space Flight Center. Licensed under the University of Illinois-NCSA License.
HI, welcome to ESMPy :)
ESMPy is a Python interface to the Earth System Modeling Framework (ESMF) regridding utility. ESMF is software for building and coupling weather, climate, and related models. ESMF has a robust, parallel and scalable remapping package, used to generate remapping weights. It can handle a wide variety of grids and options: logically rectangular grids and unstructured meshes; regional or global grids; 2D or 3D; and pole and masking options. ESMF also has capabilities to read grid information from NetCDF files in a variety of formats, including the evolving Climate and Forecast (CF) GridSpec and UGRID conventions.
ESMPy supports a single-tile logically rectangular discretization type called Grid and an unstructured discretization type called Mesh (ESMF also supports observational data streams). ESMPy supports bilinear, finite element patch recovery and first-order conservative regridding. There is also an option to ignore unmapped destination points and mask out points on either the source or destination. Regridding on the sphere takes place in 3D Cartesian space, so the pole problem is not an issue as it commonly is with many Earth system grid remapping softwares. Grid and Mesh objects can be created in 2D or 3D space, and 3D first-order conservative regridding is fully supported. Future plans for ESMPy involve the incorporation of observational data streams.
Regridding, also called remapping or interpolation, is the process of changing the grid underneath field data values while preserving the qualities of the original data. Different kinds of transformations are appropriate for different problems. Regridding may be needed when communicating data between Earth system model components such as land and atmosphere, or between different data sets to support analysis or visualization.
Regridding can be broken into two stages. The first stage is generation of an interpolation weight matrix that describes how points in the source grid contribute to points in the destination grid. The second stage is the multiplication of values on the source grid by the interpolation weight matrix to produce the appropriate values on the destination grid. ESMPy provides access to both stages through two separate interfaces.
There are many different interpolation methods, suitable for different problems. In ESMPy, the basic bilinear option is a two dimensional variant of linear interpolation. The higher order patch recovery is a second degree polynomial regridding method, which uses a least squares algorithm to calculate the polynomial. The first-order conservative regridding is a variant of a constant method which compares the proportions of overlapping source and destination cells to determine appropriate weights. All of these methods can be broken down to a simple sparse matrix multiplication operation between interpolation weights and data values.
================================================================================
The "REQUIREMENTS" section below will give information on the software requirements.
The "INSTALLATION" section gives directions on how to install ESMPy. (If you just downloaded the ESMF tarball, it is source code and you will have to build the ESMF library first.)
The "USE" section below will give information on how to import this package.
The "VALIDATION" section below will give information on how to test the package.
The "LIMITATIONS" section has helpful information on which capabilities can be expected from the current ESMPy functionality.
The "MORE HELP" section will give you links to more documentation and other information about the ESMF project.
Documentation for the ESMPy library can also be found by running 'pydoc ESMF' from the terminal prompt in the top level ESMPy directory.
Please contact esmf_support@list.woc.noaa.gov with any questions or problems.
================================================================================
The ESMPy package should include the following files:
-- LICENSE - University of Illinois-NCSA License
-- README - this file
-- setup.py - standard Python build file
-- doc directory - contains all Sphinx documentation files
-- examples directory - iPython script examples -- init.py - package init file -- hello_world.py - simple hello world example -- grid_create_from_file.py - grid creation from file -- mesh_create_from_file.py - mesh creation from file -- grid_mesh_regrid.py - grid to mesh bilinear regridding -- tripole_regrid.py - conservative regridding between a GRIDSPEC and a tripole grid using masking -- ungridded_dimension_regrid.py - conservative regridding with extra field dimesions for time and vertical levels -- exampletest.py - examples test class -- run_examples.py - script to run all examples -- run_examples_dryrun.py - script to download files required for examples
-- src directory -- ESMF directory -- init.py - package init file -- api directory -- init.py - package init file -- array.py - MaskedArray base class for Field -- constants.py - global constants -- esmpymanager.py - Manager class -- field.py - Field class -- grid.py - Grid class -- mesh.py - Mesh class -- regrid.py - Regrid class
-- fragments directory
-- extras.py - ESMPy routines that are not currently part of the ESMPy package
-- remap.py - interface to ESMF_RegridWeightGen application
-- interface directory
-- cbindings.py - ctypes bindings to ESMF C interface
-- loadESMF.py - script to load the ESMF shared library
-- test directory
-- __init__.py - package init file
-- base.py - base class to hold utility test functions
-- base_test.py - testing of the base class
-- run_alltest.py - unit test run utility
-- test_cbindings.py - tests of the "glue" layer to the ESMF c interface
-- regrid_from_file directory
-- __init__.py - package init file
-- read_test_cases_from_control_file.py - utility to read test cases from file
-- regrid_check.py - Regrid testing program
-- regrid_check_driver.py - Driver program for regrid testing
-- regrid_from_file_consts.py - utility constants
-- regrid_test_data.txt - text file contains regridding test configurations
-- run_regrid_from_file.py - regrid test run utility
-- run_regrid_from_file_dryrun.py - regrid test dryrun utility
-- test_api
-- __init__.py - package init file
-- grid_utilities.py - utility functions for grids
-- mesh_utilities.py - utility functions for meshes
-- test_array.py - array tests
-- test_field.py - field tests
-- test_grid.py - grid tests
-- test_mesh.py - mesh tests
-- test_regrid.py - regrid tests
-- util directory
-- __init__.py - package init file
-- decorators.py - decorators for special functions
-- exceptions.py - warning and exception classes
================================================================================
The following packages are required to work with ESMPy:
-- ESMF installation - http://www.earthsystemmodeling.org/esmf_releases/last/ESMF_usrdoc -- python - http://python.org/ -- numpy - http://numpy.scipy.org/
The following packages are optional:
-- mpi4py - python bindings to MPI, needed to run the parallel regridding tests -- ESMF installation with NetCDF - required to create grids and meshes from file
Installation of ESMPy requires a pointer to a file named esmf.mk inside of an ESMF installation. This file resides in a directory which looks like: