This package provides an implementation of a filter based on diffusion for global geophysical data. The module diffusion_operators contains functions which can be called directly by the user, and relies on the functions of diffusion_auxiliary. The theory behind the filter and examples of applications are provided in: "Mass conserving filter based on diffusion for Gravity Recovery and Climate Experiment (GRACE) spherical harmonics solutions, O. Goux, J. Pfeffer, A. Blazquez, A. T. Weaver, M. Ablain, 2021" (work in progress).
An exemple of application of the function diffusion_filter is given in a Jupyter notebook in the folder "demo". It uses data stored in a test_data.nc. Note that while the diffusion filter only requires numpy and scipy, the notebook uses the netCDF4 library for the input data as well as Basemap and matplotlib for the display. Note that the Git website does not render Jupyter Notebooks properly, please use the PDF version to view it from the Git website, or download the notebook to use it interactively. The code of the notebook is also provided in a more compact form in the filte demo_diffusion.py
If your installation does not support Basemap, you can either use your own display function or install a virtual environment containing Basemap, e.g.:
"conda create -n grace_diffusion_env -c conda-forge python notebook numpy scipy pip netcdf4 setuptools matplotlib basemap geos=3.8.1"
Note that if geos is not downgraded from 3.9 to 3.8.1, coastlines around Antarctica will appear "cut" at the Greenwhich meridian.
Once in a compatible environment the package supports installations via pip (e.g. "pip install ." in this directory).