Skip to content

Commit

Permalink
Merge pull request #2 from tsutterley/testing
Browse files Browse the repository at this point in the history
jupyter notebook on binder
  • Loading branch information
tsutterley authored Mar 23, 2020
2 parents 6ae539b + cdd4c1d commit 9ca8b3c
Show file tree
Hide file tree
Showing 62 changed files with 5,840 additions and 36 deletions.
782 changes: 782 additions & 0 deletions GRACE-Spatial-Maps.ipynb

Large diffs are not rendered by default.

86 changes: 55 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,71 @@ read-GRACE-harmonics
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/tsutterley/read-GRACE-harmonics/master)
[![Binder](https://binder.pangeo.io/badge.svg)](https://binder.pangeo.io/v2/gh/tsutterley/read-GRACE-harmonics/master)

Reads Level-2 spherical harmonic coefficients from the NASA/DLR Gravity Recovery and Climate Experiment (GRACE) and the NASA/GFZ Gravity Recovery and Climate Experiment Follow-On (GRACE-FO) missions
Python tools for obtaining and working with Level-2 spherical harmonic coefficients from the NASA/DLR Gravity Recovery and Climate Experiment (GRACE) and the NASA/GFZ Gravity Recovery and Climate Experiment Follow-On (GRACE-FO) missions

#### Resources
- [NASA GRACE mission site](http://www.nasa.gov/mission_pages/Grace/index.html)
- [JPL GRACE Tellus site](http://grace.jpl.nasa.gov/)
- [JPL GRACE-FO site](https://gracefo.jpl.nasa.gov/)
- [UTCSR GRACE site](http://www.csr.utexas.edu/grace/)
- [GRACE at the NASA Physical Oceanography Distributed Active Archive Center (PO.DAAC)](https://podaac.jpl.nasa.gov/grace)
- [GRACE at the GFZ Information System and Data Center](http://isdc.gfz-potsdam.de/grace-isdc/)

#### Calling Sequence
```
from gravity_toolkit.read_GRACE_harmonics import read_GRACE_harmonics
CSR_L2_input = read_GRACE_harmonics('GSM-2_2002095-2002120_0021_UTCSR_0060_0005.gz',60)
GFZ_L2_input = read_GRACE_harmonics('GSM-2_2002094-2002120_0024_EIGEN_G---_005a.gz',90)
JPL_L2_input = read_GRACE_harmonics('GSM-2_2002091-2002120_0018_JPLEM_0001_0005.gz',60)
JPLMSC_input = read_GRACE_harmonics('GSM-2_2003001-2003031_0029_JPLMSC_0719_0005',719)
```

#### Inputs
1. full path to input GRACE file
2. spherical harmonic degree of truncation (`LMAX`)

#### Options
- `MMAX`: spherical harmonic order of truncation (default is `LMAX`)
- `POLE_TIDE`: correct GSM data for pole tide drift following [Wahr et al. (2015)](https://doi.org/10.1002/2015JB011986)

#### Outputs
- `time`: mid-month date of GRACE file in year-decimal
- `start`: start date of range as Julian day
- `end`: end date of range as Julian day
- `clm`: cosine spherical harmonics of input data
- `slm`: sine spherical harmonics of input data
- `eclm`: cosine spherical harmonic uncalibrated standard deviations
- `eslm`: sine spherical harmonic uncalibrated standard deviations
- `header`: text header of the GRACE file (will parse new YAML headers)
#### Programs
- [`aod1b_geocenter`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/aod1b_geocenter.md) - Creates monthly files of geocenter variations due to non-tidal atmospheric or oceanic variation at 6-hour intervals
- [`combine_harmonics`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/combine_harmonics.md) - Returns the spatial field for a series of spherical harmonics
- [`convert_calendar_decimal`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/convert_calendar_decimal.md) - Converts from calendar date into decimal years taking into account leap years
- [`convert_julian`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/convert_julian.md) - Return the calendar date and time given Julian date
- [`destripe_harmonics`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/destripe_harmonics.md) - Filters spherical harmonic coefficients for correlated "striping" errors
- [`gauss_weights`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/gauss_weights.md) - Computes the Gaussian weights as a function of degree
- [`geocenter`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/geocenter.md) - Converts degree 1 spherical harmonic coefficients to geocenter variations
- [`grace_date`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/grace_date.md) - Calculates dates of each GRACE/GRACE-FO file and assigns the month number
- [`grace_find_months`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/grace_find_months.md) - Finds the months available for a GRACE/GRACE-FO product
- [`grace_input_months`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/grace_input_months.md) - Reads GRACE/GRACE-FO files for a specified spherical harmonic degree and order and for a specified date range
- [`hdf5_read_stokes`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/hdf5_read_stokes.md) - Reads spherical harmonic data from HDF5 files
- [`hdf5_read`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/hdf5_read.md) - Reads spatial data from HDF5 files
- [`hdf5_stokes`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/hdf5_stokes.md) - Writes spherical harmonic data to HDF5 files
- [`hdf5_write`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/hdf5_write.md) - Writes spatial data to HDF5 files
- [`ncdf_read_stokes`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/ncdf_read_stokes.md) - Reads spherical harmonic data from netCDF4 files
- [`ncdf_read`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/ncdf_read.md) - Reads spatial data from netCDF4 files
- [`ncdf_stokes`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/ncdf_stokes.md) - Writes spherical harmonic data to netCDF4 files
- [`ncdf_write`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/ncdf_write.md) - Writes spatial data to netCDF4 files
- [`plm_columbo`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/plm_columbo.md) - Computes fully-normalized associated Legendre Polynomials using the Colombo (1981) recursion relation
- [`plm_holmes`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/plm_holmes.md) - Computes fully-normalized associated Legendre Polynomials using the Holmes and Featherstone (2002) recursion relation
- [`plm_mohlenkamp`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/plm_mohlenkamp.md) - Computes fully-normalized associated Legendre Polynomials using Martin Mohlenkamp's recursion relation
- [`read_CSR_monthly_6x1`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_CSR_monthly_6x1.md) - Reads the monthly low-degree spherical harmonic data files from satellite laser ranging (SLR)
- [`read_GRACE_harmonics`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_GRACE_harmonics.md) - Reads GRACE/GRACE-FO files and extracts spherical harmonic data
- [`read_love_numbers`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_love_numbers.md) - Reads sets of load Love numbers output from the Preliminary Reference Earth Model (PREM)
- [`read_SLR_C20`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_SLR_C20.md) - Reads monthly oblateness spherical harmonic data files from satellite laser ranging (SLR)
- [`read_SLR_C30`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_SLR_C30.md) - Reads monthly degree 3 zonal spherical harmonic data files from satellite laser ranging (SLR)
- [`read_SLR_geocenter`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_SLR_geocenter.md) - Reads monthly geocenter spherical harmonic data files from satellite laser ranging (SLR)
- [`read_tellus_geocenter`](https://github.com/tsutterley/read-GRACE-harmonics/blob/master/doc/read_tellus_geocenter.md) - Reads monthly geocenter spherical harmonic data files from GRACE Tellus Technical Notes

#### Dependencies
- [numpy: Scientific Computing Tools For Python](http://www.numpy.org)
- [PyYAML: YAML parser and emitter for Python](https://github.com/yaml/pyyaml)
- [lxml: processing XML and HTML in Python](https://pypi.python.org/pypi/lxml)
- [future: Compatibility layer between Python 2 and Python 3](http://python-future.org/)
- [numpy: Scientific Computing Tools For Python](http://www.numpy.org)
- [PyYAML: YAML parser and emitter for Python](https://github.com/yaml/pyyaml)
- [lxml: processing XML and HTML in Python](https://pypi.python.org/pypi/lxml)
- [future: Compatibility layer between Python 2 and Python 3](http://python-future.org/)
- [matplotlib: Python 2D plotting library](http://matplotlib.org/)
- [cartopy: Python package designed for geospatial data processing](https://scitools.org.uk/cartopy/docs/latest/)
- [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/)
- [h5py: Python interface for Hierarchal Data Format 5 (HDF5)](https://www.h5py.org/)
- [read-GRACE-geocenter: Python reader for GRACE/GRACE-FO geocenter data](https://github.com/tsutterley/read-GRACE-geocenter/)

#### References
I. Velicogna, Y. Mohajerani, G. A, F. Landerer, J. Mouginot, B. Noël,
E. Rignot, T. C. Sutterley, M. van den Broeke, J. M. van Wessem, and D. Wiese,
"Continuity of ice sheet mass loss in Greenland and Antarctica from the GRACE
and GRACE Follow‐On missions", *Geophysical Research Letters*, 47,
(2020). [doi:10.1029/2020GL087291]( https://doi.org/10.1029/2020GL087291)

T. C. Sutterley, I. Velicogna, and C.-W. Hsu, "Self‐Consistent Ice Mass Balance
and Regional Sea Level From Time‐Variable Gravity", *Earth and Space Science*, 7,
(2020). [doi:10.1029/2019EA000860](https://doi.org/10.1029/2019EA000860)

T. C. Sutterley and I. Velicogna, "Improved estimates of geocenter variability
from time-variable gravity and ocean model outputs", *Remote Sensing*, 11(18),
2108, (2019). [doi:10.3390/rs11182108](https://doi.org/10.3390/rs11182108)

#### Download
The program homepage is:
Expand Down
28 changes: 28 additions & 0 deletions doc/aod1b_geocenter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
aod1b_geocenter.py
==================

- Reads GRACE/GRACE-FO level-1b dealiasing data files for a specific product
- `atm`: atmospheric loading from ECMWF
- `ocn`: oceanic loading from OMCT/MPIOM
- `glo`: global atmospheric and oceanic loading
- `oba`: ocean bottom pressure from OMCT/MPIOM
- Creates monthly files of geocenter variations at 6-hour intervals

#### Calling Sequence
```
from gravity_toolkit.aod1b_geocenter import aod1b_geocenter
aod1b_geocenter(base_dir, DREL='RL06', DSET='glo', CLOBBER=True)
```

#### Inputs
1. `base_dir`: working data directory

#### Options
- `DREL`: GRACE/GRACE-FO data release (RL05 or RL06)
- `DSET`: GRACE/GRACE-FO dataset (atm, ocn, glo, oba)
- `CLOBBER`: overwrite existing data
- `MODE`: Permission mode of directories and files
- `VERBOSE`: Output information for each output file

#### Dependencies
- `geocenter.py`: converts degree 1 spherical harmonic coefficients to geocenter variations
28 changes: 28 additions & 0 deletions doc/combine_harmonics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
combine_harmonics.py
====================

- Returns the spatial field for a series of spherical harmonics

#### Calling Sequence
```
from gravity_toolkit.combine_harmonics import combine_harmonics
spatial = combine_harmonics(clm,slm,lon,lat,LMAX=60)
```

#### Inputs:
1. `clm`: cosine spherical harmonic coefficients
2. `slm`: sine spherical harmonic coefficients
3. `lon`: longitude
4. `lat`: latitude

#### Options:
- `LMIN`: Lower bound of Spherical Harmonic Degrees
- `LMAX`: Upper bound of Spherical Harmonic Degrees
- `MMAX`: Upper bound of Spherical Harmonic Orders
- `PLM`: Fully-normalized associated Legendre polynomials

#### Outputs:
- `spatial`: spatial field [lon,lat]

#### Dependencies
- `plm_holmes.py`: Computes fully-normalized associated Legendre polynomials
25 changes: 25 additions & 0 deletions doc/convert_calendar_decimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
convert_calendar_decimal.py
===========================

- Converts from calendar date into decimal years taking into account leap years

#### Calling Sequence
```
from gravity_toolkit.convert_calendar_decimal import convert_calendar_decimal
t_date = convert_calendar_decimal(year, month, DAY=day, \
HOUR=hour, MINUTE=minute, SECOND=second)
```

#### Inputs
1. `year`: calendar year
2. `month`: calendar month (1 = January, ..., 12 = December)

#### Options
- `DAY`: Number of day of the month
- `HOUR`: hour of the day
- `MINUTE`: minute of the hour
- `SECOND`: second (and fractions of a second) of the minute
- `DofY`: day of the year (January 1 = 1)

#### Outputs
- `t_date`: date in decimal format (years)
28 changes: 28 additions & 0 deletions doc/convert_julian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
convert_julian.py
=================

- Return the calendar date and time given Julian date

#### Calling Sequence
```
from gravity_toolkit.convert_julian import convert_julian
YEAR,MONTH,DAY,HOUR,MINUTE,SECOND = convert_julian(JD, FORMAT='tuple')
```

#### Inputs
1. `JD`: Julian Day of the specified calendar date (days since -4712-01-01T12:00:00)

#### Options
- `ASTYPE`: convert output to variable type
- `FORMAT`: format of output variables
- `'dict'`: dictionary with variable keys as listed above
- `'tuple'`: tuple with variable order YEAR,MONTH,DAY,HOUR,MINUTE,SECOND
- `'zip'`: aggregated variable sets

#### Outputs
- `year`: Number of the desired year
- `month`: Number of the desired month (1 = January, ..., 12 = December)
- `day`: Number of day of the month
- `hour`: hour of the day
- `minute`: minute of the hour
- `second`: second (and fractions of a second) of the minute
25 changes: 25 additions & 0 deletions doc/destripe_harmonics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
destripe_harmonics.py
=====================

- Filters spherical harmonic coefficients for correlated "striping" errors following [Swenson and Wahr (2006)](http://dx.doi.org/10.1029/2005GL025285)

#### Calling Sequence
```
from gravity_toolkit.destripe_harmonics import destripe_harmonics
Ylms = destripe_harmonics(clm,slm,LMAX=60)
```

#### Inputs
1. `clm`: cosine spherical harmonic coefficients
2. `slm`: sine spherical harmonic coefficients

#### Options
- `LMIN`: Lower bound of Spherical Harmonic Degrees
- `LMAX`: Upper bound of Spherical Harmonic Degrees
- `MMAX`: Upper bound of Spherical Harmonic Orders
- `ROUND`: use round to find nearest even (True) or use floor (False)
- `NARROW`: Clm=Slm=0 if number of points is less than window size (False)

#### Outputs
- `Wclm`: filtered cosine spherical harmonic coefficients
- `Wslm`: filtered sine spherical harmonic coefficients
18 changes: 18 additions & 0 deletions doc/gauss_weights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
gauss_weights.py
================

- Computes the Gaussian weights as a function of degree
- A normalized version of [Christopher Jekeli's Gaussian averaging function](http://www.geology.osu.edu/~jekeli.1/OSUReports/reports/report_327.pdf)

#### Calling Sequence
```
from gravity_toolkit.gauss_weights import gauss_weights
wl = 2.0*np.pi*gauss_weights(hw,LMAX)
```

#### Inputs
1. `hw`: Gaussian smoothing radius in km
2. `LMAX`: Upper bound of Spherical Harmonic Degrees

#### Outputs
- `wl`: Gaussian weights for each degree `l`
22 changes: 22 additions & 0 deletions doc/geocenter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
geocenter.py
============

- Calculates the geocenter variation (in mm) from degree 1 Stokes Coefficients
- Calculates the Degree 1 Stokes Coefficients of a geocenter variation (in mm)

#### Calling Sequence
```
from gravity_toolkit.geocenter import geocenter
xyz = geocenter(C10=C10, C11=C11, S11=S11)
Ylms = geocenter(X=x, Y=y, Z=z, INVERSE=True)
```

#### Options
1. `C10`: Cosine spherical harmonic of degree 1 and order 0
2. `C11`: Cosine spherical harmonic of degree 1 and order 1
3. `S11`: Sine spherical harmonic of degree 1 and order 1
4. `X`: X-component of geocenter variation
5. `Y`: Y-component of geocenter variation
6. `Z`: Z-component of geocenter variation
7. `RADIUS`: Earth's radius for calculating spherical harmonics
8. `INVERSE`: calculates the Stokes Coefficients from geocenter
29 changes: 29 additions & 0 deletions doc/grace_date.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
grace_date.py
=============

- Finds GRACE/GRACE-FO index file from `podaac_grace_sync.py` or `gfz_isdc_grace_ftp.py`
- Reads dates of each GRACE/GRACE-FO file and assigns the month number
- Creates an index of dates for GRACE/GRACE-FO files

#### Calling Sequence
```
from gravity_toolkit.grace_date import grace_date
grace_files = grace_date(base_dir, PROC=PROC, DREL=DREL, DSET=DSET)
```

#### Inputs
1. Working data directory for GRACE/GRACE-FO data

#### Options
- `PROC`: GRACE data processing center (CSR/CNES/JPL/GFZ)
- `DREL`: GRACE data release
- `DSET`: GRACE dataset (GAA/GAB/GAC/GAD/GSM)
- `GAA` is the non-tidal atmospheric correction
- `GAB` is the non-tidal oceanic correction
- `GAC` is the combined non-tidal atmospheric and oceanic correction
- `GAD` is the GRACE ocean bottom pressure product
- `GSM` is corrected monthly GRACE/GRACE-FO static field product
- `OUTPUT`: create index of dates for GRACE/GRACE-FO data

#### Outputs
- dictionary of files mapped by GRACE/GRACE-FO month
26 changes: 26 additions & 0 deletions doc/grace_find_months.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
grace_find_months.py
====================

- Finds the months available for a GRACE/GRACE-FO product
- Finds the all months missing from the product

#### Calling Sequence
```
from gravity_toolkit.grace_find_months import grace_find_months
grace_months = grace_find_months(base_dir, PROC, DREL, DSET=DSET)
```

#### Inputs
- `base_dir`: Working data directory for GRACE/GRACE-FO data
- `PROC`: GRACE/GRACE-FO data processing center (CSR, CNES, JPL, GFZ)
- `DREL`: GRACE/GRACE-FO data release (RL04, RL05, RL06)

#### Options
- `DSET`: GRACE dataset (GSM, GAC, GAD, GAB, GAA)

#### Outputs
- `start`: First month in a GRACE/GRACE-FO dataset
- `end`: Last month in a GRACE/GRACE-FO dataset
- `missing`: missing months in a GRACE/GRACE-FO dataset
- `months`: all available months in a GRACE/GRACE-FO dataset
- `time`: center dates of all available months in a GRACE/GRACE-FO dataset
Loading

0 comments on commit 9ca8b3c

Please sign in to comment.